зеркало из https://github.com/mozilla/pjs.git
Bug 69830, cleanup after layout split by moving duplicated files to a library that is statically linked to content and layout, and backing out changes to inline some functions that now also live in the shared lib. r=jst, sr=waterson.
This commit is contained in:
Родитель
b610932022
Коммит
b2ce503d1a
|
@ -241,8 +241,6 @@ content/events/Makefile
|
|||
content/events/public/Makefile
|
||||
content/events/src/Makefile
|
||||
content/html/Makefile
|
||||
content/html/base/Makefile
|
||||
content/html/base/src/Makefile
|
||||
content/html/content/Makefile
|
||||
content/html/content/public/Makefile
|
||||
content/html/content/src/Makefile
|
||||
|
@ -276,6 +274,9 @@ content/xbl/builtin/os2/Makefile
|
|||
content/xsl/Makefile
|
||||
content/xsl/document/Makefile
|
||||
content/xsl/document/src/Makefile
|
||||
content/shared/Makefile
|
||||
content/shared/public/Makefile
|
||||
content/shared/src/Makefile
|
||||
"
|
||||
|
||||
MAKEFILES_layout="
|
||||
|
@ -294,7 +295,6 @@ layout/html/forms/Makefile
|
|||
layout/html/forms/public/Makefile
|
||||
layout/html/forms/src/Makefile
|
||||
layout/html/style/Makefile
|
||||
layout/html/style/public/Makefile
|
||||
layout/html/style/src/Makefile
|
||||
layout/html/table/Makefile
|
||||
layout/html/table/public/Makefile
|
||||
|
@ -308,8 +308,6 @@ layout/xul/base/src/Makefile
|
|||
layout/xul/base/src/outliner/Makefile
|
||||
layout/xul/base/src/outliner/src/Makefile
|
||||
layout/xul/base/src/outliner/public/Makefile
|
||||
layout/xul/content/Makefile
|
||||
layout/xul/content/src/Makefile
|
||||
"
|
||||
|
||||
MAKEFILES_mpfilelocprovider="
|
||||
|
|
|
@ -28,7 +28,7 @@ include $(DEPTH)/config/autoconf.mk
|
|||
|
||||
DIRS = base html xml xul xbl xsl
|
||||
|
||||
DIRS += events build
|
||||
DIRS += events shared build
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
|
|
|
@ -24,4 +24,4 @@ nsIStyleRuleSupplier.h
|
|||
nsIStyleSheet.h
|
||||
nsIStyleSheetLinkingElement.h
|
||||
nsITextContent.h
|
||||
nsTextFragment.h
|
||||
|
||||
|
|
|
@ -51,7 +51,6 @@ nsIStyleSheet.h \
|
|||
nsIStyleSheetLinkingElement.h \
|
||||
nsIStyleRuleProcessor.h \
|
||||
nsITextContent.h \
|
||||
nsTextFragment.h \
|
||||
nsIPrivateDOMImplementation.h \
|
||||
nsIContentSerializer.h \
|
||||
nsIHTMLToTextSink.h \
|
||||
|
|
|
@ -43,7 +43,6 @@ EXPORTS = \
|
|||
nsIStyleRuleProcessor.h \
|
||||
nsITextContent.h \
|
||||
nsContentUtils.h \
|
||||
nsTextFragment.h \
|
||||
nsIPrivateDOMImplementation.h \
|
||||
nsIContentSerializer.h \
|
||||
nsIHTMLToTextSink.h \
|
||||
|
|
|
@ -46,7 +46,6 @@ CPPSRCS = \
|
|||
nsGenericDOMDataNode.cpp \
|
||||
nsGenericDOMNodeList.cpp \
|
||||
nsGenericElement.cpp \
|
||||
nsLayoutAtoms.cpp \
|
||||
nsContentUtils.cpp \
|
||||
nsNameSpaceManager.cpp \
|
||||
nsNodeInfo.cpp \
|
||||
|
@ -56,7 +55,6 @@ CPPSRCS = \
|
|||
nsStyleContext.cpp \
|
||||
nsStyleSet.cpp \
|
||||
nsTextContentChangeData.cpp \
|
||||
nsTextFragment.cpp \
|
||||
nsTextNode.cpp \
|
||||
nsXMLContentSerializer.cpp \
|
||||
nsHTMLContentSerializer.cpp \
|
||||
|
|
|
@ -57,7 +57,6 @@ CPPSRCS = \
|
|||
nsHTMLContentSerializer.cpp \
|
||||
nsParserUtils.cpp \
|
||||
nsPlainTextSerializer.cpp \
|
||||
nsLayoutAtoms.cpp \
|
||||
nsContentUtils.cpp \
|
||||
$(NULL)
|
||||
|
||||
|
@ -84,7 +83,6 @@ CPP_OBJS= \
|
|||
.\$(OBJDIR)\nsNameSpaceManager.obj \
|
||||
.\$(OBJDIR)\nsNodeInfo.obj \
|
||||
.\$(OBJDIR)\nsNodeInfoManager.obj \
|
||||
.\$(OBJDIR)\nsTextFragment.obj \
|
||||
.\$(OBJDIR)\nsSelection.obj \
|
||||
.\$(OBJDIR)\nsRange.obj \
|
||||
.\$(OBJDIR)\nsTextContentChangeData.obj \
|
||||
|
@ -93,7 +91,6 @@ CPP_OBJS= \
|
|||
.\$(OBJDIR)\nsHTMLContentSerializer.obj \
|
||||
.\$(OBJDIR)\nsParserUtils.obj \
|
||||
.\$(OBJDIR)\nsPlainTextSerializer.obj \
|
||||
.\$(OBJDIR)\nsLayoutAtoms.obj \
|
||||
.\$(OBJDIR)\nsContentUtils.obj \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -22,9 +22,20 @@
|
|||
|
||||
#include "nsHTMLValue.h"
|
||||
#include "nsString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsISizeOfHandler.h"
|
||||
|
||||
nsHTMLValue::nsHTMLValue(nsHTMLUnit aUnit)
|
||||
: mUnit(aUnit)
|
||||
{
|
||||
NS_ASSERTION((aUnit <= eHTMLUnit_Empty), "not a valueless unit");
|
||||
if (aUnit > eHTMLUnit_Empty) {
|
||||
mUnit = eHTMLUnit_Null;
|
||||
}
|
||||
mValue.mString = nsnull;
|
||||
}
|
||||
|
||||
nsHTMLValue::nsHTMLValue(PRInt32 aValue, nsHTMLUnit aUnit)
|
||||
: mUnit(aUnit)
|
||||
{
|
||||
|
@ -50,6 +61,21 @@ nsHTMLValue::nsHTMLValue(float aValue)
|
|||
mValue.mFloat = aValue;
|
||||
}
|
||||
|
||||
nsHTMLValue::nsHTMLValue(const nsAReadableString& aValue, nsHTMLUnit aUnit)
|
||||
: mUnit(aUnit)
|
||||
{
|
||||
NS_ASSERTION((eHTMLUnit_String == aUnit) ||
|
||||
(eHTMLUnit_ColorName == aUnit), "not a string value");
|
||||
if ((eHTMLUnit_String == aUnit) ||
|
||||
(eHTMLUnit_ColorName == aUnit)) {
|
||||
mValue.mString = ToNewUnicode(aValue);
|
||||
}
|
||||
else {
|
||||
mUnit = eHTMLUnit_Null;
|
||||
mValue.mInt = 0;
|
||||
}
|
||||
}
|
||||
|
||||
nsHTMLValue::nsHTMLValue(nsISupports* aValue)
|
||||
: mUnit(eHTMLUnit_ISupports)
|
||||
{
|
||||
|
@ -89,6 +115,11 @@ nsHTMLValue::nsHTMLValue(const nsHTMLValue& aCopy)
|
|||
}
|
||||
}
|
||||
|
||||
nsHTMLValue::~nsHTMLValue(void)
|
||||
{
|
||||
Reset();
|
||||
}
|
||||
|
||||
nsHTMLValue& nsHTMLValue::operator=(const nsHTMLValue& aCopy)
|
||||
{
|
||||
Reset();
|
||||
|
@ -153,6 +184,21 @@ PRUint32 nsHTMLValue::HashValue(void) const
|
|||
}
|
||||
|
||||
|
||||
void nsHTMLValue::Reset(void)
|
||||
{
|
||||
if ((eHTMLUnit_String == mUnit) || (eHTMLUnit_ColorName == mUnit)) {
|
||||
if (nsnull != mValue.mString) {
|
||||
nsCRT::free(mValue.mString);
|
||||
}
|
||||
}
|
||||
else if (eHTMLUnit_ISupports == mUnit) {
|
||||
NS_IF_RELEASE(mValue.mISupports);
|
||||
}
|
||||
mUnit = eHTMLUnit_Null;
|
||||
mValue.mString = nsnull;
|
||||
}
|
||||
|
||||
|
||||
void nsHTMLValue::SetIntValue(PRInt32 aValue, nsHTMLUnit aUnit)
|
||||
{
|
||||
Reset();
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "nsColor.h"
|
||||
#include "nsString.h"
|
||||
#include "nsISupports.h"
|
||||
#include "nsReadableUtils.h"
|
||||
|
||||
enum nsHTMLUnit {
|
||||
eHTMLUnit_Null = 0, // (n/a) null unit, value is not specified
|
||||
|
@ -46,39 +45,14 @@ enum nsHTMLUnit {
|
|||
|
||||
class nsHTMLValue {
|
||||
public:
|
||||
nsHTMLValue(nsHTMLUnit aUnit = eHTMLUnit_Null) : mUnit(aUnit)
|
||||
{
|
||||
NS_ASSERTION((aUnit <= eHTMLUnit_Empty), "not a valueless unit");
|
||||
if (aUnit > eHTMLUnit_Empty) {
|
||||
mUnit = eHTMLUnit_Null;
|
||||
}
|
||||
mValue.mString = nsnull;
|
||||
}
|
||||
|
||||
nsHTMLValue(nsHTMLUnit aUnit = eHTMLUnit_Null);
|
||||
nsHTMLValue(PRInt32 aValue, nsHTMLUnit aUnit);
|
||||
nsHTMLValue(float aValue);
|
||||
nsHTMLValue(const nsAReadableString& aValue,
|
||||
nsHTMLUnit aUnit = eHTMLUnit_String) : mUnit(aUnit)
|
||||
{
|
||||
NS_ASSERTION((eHTMLUnit_String == aUnit) ||
|
||||
(eHTMLUnit_ColorName == aUnit), "not a string value");
|
||||
if ((eHTMLUnit_String == aUnit) ||
|
||||
(eHTMLUnit_ColorName == aUnit)) {
|
||||
mValue.mString = ToNewUnicode(aValue);
|
||||
}
|
||||
else {
|
||||
mUnit = eHTMLUnit_Null;
|
||||
mValue.mInt = 0;
|
||||
}
|
||||
}
|
||||
|
||||
nsHTMLValue(const nsAReadableString& aValue, nsHTMLUnit aUnit = eHTMLUnit_String);
|
||||
nsHTMLValue(nsISupports* aValue);
|
||||
nsHTMLValue(nscolor aValue);
|
||||
nsHTMLValue(const nsHTMLValue& aCopy);
|
||||
~nsHTMLValue(void)
|
||||
{
|
||||
Reset();
|
||||
}
|
||||
~nsHTMLValue(void);
|
||||
|
||||
nsHTMLValue& operator=(const nsHTMLValue& aCopy);
|
||||
PRBool operator==(const nsHTMLValue& aOther) const;
|
||||
|
@ -93,19 +67,7 @@ public:
|
|||
nsISupports* GetISupportsValue(void) const;
|
||||
nscolor GetColorValue(void) const;
|
||||
|
||||
void Reset(void) {
|
||||
if ((eHTMLUnit_String == mUnit) || (eHTMLUnit_ColorName == mUnit)) {
|
||||
if (nsnull != mValue.mString) {
|
||||
nsCRT::free(mValue.mString);
|
||||
}
|
||||
}
|
||||
else if (eHTMLUnit_ISupports == mUnit) {
|
||||
NS_IF_RELEASE(mValue.mISupports);
|
||||
}
|
||||
mUnit = eHTMLUnit_Null;
|
||||
mValue.mString = nsnull;
|
||||
}
|
||||
|
||||
void Reset(void);
|
||||
void SetIntValue(PRInt32 aValue, nsHTMLUnit aUnit);
|
||||
void SetPixelValue(PRInt32 aValue);
|
||||
void SetPercentValue(float aValue);
|
||||
|
|
|
@ -24,9 +24,7 @@
|
|||
|
||||
#include "nslayout.h"
|
||||
#include "nsAWritableString.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsString.h"
|
||||
#include "nsMemory.h"
|
||||
class nsString;
|
||||
|
||||
// XXX should this normalize the code to keep a \u0000 at the end?
|
||||
|
||||
|
@ -67,9 +65,7 @@ public:
|
|||
mAllBits = 0;
|
||||
}
|
||||
|
||||
~nsTextFragment() {
|
||||
ReleaseText();
|
||||
}
|
||||
~nsTextFragment();
|
||||
|
||||
/**
|
||||
* Initialize the contents of this fragment to be a copy of
|
||||
|
@ -87,10 +83,7 @@ public:
|
|||
* Initialize the contents of this fragment to be a copy of
|
||||
* the argument ucs2 string.
|
||||
*/
|
||||
nsTextFragment(const PRUnichar* aString) : m1b(nsnull), mAllBits(0) {
|
||||
SetTo(aString, nsCRT::strlen(aString));
|
||||
}
|
||||
|
||||
nsTextFragment(const PRUnichar* aString);
|
||||
|
||||
/**
|
||||
* Initialize the contents of this fragment to be a copy of
|
||||
|
@ -184,55 +177,7 @@ public:
|
|||
* buffer. Like operator= except a length is specified instead of
|
||||
* assuming 0 termination.
|
||||
*/
|
||||
void SetTo(const PRUnichar* aBuffer, PRInt32 aLength) {
|
||||
ReleaseText();
|
||||
if (0 != aLength) {
|
||||
// See if we need to store the data in ucs2 or not
|
||||
PRBool need2 = PR_FALSE;
|
||||
const PRUnichar* ucp = aBuffer;
|
||||
const PRUnichar* uend = aBuffer + aLength;
|
||||
while (ucp < uend) {
|
||||
PRUnichar ch = *ucp++;
|
||||
if (ch >> 8) {
|
||||
need2 = PR_TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (need2) {
|
||||
// Use ucs2 storage because we have to
|
||||
PRUnichar* nt = (PRUnichar*)nsMemory::Alloc(aLength*sizeof(PRUnichar));
|
||||
if (nsnull != nt) {
|
||||
// Copy data
|
||||
nsCRT::memcpy(nt, aBuffer, sizeof(PRUnichar) * aLength);
|
||||
|
||||
// Setup our fields
|
||||
m2b = nt;
|
||||
mState.mIs2b = 1;
|
||||
mState.mInHeap = 1;
|
||||
mState.mLength = aLength;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Use 1 byte storage because we can
|
||||
unsigned char* nt = (unsigned char*)nsMemory::Alloc(aLength*sizeof(unsigned char));
|
||||
if (nsnull != nt) {
|
||||
// Copy data
|
||||
unsigned char* cp = nt;
|
||||
unsigned char* end = nt + aLength;
|
||||
while (cp < end) {
|
||||
*cp++ = (unsigned char) *aBuffer++;
|
||||
}
|
||||
|
||||
// Setup our fields
|
||||
m1b = nt;
|
||||
mState.mIs2b = 0;
|
||||
mState.mInHeap = 1;
|
||||
mState.mLength = aLength;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void SetTo(const PRUnichar* aBuffer, PRInt32 aLength);
|
||||
|
||||
/**
|
||||
* Change the contents of this fragment to be a copy of the given
|
||||
|
@ -244,14 +189,7 @@ public:
|
|||
/**
|
||||
* Append the contents of this string fragment to aString
|
||||
*/
|
||||
void AppendTo(nsString& aString) const {
|
||||
if (mState.mIs2b) {
|
||||
aString.Append(m2b, mState.mLength);
|
||||
}
|
||||
else {
|
||||
aString.AppendWithConversion((char*)m1b, mState.mLength);
|
||||
}
|
||||
}
|
||||
void AppendTo(nsString& aString) const;
|
||||
|
||||
/**
|
||||
* Make a copy of the fragments contents starting at offset for
|
||||
|
@ -297,20 +235,7 @@ protected:
|
|||
FragmentBits mState;
|
||||
};
|
||||
|
||||
void ReleaseText() {
|
||||
if (mState.mLength && m1b && mState.mInHeap) {
|
||||
if (mState.mIs2b) {
|
||||
nsMemory::Free(m2b);
|
||||
}
|
||||
else {
|
||||
nsMemory::Free(m1b);
|
||||
}
|
||||
}
|
||||
m1b = nsnull;
|
||||
mState.mIs2b = 0;
|
||||
mState.mInHeap = 0;
|
||||
mState.mLength = 0;
|
||||
}
|
||||
void ReleaseText();
|
||||
};
|
||||
|
||||
#endif /* nsTextFragment_h___ */
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
#
|
||||
# This is a list of local files which get copied to the mozilla:dist:content directory
|
||||
#
|
||||
|
||||
nsContentCID.h
|
||||
gbdate.h
|
|
@ -45,11 +45,10 @@ ifndef MKSHLIB_FORCE_ALL
|
|||
CPPSRCS += dlldeps.cpp
|
||||
endif
|
||||
|
||||
EXPORTS = nsContentCID.h $(BUILD_DATE)
|
||||
EXPORTS = nsContentCID.h
|
||||
|
||||
SHARED_LIBRARY_LIBS = \
|
||||
$(DIST)/lib/libgkconevents_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libgkconhtmlbase_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libgkconhtmlcon_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libgkconhtmldoc_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libgkconhtmlstyle_s.$(LIB_SUFFIX) \
|
||||
|
@ -61,6 +60,7 @@ SHARED_LIBRARY_LIBS = \
|
|||
$(DIST)/lib/libgkconxultmpl_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libgkconxbl_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libgkconbase_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libgkconshared_s.$(LIB_SUFFIX) \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_PERF_METRICS
|
||||
|
@ -80,8 +80,6 @@ ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
|
|||
EXPORT_OBJS = 1
|
||||
endif
|
||||
|
||||
GARBAGE += $(BUILD_DATE)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
DEFINES += -D_IMPL_NS_HTML
|
||||
|
|
|
@ -38,7 +38,7 @@ CPP_OBJS= \
|
|||
.\$(OBJDIR)\nsContentModule.obj \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS=nsContentCID.h $(BUILD_DATE)
|
||||
EXPORTS=nsContentCID.h
|
||||
|
||||
|
||||
MAKE_OBJ_TYPE = DLL
|
||||
|
@ -62,7 +62,6 @@ LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor -I$(PUBLIC)\dom \
|
|||
# These are the libraries we need to link with to create the dll
|
||||
LLIBS= \
|
||||
$(DIST)\lib\contentbase_s.lib \
|
||||
$(DIST)\lib\contenthtmlbase_s.lib \
|
||||
$(DIST)\lib\contenthtmlcontent_s.lib \
|
||||
$(DIST)\lib\contenthtmldoc_s.lib \
|
||||
$(DIST)\lib\contenthtmlstyle_s.lib \
|
||||
|
@ -74,6 +73,7 @@ LLIBS= \
|
|||
$(DIST)\lib\contentxultemplates_s.lib \
|
||||
$(DIST)\lib\contentxbl_s.lib \
|
||||
$(DIST)\lib\contentevents_s.lib \
|
||||
$(DIST)\lib\contentshared_s.lib \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(DIST)\lib\gkgfxwin.lib \
|
||||
$(DIST)\lib\timer_s.lib \
|
||||
|
|
|
@ -513,33 +513,6 @@ nsContentDLF::CreateXULDocumentFromStream(nsIInputStream& aXULStream,
|
|||
return status;
|
||||
}
|
||||
|
||||
static NS_DEFINE_IID(kDocumentFactoryImplCID, NS_CONTENT_DOCUMENT_LOADER_FACTORY_CID);
|
||||
|
||||
static nsresult
|
||||
RegisterTypes(nsIComponentManager* aCompMgr,
|
||||
const char* aCommand,
|
||||
nsIFile* aPath,
|
||||
char** aTypes)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
while (*aTypes) {
|
||||
char contractid[500];
|
||||
char* contentType = *aTypes++;
|
||||
PR_snprintf(contractid, sizeof(contractid),
|
||||
NS_DOCUMENT_LOADER_FACTORY_CONTRACTID_PREFIX "%s;1?type=%s",
|
||||
aCommand, contentType);
|
||||
#ifdef NOISY_REGISTRY
|
||||
printf("Register %s => %s\n", contractid, aPath);
|
||||
#endif
|
||||
rv = aCompMgr->RegisterComponentSpec(kDocumentFactoryImplCID, "Content",
|
||||
contractid, aPath, PR_TRUE, PR_TRUE);
|
||||
if (NS_FAILED(rv)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsContentModule::RegisterDocumentFactories(nsIComponentManager* aCompMgr,
|
||||
nsIFile* aPath)
|
||||
|
@ -549,6 +522,8 @@ nsContentModule::RegisterDocumentFactories(nsIComponentManager* aCompMgr,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
static NS_DEFINE_IID(kDocumentFactoryImplCID, NS_CONTENT_DOCUMENT_LOADER_FACTORY_CID);
|
||||
|
||||
void
|
||||
nsContentModule::UnregisterDocumentFactories(nsIComponentManager* aCompMgr,
|
||||
nsIFile* aPath)
|
||||
|
|
|
@ -26,6 +26,6 @@ VPATH = @srcdir@
|
|||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = base content document style
|
||||
DIRS = content document style
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
#include "nsIURL.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIWebShell.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsLayoutAtoms.h"
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..
|
||||
|
||||
DIRS = base content document style
|
||||
# tests is now done after we build content/events
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
|
@ -1,12 +1,9 @@
|
|||
#
|
||||
# This is a list of local files which get copied to the mozilla:dist:content directory
|
||||
#
|
||||
nsCSSAtomList.h
|
||||
nsCSSAtoms.h
|
||||
nsIComputedDOMStyle.h
|
||||
nsICSSLoader.h
|
||||
nsICSSLoaderObserver.h
|
||||
nsICSSParser.h
|
||||
nsICSSPseudoComparator.h
|
||||
nsICSSStyleSheet.h
|
||||
nsStyleUtil.h
|
||||
|
|
|
@ -29,13 +29,10 @@ include $(DEPTH)/config/autoconf.mk
|
|||
MODULE = layout
|
||||
|
||||
EXPORTS = \
|
||||
nsCSSAtoms.h \
|
||||
nsCSSAtomList.h \
|
||||
nsICSSLoader.h \
|
||||
nsICSSParser.h \
|
||||
nsICSSPseudoComparator.h \
|
||||
nsICSSStyleSheet.h \
|
||||
nsStyleUtil.h \
|
||||
nsICSSLoaderObserver.h \
|
||||
nsIComputedDOMStyle.h \
|
||||
$(NULL)
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
DEPTH=..\..\..\..
|
||||
|
||||
EXPORTS=nsCSSAtoms.h nsCSSAtomList.h nsICSSLoader.h nsICSSParser.h nsICSSPseudoComparator.h nsICSSStyleSheet.h nsStyleUtil.h nsICSSLoaderObserver.h nsIComputedDOMStyle.h
|
||||
EXPORTS=nsICSSLoader.h nsICSSParser.h nsICSSPseudoComparator.h nsICSSStyleSheet.h nsICSSLoaderObserver.h nsIComputedDOMStyle.h
|
||||
MODULE=raptor
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
|
|
@ -1,13 +1,8 @@
|
|||
#
|
||||
# This is a list of local files which get copied to the mozilla:dist:content directory
|
||||
#
|
||||
nsCSSKeywordList.h
|
||||
nsCSSKeywords.h
|
||||
nsCSSPropList.h
|
||||
nsCSSProps.h
|
||||
nsCSSValue.h
|
||||
nsDOMCSSDeclaration.h
|
||||
nsHTMLValue.h
|
||||
nsICSSCharsetRule.h
|
||||
nsICSSDeclaration.h
|
||||
nsICSSGroupRule.h
|
||||
|
|
|
@ -31,12 +31,9 @@ LIBRARY_NAME = gkconhtmlstyle_s
|
|||
REQUIRES = xpcom string dom widget timer caps editor locale js view necko webshell pref rdf xul htmlparser txmgr docshell uriloader unicharutil uconv xuldoc xpconnect
|
||||
|
||||
CPPSRCS = \
|
||||
nsCSSAtoms.cpp \
|
||||
nsCSSKeywords.cpp \
|
||||
nsCSSDeclaration.cpp \
|
||||
nsCSSLoader.cpp \
|
||||
nsCSSParser.cpp \
|
||||
nsCSSProps.cpp \
|
||||
nsCSSScanner.cpp \
|
||||
nsCSSRule.cpp \
|
||||
nsCSSStyleRule.cpp \
|
||||
|
@ -47,18 +44,12 @@ CPPSRCS = \
|
|||
nsHTMLAttributes.cpp \
|
||||
nsHTMLStyleSheet.cpp \
|
||||
nsHTMLCSSStyleSheet.cpp \
|
||||
nsHTMLValue.cpp \
|
||||
nsStyleUtil.cpp \
|
||||
nsComputedDOMStyle.cpp \
|
||||
nsROCSSPrimitiveValue.cpp \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS = \
|
||||
nsDOMCSSDeclaration.h \
|
||||
nsCSSKeywords.h \
|
||||
nsCSSKeywordList.h \
|
||||
nsCSSProps.h \
|
||||
nsCSSPropList.h \
|
||||
nsCSSValue.h \
|
||||
nsICSSStyleRuleProcessor.h \
|
||||
nsICSSRule.h \
|
||||
|
@ -69,7 +60,6 @@ EXPORTS = \
|
|||
nsICSSMediaRule.h \
|
||||
nsICSSNameSpaceRule.h \
|
||||
nsICSSDeclaration.h \
|
||||
nsHTMLValue.h \
|
||||
nsIHTMLCSSStyleSheet.h \
|
||||
nsIHTMLAttributes.h \
|
||||
$(NULL)
|
||||
|
|
|
@ -27,10 +27,6 @@ MODULE=raptor
|
|||
DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN
|
||||
|
||||
EXPORTS = \
|
||||
nsCSSKeywords.h \
|
||||
nsCSSKeywordList.h \
|
||||
nsCSSProps.h \
|
||||
nsCSSPropList.h \
|
||||
nsCSSValue.h \
|
||||
nsICSSStyleRuleProcessor.h \
|
||||
nsICSSRule.h \
|
||||
|
@ -42,19 +38,15 @@ EXPORTS = \
|
|||
nsICSSNameSpaceRule.h \
|
||||
nsICSSDeclaration.h \
|
||||
nsIHTMLCSSStyleSheet.h \
|
||||
nsHTMLValue.h \
|
||||
nsDOMCSSDeclaration.h \
|
||||
nsIHTMLAttributes.h \
|
||||
$(NULL)
|
||||
|
||||
CPPSRCS= \
|
||||
nsHTMLStyleSheet.cpp \
|
||||
nsCSSAtoms.cpp \
|
||||
nsCSSKeywords.cpp \
|
||||
nsCSSDeclaration.cpp \
|
||||
nsCSSLoader.cpp \
|
||||
nsCSSParser.cpp \
|
||||
nsCSSProps.cpp \
|
||||
nsCSSScanner.cpp \
|
||||
nsCSSRule.cpp \
|
||||
nsCSSStyleRule.cpp \
|
||||
|
@ -63,8 +55,6 @@ CPPSRCS= \
|
|||
nsCSSValue.cpp \
|
||||
nsHTMLAttributes.cpp \
|
||||
nsHTMLCSSStyleSheet.cpp \
|
||||
nsHTMLValue.cpp \
|
||||
nsStyleUtil.cpp \
|
||||
nsDOMCSSDeclaration.cpp \
|
||||
nsComputedDOMStyle.cpp \
|
||||
nsROCSSPrimitiveValue.cpp \
|
||||
|
@ -72,12 +62,9 @@ CPPSRCS= \
|
|||
|
||||
CPP_OBJS = \
|
||||
.\$(OBJDIR)\nsHTMLStyleSheet.obj \
|
||||
.\$(OBJDIR)\nsCSSAtoms.obj \
|
||||
.\$(OBJDIR)\nsCSSKeywords.obj \
|
||||
.\$(OBJDIR)\nsCSSDeclaration.obj \
|
||||
.\$(OBJDIR)\nsCSSLoader.obj \
|
||||
.\$(OBJDIR)\nsCSSParser.obj \
|
||||
.\$(OBJDIR)\nsCSSProps.obj \
|
||||
.\$(OBJDIR)\nsCSSScanner.obj \
|
||||
.\$(OBJDIR)\nsCSSRule.obj \
|
||||
.\$(OBJDIR)\nsCSSStyleRule.obj \
|
||||
|
@ -86,8 +73,6 @@ CPP_OBJS = \
|
|||
.\$(OBJDIR)\nsCSSValue.obj \
|
||||
.\$(OBJDIR)\nsHTMLAttributes.obj \
|
||||
.\$(OBJDIR)\nsHTMLCSSStyleSheet.obj \
|
||||
.\$(OBJDIR)\nsHTMLValue.obj \
|
||||
.\$(OBJDIR)\nsStyleUtil.obj \
|
||||
.\$(OBJDIR)\nsDOMCSSDeclaration.obj \
|
||||
.\$(OBJDIR)\nsComputedDOMStyle.obj \
|
||||
.\$(OBJDIR)\nsROCSSPrimitiveValue.obj \
|
||||
|
|
|
@ -29,6 +29,7 @@ DIRS= \
|
|||
xbl \
|
||||
events \
|
||||
xul \
|
||||
shared \
|
||||
build \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = public src
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
@ -26,7 +26,6 @@
|
|||
#include "nsColor.h"
|
||||
#include "nsString.h"
|
||||
#include "nsISupports.h"
|
||||
#include "nsReadableUtils.h"
|
||||
|
||||
enum nsHTMLUnit {
|
||||
eHTMLUnit_Null = 0, // (n/a) null unit, value is not specified
|
||||
|
@ -46,39 +45,14 @@ enum nsHTMLUnit {
|
|||
|
||||
class nsHTMLValue {
|
||||
public:
|
||||
nsHTMLValue(nsHTMLUnit aUnit = eHTMLUnit_Null) : mUnit(aUnit)
|
||||
{
|
||||
NS_ASSERTION((aUnit <= eHTMLUnit_Empty), "not a valueless unit");
|
||||
if (aUnit > eHTMLUnit_Empty) {
|
||||
mUnit = eHTMLUnit_Null;
|
||||
}
|
||||
mValue.mString = nsnull;
|
||||
}
|
||||
|
||||
nsHTMLValue(nsHTMLUnit aUnit = eHTMLUnit_Null);
|
||||
nsHTMLValue(PRInt32 aValue, nsHTMLUnit aUnit);
|
||||
nsHTMLValue(float aValue);
|
||||
nsHTMLValue(const nsAReadableString& aValue,
|
||||
nsHTMLUnit aUnit = eHTMLUnit_String) : mUnit(aUnit)
|
||||
{
|
||||
NS_ASSERTION((eHTMLUnit_String == aUnit) ||
|
||||
(eHTMLUnit_ColorName == aUnit), "not a string value");
|
||||
if ((eHTMLUnit_String == aUnit) ||
|
||||
(eHTMLUnit_ColorName == aUnit)) {
|
||||
mValue.mString = ToNewUnicode(aValue);
|
||||
}
|
||||
else {
|
||||
mUnit = eHTMLUnit_Null;
|
||||
mValue.mInt = 0;
|
||||
}
|
||||
}
|
||||
|
||||
nsHTMLValue(const nsAReadableString& aValue, nsHTMLUnit aUnit = eHTMLUnit_String);
|
||||
nsHTMLValue(nsISupports* aValue);
|
||||
nsHTMLValue(nscolor aValue);
|
||||
nsHTMLValue(const nsHTMLValue& aCopy);
|
||||
~nsHTMLValue(void)
|
||||
{
|
||||
Reset();
|
||||
}
|
||||
~nsHTMLValue(void);
|
||||
|
||||
nsHTMLValue& operator=(const nsHTMLValue& aCopy);
|
||||
PRBool operator==(const nsHTMLValue& aOther) const;
|
||||
|
@ -93,19 +67,7 @@ public:
|
|||
nsISupports* GetISupportsValue(void) const;
|
||||
nscolor GetColorValue(void) const;
|
||||
|
||||
void Reset(void) {
|
||||
if ((eHTMLUnit_String == mUnit) || (eHTMLUnit_ColorName == mUnit)) {
|
||||
if (nsnull != mValue.mString) {
|
||||
nsCRT::free(mValue.mString);
|
||||
}
|
||||
}
|
||||
else if (eHTMLUnit_ISupports == mUnit) {
|
||||
NS_IF_RELEASE(mValue.mISupports);
|
||||
}
|
||||
mUnit = eHTMLUnit_Null;
|
||||
mValue.mString = nsnull;
|
||||
}
|
||||
|
||||
void Reset(void);
|
||||
void SetIntValue(PRInt32 aValue, nsHTMLUnit aUnit);
|
||||
void SetPixelValue(PRInt32 aValue);
|
||||
void SetPercentValue(float aValue);
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include "nscore.h"
|
||||
#include "nsCoord.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsString.h"
|
||||
class nsString;
|
||||
|
||||
enum nsStyleUnit {
|
||||
eStyleUnit_Null = 0, // (no value) value is not specified
|
||||
|
@ -48,85 +48,14 @@ typedef union {
|
|||
|
||||
class nsStyleCoord {
|
||||
public:
|
||||
nsStyleCoord(nsStyleUnit aUnit = eStyleUnit_Null)
|
||||
: mUnit(aUnit) {
|
||||
NS_ASSERTION(aUnit < eStyleUnit_Percent, "not a valueless unit");
|
||||
if (aUnit >= eStyleUnit_Percent) {
|
||||
mUnit = eStyleUnit_Null;
|
||||
}
|
||||
mValue.mInt = 0;
|
||||
}
|
||||
|
||||
nsStyleCoord(nscoord aValue)
|
||||
: mUnit(eStyleUnit_Coord) {
|
||||
mValue.mInt = aValue;
|
||||
}
|
||||
|
||||
nsStyleCoord(PRInt32 aValue, nsStyleUnit aUnit)
|
||||
: mUnit(aUnit) {
|
||||
//if you want to pass in eStyleUnit_Coord, don't. instead, use the
|
||||
//constructor just above this one... MMP
|
||||
NS_ASSERTION((aUnit == eStyleUnit_Proportional) ||
|
||||
(aUnit == eStyleUnit_Enumerated) ||
|
||||
(aUnit == eStyleUnit_Integer), "not an int value");
|
||||
if ((aUnit == eStyleUnit_Proportional) ||
|
||||
(aUnit == eStyleUnit_Enumerated) ||
|
||||
(aUnit == eStyleUnit_Integer)) {
|
||||
mValue.mInt = aValue;
|
||||
}
|
||||
else {
|
||||
mUnit = eStyleUnit_Null;
|
||||
mValue.mInt = 0;
|
||||
}
|
||||
}
|
||||
|
||||
nsStyleCoord(float aValue, nsStyleUnit aUnit)
|
||||
: mUnit(aUnit) {
|
||||
NS_ASSERTION((aUnit == eStyleUnit_Percent) ||
|
||||
(aUnit == eStyleUnit_Factor), "not a float value");
|
||||
if ((aUnit == eStyleUnit_Percent) ||
|
||||
(aUnit == eStyleUnit_Factor)) {
|
||||
mValue.mFloat = aValue;
|
||||
}
|
||||
else {
|
||||
mUnit = eStyleUnit_Null;
|
||||
mValue.mInt = 0;
|
||||
}
|
||||
}
|
||||
|
||||
nsStyleCoord(const nsStyleCoord& aCopy)
|
||||
: mUnit(aCopy.mUnit) {
|
||||
if ((eStyleUnit_Percent <= mUnit) && (mUnit < eStyleUnit_Coord)) {
|
||||
mValue.mFloat = aCopy.mValue.mFloat;
|
||||
}
|
||||
else {
|
||||
mValue.mInt = aCopy.mValue.mInt;
|
||||
}
|
||||
}
|
||||
|
||||
nsStyleCoord& operator=(const nsStyleCoord& aCopy) {
|
||||
mUnit = aCopy.mUnit;
|
||||
if ((eStyleUnit_Percent <= mUnit) && (mUnit < eStyleUnit_Coord)) {
|
||||
mValue.mFloat = aCopy.mValue.mFloat;
|
||||
}
|
||||
else {
|
||||
mValue.mInt = aCopy.mValue.mInt;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
PRBool operator==(const nsStyleCoord& aOther) const {
|
||||
if (mUnit == aOther.mUnit) {
|
||||
if ((eStyleUnit_Percent <= mUnit) && (mUnit < eStyleUnit_Coord)) {
|
||||
return PRBool(mValue.mFloat == aOther.mValue.mFloat);
|
||||
}
|
||||
else {
|
||||
return PRBool(mValue.mInt == aOther.mValue.mInt);
|
||||
}
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
nsStyleCoord(nsStyleUnit aUnit = eStyleUnit_Null);
|
||||
nsStyleCoord(nscoord aValue);
|
||||
nsStyleCoord(PRInt32 aValue, nsStyleUnit aUnit);
|
||||
nsStyleCoord(float aValue, nsStyleUnit aUnit);
|
||||
nsStyleCoord(const nsStyleCoord& aCopy);
|
||||
|
||||
nsStyleCoord& operator=(const nsStyleCoord& aCopy);
|
||||
PRBool operator==(const nsStyleCoord& aOther) const;
|
||||
PRBool operator!=(const nsStyleCoord& aOther) const;
|
||||
|
||||
nsStyleUnit GetUnit(void) const { return mUnit; }
|
||||
|
@ -136,98 +65,18 @@ public:
|
|||
float GetFactorValue(void) const;
|
||||
void GetUnionValue(nsStyleUnion& aValue) const;
|
||||
|
||||
void Reset(void) {
|
||||
mUnit = eStyleUnit_Null;
|
||||
mValue.mInt = 0;
|
||||
}
|
||||
void Reset(void); // sets to null
|
||||
void SetCoordValue(nscoord aValue);
|
||||
void SetIntValue(PRInt32 aValue, nsStyleUnit aUnit);
|
||||
void SetPercentValue(float aValue);
|
||||
void SetFactorValue(float aValue);
|
||||
void SetNormalValue(void);
|
||||
void SetAutoValue(void);
|
||||
void SetInheritValue(void);
|
||||
void SetUnionValue(const nsStyleUnion& aValue, nsStyleUnit aUnit);
|
||||
|
||||
void SetCoordValue(nscoord aValue) {
|
||||
mUnit = eStyleUnit_Coord;
|
||||
mValue.mInt = aValue;
|
||||
}
|
||||
|
||||
void SetIntValue(PRInt32 aValue, nsStyleUnit aUnit) {
|
||||
if ((aUnit == eStyleUnit_Proportional) ||
|
||||
(aUnit == eStyleUnit_Enumerated) ||
|
||||
(aUnit == eStyleUnit_Chars) ||
|
||||
(aUnit == eStyleUnit_Integer)) {
|
||||
mUnit = aUnit;
|
||||
mValue.mInt = aValue;
|
||||
}
|
||||
else {
|
||||
NS_WARNING("not an int value");
|
||||
Reset();
|
||||
}
|
||||
}
|
||||
|
||||
void SetPercentValue(float aValue) {
|
||||
mUnit = eStyleUnit_Percent;
|
||||
mValue.mFloat = aValue;
|
||||
}
|
||||
|
||||
void SetFactorValue(float aValue) {
|
||||
mUnit = eStyleUnit_Factor;
|
||||
mValue.mFloat = aValue;
|
||||
}
|
||||
|
||||
void SetNormalValue(void) {
|
||||
mUnit = eStyleUnit_Normal;
|
||||
mValue.mInt = 0;
|
||||
}
|
||||
|
||||
void SetAutoValue(void) {
|
||||
mUnit = eStyleUnit_Auto;
|
||||
mValue.mInt = 0;
|
||||
}
|
||||
|
||||
void SetInheritValue(void) {
|
||||
mUnit = eStyleUnit_Inherit;
|
||||
mValue.mInt = 0;
|
||||
}
|
||||
|
||||
void SetUnionValue(const nsStyleUnion& aValue, nsStyleUnit aUnit) {
|
||||
mUnit = aUnit;
|
||||
#if PR_BYTES_PER_INT == PR_BYTES_PER_FLOAT
|
||||
mValue.mInt = aValue.mInt;
|
||||
#else
|
||||
nsCRT::memcpy(&mValue, &aValue, sizeof(nsStyleUnion));
|
||||
#endif
|
||||
}
|
||||
|
||||
void AppendToString(nsString& aBuffer) const {
|
||||
if ((eStyleUnit_Percent <= mUnit) && (mUnit < eStyleUnit_Coord)) {
|
||||
aBuffer.AppendFloat(mValue.mFloat);
|
||||
}
|
||||
else if ((eStyleUnit_Coord == mUnit) ||
|
||||
(eStyleUnit_Proportional == mUnit) ||
|
||||
(eStyleUnit_Enumerated == mUnit) ||
|
||||
(eStyleUnit_Integer == mUnit)) {
|
||||
aBuffer.AppendInt(mValue.mInt, 10);
|
||||
aBuffer.AppendWithConversion("[0x");
|
||||
aBuffer.AppendInt(mValue.mInt, 16);
|
||||
aBuffer.AppendWithConversion(']');
|
||||
}
|
||||
|
||||
switch (mUnit) {
|
||||
case eStyleUnit_Null: aBuffer.AppendWithConversion("Null"); break;
|
||||
case eStyleUnit_Coord: aBuffer.AppendWithConversion("tw"); break;
|
||||
case eStyleUnit_Percent: aBuffer.AppendWithConversion("%"); break;
|
||||
case eStyleUnit_Factor: aBuffer.AppendWithConversion("f"); break;
|
||||
case eStyleUnit_Normal: aBuffer.AppendWithConversion("Normal"); break;
|
||||
case eStyleUnit_Auto: aBuffer.AppendWithConversion("Auto"); break;
|
||||
case eStyleUnit_Inherit: aBuffer.AppendWithConversion("Inherit"); break;
|
||||
case eStyleUnit_Proportional: aBuffer.AppendWithConversion("*"); break;
|
||||
case eStyleUnit_Enumerated: aBuffer.AppendWithConversion("enum"); break;
|
||||
case eStyleUnit_Integer: aBuffer.AppendWithConversion("int"); break;
|
||||
case eStyleUnit_Chars: aBuffer.AppendWithConversion("chars"); break;
|
||||
}
|
||||
aBuffer.AppendWithConversion(' ');
|
||||
}
|
||||
|
||||
void ToString(nsString& aBuffer) const {
|
||||
aBuffer.Truncate();
|
||||
AppendToString(aBuffer);
|
||||
}
|
||||
void AppendToString(nsString& aBuffer) const;
|
||||
void ToString(nsString& aBuffer) const;
|
||||
|
||||
public:
|
||||
nsStyleUnit mUnit;
|
||||
|
@ -235,38 +84,12 @@ public:
|
|||
};
|
||||
|
||||
|
||||
#define COMPARE_SIDE(side) \
|
||||
if ((eStyleUnit_Percent <= m##side##Unit) && \
|
||||
(m##side##Unit < eStyleUnit_Coord)) { \
|
||||
if (m##side##Value.mFloat != aOther.m##side##Value.mFloat) \
|
||||
return PR_FALSE; \
|
||||
} \
|
||||
else { \
|
||||
if (m##side##Value.mInt != aOther.m##side##Value.mInt) \
|
||||
return PR_FALSE; \
|
||||
}
|
||||
|
||||
class nsStyleSides {
|
||||
public:
|
||||
nsStyleSides(void) {
|
||||
nsCRT::memset(this, 0x00, sizeof(nsStyleSides));
|
||||
}
|
||||
nsStyleSides(void);
|
||||
|
||||
// nsStyleSides& operator=(const nsStyleSides& aCopy); // use compiler's version
|
||||
PRBool operator==(const nsStyleSides& aOther) const {
|
||||
if ((mLeftUnit == aOther.mLeftUnit) &&
|
||||
(mTopUnit == aOther.mTopUnit) &&
|
||||
(mRightUnit == aOther.mRightUnit) &&
|
||||
(mBottomUnit == aOther.mBottomUnit)) {
|
||||
COMPARE_SIDE(Left);
|
||||
COMPARE_SIDE(Top);
|
||||
COMPARE_SIDE(Right);
|
||||
COMPARE_SIDE(Bottom);
|
||||
return PR_TRUE;
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRBool operator==(const nsStyleSides& aOther) const;
|
||||
PRBool operator!=(const nsStyleSides& aOther) const;
|
||||
|
||||
nsStyleUnit GetLeftUnit(void) const;
|
||||
|
@ -279,39 +102,14 @@ public:
|
|||
nsStyleCoord& GetRight(nsStyleCoord& aCoord) const;
|
||||
nsStyleCoord& GetBottom(nsStyleCoord& aCoord) const;
|
||||
|
||||
void Reset(void) {
|
||||
nsCRT::memset(this, 0x00, sizeof(nsStyleSides));
|
||||
}
|
||||
|
||||
void Reset(void);
|
||||
void SetLeft(const nsStyleCoord& aCoord);
|
||||
void SetTop(const nsStyleCoord& aCoord);
|
||||
void SetRight(const nsStyleCoord& aCoord);
|
||||
void SetBottom(const nsStyleCoord& aCoord);
|
||||
|
||||
void AppendToString(nsString& aBuffer) const {
|
||||
nsStyleCoord temp;
|
||||
|
||||
GetLeft(temp);
|
||||
aBuffer.AppendWithConversion("left: ");
|
||||
temp.AppendToString(aBuffer);
|
||||
|
||||
GetTop(temp);
|
||||
aBuffer.AppendWithConversion("top: ");
|
||||
temp.AppendToString(aBuffer);
|
||||
|
||||
GetRight(temp);
|
||||
aBuffer.AppendWithConversion("right: ");
|
||||
temp.AppendToString(aBuffer);
|
||||
|
||||
GetBottom(temp);
|
||||
aBuffer.AppendWithConversion("bottom: ");
|
||||
temp.AppendToString(aBuffer);
|
||||
}
|
||||
|
||||
void ToString(nsString& aBuffer) const {
|
||||
aBuffer.Truncate();
|
||||
AppendToString(aBuffer);
|
||||
}
|
||||
void AppendToString(nsString& aBuffer) const;
|
||||
void ToString(nsString& aBuffer) const;
|
||||
|
||||
protected:
|
||||
PRUint8 mLeftUnit;
|
||||
|
|
|
@ -24,9 +24,7 @@
|
|||
|
||||
#include "nslayout.h"
|
||||
#include "nsAWritableString.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsString.h"
|
||||
#include "nsMemory.h"
|
||||
class nsString;
|
||||
|
||||
// XXX should this normalize the code to keep a \u0000 at the end?
|
||||
|
||||
|
@ -67,9 +65,7 @@ public:
|
|||
mAllBits = 0;
|
||||
}
|
||||
|
||||
~nsTextFragment() {
|
||||
ReleaseText();
|
||||
}
|
||||
~nsTextFragment();
|
||||
|
||||
/**
|
||||
* Initialize the contents of this fragment to be a copy of
|
||||
|
@ -87,10 +83,7 @@ public:
|
|||
* Initialize the contents of this fragment to be a copy of
|
||||
* the argument ucs2 string.
|
||||
*/
|
||||
nsTextFragment(const PRUnichar* aString) : m1b(nsnull), mAllBits(0) {
|
||||
SetTo(aString, nsCRT::strlen(aString));
|
||||
}
|
||||
|
||||
nsTextFragment(const PRUnichar* aString);
|
||||
|
||||
/**
|
||||
* Initialize the contents of this fragment to be a copy of
|
||||
|
@ -184,55 +177,7 @@ public:
|
|||
* buffer. Like operator= except a length is specified instead of
|
||||
* assuming 0 termination.
|
||||
*/
|
||||
void SetTo(const PRUnichar* aBuffer, PRInt32 aLength) {
|
||||
ReleaseText();
|
||||
if (0 != aLength) {
|
||||
// See if we need to store the data in ucs2 or not
|
||||
PRBool need2 = PR_FALSE;
|
||||
const PRUnichar* ucp = aBuffer;
|
||||
const PRUnichar* uend = aBuffer + aLength;
|
||||
while (ucp < uend) {
|
||||
PRUnichar ch = *ucp++;
|
||||
if (ch >> 8) {
|
||||
need2 = PR_TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (need2) {
|
||||
// Use ucs2 storage because we have to
|
||||
PRUnichar* nt = (PRUnichar*)nsMemory::Alloc(aLength*sizeof(PRUnichar));
|
||||
if (nsnull != nt) {
|
||||
// Copy data
|
||||
nsCRT::memcpy(nt, aBuffer, sizeof(PRUnichar) * aLength);
|
||||
|
||||
// Setup our fields
|
||||
m2b = nt;
|
||||
mState.mIs2b = 1;
|
||||
mState.mInHeap = 1;
|
||||
mState.mLength = aLength;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Use 1 byte storage because we can
|
||||
unsigned char* nt = (unsigned char*)nsMemory::Alloc(aLength*sizeof(unsigned char));
|
||||
if (nsnull != nt) {
|
||||
// Copy data
|
||||
unsigned char* cp = nt;
|
||||
unsigned char* end = nt + aLength;
|
||||
while (cp < end) {
|
||||
*cp++ = (unsigned char) *aBuffer++;
|
||||
}
|
||||
|
||||
// Setup our fields
|
||||
m1b = nt;
|
||||
mState.mIs2b = 0;
|
||||
mState.mInHeap = 1;
|
||||
mState.mLength = aLength;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void SetTo(const PRUnichar* aBuffer, PRInt32 aLength);
|
||||
|
||||
/**
|
||||
* Change the contents of this fragment to be a copy of the given
|
||||
|
@ -244,14 +189,7 @@ public:
|
|||
/**
|
||||
* Append the contents of this string fragment to aString
|
||||
*/
|
||||
void AppendTo(nsString& aString) const {
|
||||
if (mState.mIs2b) {
|
||||
aString.Append(m2b, mState.mLength);
|
||||
}
|
||||
else {
|
||||
aString.AppendWithConversion((char*)m1b, mState.mLength);
|
||||
}
|
||||
}
|
||||
void AppendTo(nsString& aString) const;
|
||||
|
||||
/**
|
||||
* Make a copy of the fragments contents starting at offset for
|
||||
|
@ -297,20 +235,7 @@ protected:
|
|||
FragmentBits mState;
|
||||
};
|
||||
|
||||
void ReleaseText() {
|
||||
if (mState.mLength && m1b && mState.mInHeap) {
|
||||
if (mState.mIs2b) {
|
||||
nsMemory::Free(m2b);
|
||||
}
|
||||
else {
|
||||
nsMemory::Free(m1b);
|
||||
}
|
||||
}
|
||||
m1b = nsnull;
|
||||
mState.mIs2b = 0;
|
||||
mState.mInHeap = 0;
|
||||
mState.mLength = 0;
|
||||
}
|
||||
void ReleaseText();
|
||||
};
|
||||
|
||||
#endif /* nsTextFragment_h___ */
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = layout
|
||||
LIBRARY_NAME = gkconshared_s
|
||||
REQUIRES = xpcom string
|
||||
|
||||
CPPSRCS = \
|
||||
nsCSSAtoms.cpp \
|
||||
nsCSSKeywords.cpp \
|
||||
nsCSSProps.cpp \
|
||||
nsHTMLAtoms.cpp \
|
||||
nsHTMLValue.cpp \
|
||||
nsLayoutAtoms.cpp \
|
||||
nsStyleUtil.cpp \
|
||||
nsTextFragment.cpp \
|
||||
nsXULAtoms.cpp \
|
||||
nsStyleCoord.cpp \
|
||||
$(NULL)
|
||||
|
||||
# we don't want the shared lib, but we want to force the creation of a static lib.
|
||||
override NO_SHARED_LIB=1
|
||||
override NO_STATIC_LIB=
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
DEFINES += -D_IMPL_NS_LAYOUT
|
|
@ -0,0 +1,70 @@
|
|||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..\..
|
||||
|
||||
LIBRARY_NAME=contentshared_s
|
||||
DEFINES=-D_IMPL_NS_LAYOUT -DWIN32_LEAN_AND_MEAN
|
||||
!if defined(XP_NEW_SELECTION)
|
||||
DEFINES = $(DEFINES) -DXP_NEW_SELECTION
|
||||
!endif
|
||||
|
||||
CPPSRCS = \
|
||||
nsCSSAtoms.cpp \
|
||||
nsCSSKeywords.cpp \
|
||||
nsCSSProps.cpp \
|
||||
nsHTMLAtoms.cpp \
|
||||
nsHTMLValue.cpp \
|
||||
nsLayoutAtoms.cpp \
|
||||
nsStyleUtil.cpp \
|
||||
nsTextFragment.cpp \
|
||||
nsXULAtoms.cpp \
|
||||
nsStyleCoord.cpp \
|
||||
$(NULL)
|
||||
|
||||
MODULE=raptor
|
||||
|
||||
CPP_OBJS= \
|
||||
.\$(OBJDIR)\nsCSSAtoms.obj \
|
||||
.\$(OBJDIR)\nsCSSKeywords.obj \
|
||||
.\$(OBJDIR)\nsCSSProps.obj \
|
||||
.\$(OBJDIR)\nsHTMLAtoms.obj \
|
||||
.\$(OBJDIR)\nsHTMLValue.obj \
|
||||
.\$(OBJDIR)\nsLayoutAtoms.obj \
|
||||
.\$(OBJDIR)\nsStyleUtil.obj \
|
||||
.\$(OBJDIR)\nsTextFragment.obj \
|
||||
.\$(OBJDIR)\nsXULAtoms.obj \
|
||||
.\$(OBJDIR)\StyleCoord.obj \
|
||||
$(NULL)
|
||||
|
||||
LCFLAGS = \
|
||||
$(LCFLAGS) \
|
||||
$(DEFINES) \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install:: $(LIBRARY)
|
||||
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
|
||||
|
||||
clobber::
|
||||
rm -f $(DIST)\lib\$(LIBRARY_NAME).lib
|
||||
rm -f $(PDBFILE).pdb
|
|
@ -22,9 +22,20 @@
|
|||
|
||||
#include "nsHTMLValue.h"
|
||||
#include "nsString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsISizeOfHandler.h"
|
||||
|
||||
nsHTMLValue::nsHTMLValue(nsHTMLUnit aUnit)
|
||||
: mUnit(aUnit)
|
||||
{
|
||||
NS_ASSERTION((aUnit <= eHTMLUnit_Empty), "not a valueless unit");
|
||||
if (aUnit > eHTMLUnit_Empty) {
|
||||
mUnit = eHTMLUnit_Null;
|
||||
}
|
||||
mValue.mString = nsnull;
|
||||
}
|
||||
|
||||
nsHTMLValue::nsHTMLValue(PRInt32 aValue, nsHTMLUnit aUnit)
|
||||
: mUnit(aUnit)
|
||||
{
|
||||
|
@ -50,6 +61,21 @@ nsHTMLValue::nsHTMLValue(float aValue)
|
|||
mValue.mFloat = aValue;
|
||||
}
|
||||
|
||||
nsHTMLValue::nsHTMLValue(const nsAReadableString& aValue, nsHTMLUnit aUnit)
|
||||
: mUnit(aUnit)
|
||||
{
|
||||
NS_ASSERTION((eHTMLUnit_String == aUnit) ||
|
||||
(eHTMLUnit_ColorName == aUnit), "not a string value");
|
||||
if ((eHTMLUnit_String == aUnit) ||
|
||||
(eHTMLUnit_ColorName == aUnit)) {
|
||||
mValue.mString = ToNewUnicode(aValue);
|
||||
}
|
||||
else {
|
||||
mUnit = eHTMLUnit_Null;
|
||||
mValue.mInt = 0;
|
||||
}
|
||||
}
|
||||
|
||||
nsHTMLValue::nsHTMLValue(nsISupports* aValue)
|
||||
: mUnit(eHTMLUnit_ISupports)
|
||||
{
|
||||
|
@ -89,6 +115,11 @@ nsHTMLValue::nsHTMLValue(const nsHTMLValue& aCopy)
|
|||
}
|
||||
}
|
||||
|
||||
nsHTMLValue::~nsHTMLValue(void)
|
||||
{
|
||||
Reset();
|
||||
}
|
||||
|
||||
nsHTMLValue& nsHTMLValue::operator=(const nsHTMLValue& aCopy)
|
||||
{
|
||||
Reset();
|
||||
|
@ -153,6 +184,21 @@ PRUint32 nsHTMLValue::HashValue(void) const
|
|||
}
|
||||
|
||||
|
||||
void nsHTMLValue::Reset(void)
|
||||
{
|
||||
if ((eHTMLUnit_String == mUnit) || (eHTMLUnit_ColorName == mUnit)) {
|
||||
if (nsnull != mValue.mString) {
|
||||
nsCRT::free(mValue.mString);
|
||||
}
|
||||
}
|
||||
else if (eHTMLUnit_ISupports == mUnit) {
|
||||
NS_IF_RELEASE(mValue.mISupports);
|
||||
}
|
||||
mUnit = eHTMLUnit_Null;
|
||||
mValue.mString = nsnull;
|
||||
}
|
||||
|
||||
|
||||
void nsHTMLValue::SetIntValue(PRInt32 aValue, nsHTMLUnit aUnit)
|
||||
{
|
||||
Reset();
|
||||
|
|
|
@ -0,0 +1,284 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
#include "nsStyleCoord.h"
|
||||
#include "nsString.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
nsStyleCoord::nsStyleCoord(nsStyleUnit aUnit)
|
||||
: mUnit(aUnit)
|
||||
{
|
||||
NS_ASSERTION(aUnit < eStyleUnit_Percent, "not a valueless unit");
|
||||
if (aUnit >= eStyleUnit_Percent) {
|
||||
mUnit = eStyleUnit_Null;
|
||||
}
|
||||
mValue.mInt = 0;
|
||||
}
|
||||
|
||||
nsStyleCoord::nsStyleCoord(nscoord aValue)
|
||||
: mUnit(eStyleUnit_Coord)
|
||||
{
|
||||
mValue.mInt = aValue;
|
||||
}
|
||||
|
||||
nsStyleCoord::nsStyleCoord(PRInt32 aValue, nsStyleUnit aUnit)
|
||||
: mUnit(aUnit)
|
||||
{
|
||||
//if you want to pass in eStyleUnit_Coord, don't. instead, use the
|
||||
//constructor just above this one... MMP
|
||||
NS_ASSERTION((aUnit == eStyleUnit_Proportional) ||
|
||||
(aUnit == eStyleUnit_Enumerated) ||
|
||||
(aUnit == eStyleUnit_Integer), "not an int value");
|
||||
if ((aUnit == eStyleUnit_Proportional) ||
|
||||
(aUnit == eStyleUnit_Enumerated) ||
|
||||
(aUnit == eStyleUnit_Integer)) {
|
||||
mValue.mInt = aValue;
|
||||
}
|
||||
else {
|
||||
mUnit = eStyleUnit_Null;
|
||||
mValue.mInt = 0;
|
||||
}
|
||||
}
|
||||
|
||||
nsStyleCoord::nsStyleCoord(float aValue, nsStyleUnit aUnit)
|
||||
: mUnit(aUnit)
|
||||
{
|
||||
NS_ASSERTION((aUnit == eStyleUnit_Percent) ||
|
||||
(aUnit == eStyleUnit_Factor), "not a float value");
|
||||
if ((aUnit == eStyleUnit_Percent) ||
|
||||
(aUnit == eStyleUnit_Factor)) {
|
||||
mValue.mFloat = aValue;
|
||||
}
|
||||
else {
|
||||
mUnit = eStyleUnit_Null;
|
||||
mValue.mInt = 0;
|
||||
}
|
||||
}
|
||||
|
||||
nsStyleCoord::nsStyleCoord(const nsStyleCoord& aCopy)
|
||||
: mUnit(aCopy.mUnit)
|
||||
{
|
||||
if ((eStyleUnit_Percent <= mUnit) && (mUnit < eStyleUnit_Coord)) {
|
||||
mValue.mFloat = aCopy.mValue.mFloat;
|
||||
}
|
||||
else {
|
||||
mValue.mInt = aCopy.mValue.mInt;
|
||||
}
|
||||
}
|
||||
|
||||
nsStyleCoord& nsStyleCoord::operator=(const nsStyleCoord& aCopy)
|
||||
{
|
||||
mUnit = aCopy.mUnit;
|
||||
if ((eStyleUnit_Percent <= mUnit) && (mUnit < eStyleUnit_Coord)) {
|
||||
mValue.mFloat = aCopy.mValue.mFloat;
|
||||
}
|
||||
else {
|
||||
mValue.mInt = aCopy.mValue.mInt;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
PRBool nsStyleCoord::operator==(const nsStyleCoord& aOther) const
|
||||
{
|
||||
if (mUnit == aOther.mUnit) {
|
||||
if ((eStyleUnit_Percent <= mUnit) && (mUnit < eStyleUnit_Coord)) {
|
||||
return PRBool(mValue.mFloat == aOther.mValue.mFloat);
|
||||
}
|
||||
else {
|
||||
return PRBool(mValue.mInt == aOther.mValue.mInt);
|
||||
}
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
void nsStyleCoord::Reset(void)
|
||||
{
|
||||
mUnit = eStyleUnit_Null;
|
||||
mValue.mInt = 0;
|
||||
}
|
||||
|
||||
void nsStyleCoord::SetCoordValue(nscoord aValue)
|
||||
{
|
||||
mUnit = eStyleUnit_Coord;
|
||||
mValue.mInt = aValue;
|
||||
}
|
||||
|
||||
void nsStyleCoord::SetIntValue(PRInt32 aValue, nsStyleUnit aUnit)
|
||||
{
|
||||
NS_ASSERTION((aUnit == eStyleUnit_Proportional) ||
|
||||
(aUnit == eStyleUnit_Enumerated) ||
|
||||
(aUnit == eStyleUnit_Chars) ||
|
||||
(aUnit == eStyleUnit_Integer), "not an int value");
|
||||
if ((aUnit == eStyleUnit_Proportional) ||
|
||||
(aUnit == eStyleUnit_Enumerated) ||
|
||||
(aUnit == eStyleUnit_Chars) ||
|
||||
(aUnit == eStyleUnit_Integer)) {
|
||||
mUnit = aUnit;
|
||||
mValue.mInt = aValue;
|
||||
}
|
||||
else {
|
||||
Reset();
|
||||
}
|
||||
}
|
||||
|
||||
void nsStyleCoord::SetPercentValue(float aValue)
|
||||
{
|
||||
mUnit = eStyleUnit_Percent;
|
||||
mValue.mFloat = aValue;
|
||||
}
|
||||
|
||||
void nsStyleCoord::SetFactorValue(float aValue)
|
||||
{
|
||||
mUnit = eStyleUnit_Factor;
|
||||
mValue.mFloat = aValue;
|
||||
}
|
||||
|
||||
void nsStyleCoord::SetNormalValue(void)
|
||||
{
|
||||
mUnit = eStyleUnit_Normal;
|
||||
mValue.mInt = 0;
|
||||
}
|
||||
|
||||
void nsStyleCoord::SetAutoValue(void)
|
||||
{
|
||||
mUnit = eStyleUnit_Auto;
|
||||
mValue.mInt = 0;
|
||||
}
|
||||
|
||||
void nsStyleCoord::SetInheritValue(void)
|
||||
{
|
||||
mUnit = eStyleUnit_Inherit;
|
||||
mValue.mInt = 0;
|
||||
}
|
||||
|
||||
void nsStyleCoord::SetUnionValue(const nsStyleUnion& aValue, nsStyleUnit aUnit)
|
||||
{
|
||||
mUnit = aUnit;
|
||||
#if PR_BYTES_PER_INT == PR_BYTES_PER_FLOAT
|
||||
mValue.mInt = aValue.mInt;
|
||||
#else
|
||||
nsCRT::memcpy(&mValue, &aValue, sizeof(nsStyleUnion));
|
||||
#endif
|
||||
}
|
||||
|
||||
void nsStyleCoord::AppendToString(nsString& aBuffer) const
|
||||
{
|
||||
if ((eStyleUnit_Percent <= mUnit) && (mUnit < eStyleUnit_Coord)) {
|
||||
aBuffer.AppendFloat(mValue.mFloat);
|
||||
}
|
||||
else if ((eStyleUnit_Coord == mUnit) ||
|
||||
(eStyleUnit_Proportional == mUnit) ||
|
||||
(eStyleUnit_Enumerated == mUnit) ||
|
||||
(eStyleUnit_Integer == mUnit)) {
|
||||
aBuffer.AppendInt(mValue.mInt, 10);
|
||||
aBuffer.AppendWithConversion("[0x");
|
||||
aBuffer.AppendInt(mValue.mInt, 16);
|
||||
aBuffer.AppendWithConversion(']');
|
||||
}
|
||||
|
||||
switch (mUnit) {
|
||||
case eStyleUnit_Null: aBuffer.AppendWithConversion("Null"); break;
|
||||
case eStyleUnit_Coord: aBuffer.AppendWithConversion("tw"); break;
|
||||
case eStyleUnit_Percent: aBuffer.AppendWithConversion("%"); break;
|
||||
case eStyleUnit_Factor: aBuffer.AppendWithConversion("f"); break;
|
||||
case eStyleUnit_Normal: aBuffer.AppendWithConversion("Normal"); break;
|
||||
case eStyleUnit_Auto: aBuffer.AppendWithConversion("Auto"); break;
|
||||
case eStyleUnit_Inherit: aBuffer.AppendWithConversion("Inherit"); break;
|
||||
case eStyleUnit_Proportional: aBuffer.AppendWithConversion("*"); break;
|
||||
case eStyleUnit_Enumerated: aBuffer.AppendWithConversion("enum"); break;
|
||||
case eStyleUnit_Integer: aBuffer.AppendWithConversion("int"); break;
|
||||
case eStyleUnit_Chars: aBuffer.AppendWithConversion("chars"); break;
|
||||
}
|
||||
aBuffer.AppendWithConversion(' ');
|
||||
}
|
||||
|
||||
void nsStyleCoord::ToString(nsString& aBuffer) const
|
||||
{
|
||||
aBuffer.Truncate();
|
||||
AppendToString(aBuffer);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
nsStyleSides::nsStyleSides(void)
|
||||
{
|
||||
nsCRT::memset(this, 0x00, sizeof(nsStyleSides));
|
||||
}
|
||||
|
||||
#define COMPARE_SIDE(side) \
|
||||
if ((eStyleUnit_Percent <= m##side##Unit) && (m##side##Unit < eStyleUnit_Coord)) { \
|
||||
if (m##side##Value.mFloat != aOther.m##side##Value.mFloat) \
|
||||
return PR_FALSE; \
|
||||
} \
|
||||
else { \
|
||||
if (m##side##Value.mInt != aOther.m##side##Value.mInt) \
|
||||
return PR_FALSE; \
|
||||
}
|
||||
|
||||
PRBool nsStyleSides::operator==(const nsStyleSides& aOther) const
|
||||
{
|
||||
if ((mLeftUnit == aOther.mLeftUnit) &&
|
||||
(mTopUnit == aOther.mTopUnit) &&
|
||||
(mRightUnit == aOther.mRightUnit) &&
|
||||
(mBottomUnit == aOther.mBottomUnit)) {
|
||||
COMPARE_SIDE(Left);
|
||||
COMPARE_SIDE(Top);
|
||||
COMPARE_SIDE(Right);
|
||||
COMPARE_SIDE(Bottom);
|
||||
return PR_TRUE;
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
void nsStyleSides::Reset(void)
|
||||
{
|
||||
nsCRT::memset(this, 0x00, sizeof(nsStyleSides));
|
||||
}
|
||||
|
||||
void nsStyleSides::AppendToString(nsString& aBuffer) const
|
||||
{
|
||||
nsStyleCoord temp;
|
||||
|
||||
GetLeft(temp);
|
||||
aBuffer.AppendWithConversion("left: ");
|
||||
temp.AppendToString(aBuffer);
|
||||
|
||||
GetTop(temp);
|
||||
aBuffer.AppendWithConversion("top: ");
|
||||
temp.AppendToString(aBuffer);
|
||||
|
||||
GetRight(temp);
|
||||
aBuffer.AppendWithConversion("right: ");
|
||||
temp.AppendToString(aBuffer);
|
||||
|
||||
GetBottom(temp);
|
||||
aBuffer.AppendWithConversion("bottom: ");
|
||||
temp.AppendToString(aBuffer);
|
||||
}
|
||||
|
||||
void nsStyleSides::ToString(nsString& aBuffer) const
|
||||
{
|
||||
aBuffer.Truncate();
|
||||
AppendToString(aBuffer);
|
||||
}
|
||||
|
|
@ -20,7 +20,32 @@
|
|||
* Contributor(s):
|
||||
*/
|
||||
#include "nsTextFragment.h"
|
||||
#include "nsString.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsMemory.h"
|
||||
|
||||
nsTextFragment::~nsTextFragment()
|
||||
{
|
||||
ReleaseText();
|
||||
}
|
||||
|
||||
void
|
||||
nsTextFragment::ReleaseText()
|
||||
{
|
||||
if (mState.mLength && m1b && mState.mInHeap) {
|
||||
if (mState.mIs2b) {
|
||||
nsMemory::Free(m2b);
|
||||
}
|
||||
else {
|
||||
nsMemory::Free(m1b);
|
||||
}
|
||||
}
|
||||
m1b = nsnull;
|
||||
mState.mIs2b = 0;
|
||||
mState.mInHeap = 0;
|
||||
mState.mLength = 0;
|
||||
}
|
||||
|
||||
nsTextFragment::nsTextFragment(const nsTextFragment& aOther)
|
||||
: m1b(nsnull),
|
||||
|
@ -41,6 +66,13 @@ nsTextFragment::nsTextFragment(const char* aString)
|
|||
SetTo(aString, strlen(aString));
|
||||
}
|
||||
|
||||
nsTextFragment::nsTextFragment(const PRUnichar* aString)
|
||||
: m1b(nsnull),
|
||||
mAllBits(0)
|
||||
{
|
||||
SetTo(aString, nsCRT::strlen(aString));
|
||||
}
|
||||
|
||||
nsTextFragment::nsTextFragment(const nsString& aString)
|
||||
: m1b(nsnull),
|
||||
mAllBits(0)
|
||||
|
@ -107,6 +139,58 @@ nsTextFragment::SetTo(PRUnichar* aBuffer, PRInt32 aLength, PRBool aRelease)
|
|||
mState.mLength = aLength;
|
||||
}
|
||||
|
||||
void
|
||||
nsTextFragment::SetTo(const PRUnichar* aBuffer, PRInt32 aLength)
|
||||
{
|
||||
ReleaseText();
|
||||
if (0 != aLength) {
|
||||
// See if we need to store the data in ucs2 or not
|
||||
PRBool need2 = PR_FALSE;
|
||||
const PRUnichar* ucp = aBuffer;
|
||||
const PRUnichar* uend = aBuffer + aLength;
|
||||
while (ucp < uend) {
|
||||
PRUnichar ch = *ucp++;
|
||||
if (ch >> 8) {
|
||||
need2 = PR_TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (need2) {
|
||||
// Use ucs2 storage because we have to
|
||||
PRUnichar* nt = (PRUnichar*)nsMemory::Alloc(aLength*sizeof(PRUnichar));
|
||||
if (nsnull != nt) {
|
||||
// Copy data
|
||||
nsCRT::memcpy(nt, aBuffer, sizeof(PRUnichar) * aLength);
|
||||
|
||||
// Setup our fields
|
||||
m2b = nt;
|
||||
mState.mIs2b = 1;
|
||||
mState.mInHeap = 1;
|
||||
mState.mLength = aLength;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Use 1 byte storage because we can
|
||||
unsigned char* nt = (unsigned char*)nsMemory::Alloc(aLength*sizeof(unsigned char));
|
||||
if (nsnull != nt) {
|
||||
// Copy data
|
||||
unsigned char* cp = nt;
|
||||
unsigned char* end = nt + aLength;
|
||||
while (cp < end) {
|
||||
*cp++ = (unsigned char) *aBuffer++;
|
||||
}
|
||||
|
||||
// Setup our fields
|
||||
m1b = nt;
|
||||
mState.mIs2b = 0;
|
||||
mState.mInHeap = 1;
|
||||
mState.mLength = aLength;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsTextFragment::SetTo(const char* aBuffer, PRInt32 aLength)
|
||||
{
|
||||
|
@ -124,6 +208,17 @@ nsTextFragment::SetTo(const char* aBuffer, PRInt32 aLength)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsTextFragment::AppendTo(nsString& aString) const
|
||||
{
|
||||
if (mState.mIs2b) {
|
||||
aString.Append(m2b, mState.mLength);
|
||||
}
|
||||
else {
|
||||
aString.AppendWithConversion((char*)m1b, mState.mLength);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsTextFragment::CopyTo(PRUnichar* aDest, PRInt32 aOffset, PRInt32 aCount)
|
||||
{
|
||||
|
|
|
@ -33,7 +33,6 @@ REQUIRES = xpcom string widget htmlparser necko dom webshell js caps rdf xpconne
|
|||
CPPSRCS = \
|
||||
nsAnonymousElement.cpp \
|
||||
nsRDFDOMNodeList.cpp \
|
||||
nsXULAtoms.cpp \
|
||||
nsXULAttributeValue.cpp \
|
||||
nsXULAttributes.cpp \
|
||||
nsXULElement.cpp \
|
||||
|
|
|
@ -29,7 +29,6 @@ DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN
|
|||
CPPSRCS= \
|
||||
nsAnonymousElement.cpp \
|
||||
nsRDFDOMNodeList.cpp \
|
||||
nsXULAtoms.cpp \
|
||||
nsXULAttributeValue.cpp \
|
||||
nsXULAttributes.cpp \
|
||||
nsXULElement.cpp \
|
||||
|
@ -40,7 +39,6 @@ CPPSRCS= \
|
|||
CPP_OBJS= \
|
||||
.\$(OBJDIR)\nsAnonymousElement.obj \
|
||||
.\$(OBJDIR)\nsRDFDOMNodeList.obj \
|
||||
.\$(OBJDIR)\nsXULAtoms.obj \
|
||||
.\$(OBJDIR)\nsXULAttributeValue.obj \
|
||||
.\$(OBJDIR)\nsXULAttributes.obj \
|
||||
.\$(OBJDIR)\nsXULElement.obj \
|
||||
|
|
|
@ -31,12 +31,8 @@ nsIStatefulFrame.h
|
|||
nsIStyleContext.h
|
||||
nsIStyleSet.h
|
||||
nslayout.h
|
||||
nsLayoutAtomList.h
|
||||
nsLayoutAtoms.h
|
||||
nsLayoutUtils.h
|
||||
nsStyleChangeList.h
|
||||
nsStyleConsts.h
|
||||
nsStyleCoord.h
|
||||
nsIStyleFrameConstruction.h
|
||||
nsStyleStruct.h
|
||||
nsIFrameTraversal.h
|
||||
|
|
|
@ -58,14 +58,10 @@ nsIStyleContext.h \
|
|||
nsIMutableStyleContext.h \
|
||||
nsIStyleFrameConstruction.h \
|
||||
nsIStyleSet.h \
|
||||
nsLayoutAtoms.h \
|
||||
nsLayoutAtomList.h \
|
||||
nsLayoutUtils.h \
|
||||
nsFrameList.h \
|
||||
nsFrameTraversal.h \
|
||||
nsStyleChangeList.h \
|
||||
nsStyleConsts.h \
|
||||
nsStyleCoord.h \
|
||||
nsStyleStruct.h \
|
||||
nsILayoutHistoryState.h \
|
||||
nsIStatefulFrame.h \
|
||||
|
|
|
@ -49,14 +49,10 @@ EXPORTS = \
|
|||
nsIMutableStyleContext.h \
|
||||
nsIStyleFrameConstruction.h \
|
||||
nsIStyleSet.h \
|
||||
nsLayoutAtoms.h \
|
||||
nsLayoutAtomList.h \
|
||||
nsLayoutUtils.h \
|
||||
nsFrameList.h \
|
||||
nsFrameTraversal.h \
|
||||
nsStyleChangeList.h \
|
||||
nsStyleConsts.h \
|
||||
nsStyleCoord.h \
|
||||
nsStyleStruct.h \
|
||||
nsILayoutHistoryState.h \
|
||||
nsIStatefulFrame.h \
|
||||
|
|
|
@ -39,9 +39,7 @@ CPPSRCS = \
|
|||
nsFrameTraversal.cpp \
|
||||
nsFrameUtil.cpp \
|
||||
nsGalleyContext.cpp \
|
||||
nsLayoutAtoms.cpp \
|
||||
nsLayoutDebugger.cpp \
|
||||
nsLayoutUtils.cpp \
|
||||
nsPresContext.cpp \
|
||||
nsPresState.cpp \
|
||||
nsPrintContext.cpp \
|
||||
|
|
|
@ -41,9 +41,7 @@ CPPSRCS = \
|
|||
nsPrintPreviewContext.cpp \
|
||||
nsSpaceManager.cpp \
|
||||
nsStyleChangeList.cpp \
|
||||
nsLayoutAtoms.cpp \
|
||||
nsLayoutDebugger.cpp \
|
||||
nsLayoutUtils.cpp \
|
||||
nsCaret.cpp \
|
||||
nsLayoutHistoryState.cpp \
|
||||
$(NULL)
|
||||
|
@ -64,9 +62,7 @@ CPP_OBJS= \
|
|||
.\$(OBJDIR)\nsPrintPreviewContext.obj \
|
||||
.\$(OBJDIR)\nsSpaceManager.obj \
|
||||
.\$(OBJDIR)\nsStyleChangeList.obj \
|
||||
.\$(OBJDIR)\nsLayoutAtoms.obj \
|
||||
.\$(OBJDIR)\nsLayoutDebugger.obj \
|
||||
.\$(OBJDIR)\nsLayoutUtils.obj \
|
||||
.\$(OBJDIR)\nsCaret.obj \
|
||||
.\$(OBJDIR)\nsLayoutHistoryState.obj \
|
||||
$(NULL)
|
||||
|
|
|
@ -26,8 +26,6 @@ VPATH = @srcdir@
|
|||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
BUILD_DATE = gbdate.h
|
||||
|
||||
MODULE = layout
|
||||
LIBRARY_NAME = gklayout
|
||||
SHORT_LIBNAME = gkhtml
|
||||
|
@ -45,7 +43,7 @@ ifndef MKSHLIB_FORCE_ALL
|
|||
CPPSRCS += dlldeps.cpp
|
||||
endif
|
||||
|
||||
EXPORTS = nsLayoutCID.h $(BUILD_DATE)
|
||||
EXPORTS = nsLayoutCID.h
|
||||
|
||||
SHARED_LIBRARY_LIBS = \
|
||||
$(DIST)/lib/libgkhtmlbase_s.$(LIB_SUFFIX) \
|
||||
|
@ -53,9 +51,9 @@ SHARED_LIBRARY_LIBS = \
|
|||
$(DIST)/lib/libgkhtmlforms_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libgkhtmlstyle_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libgkhtmltable_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libgkxulcon_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libgkxulbase_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libgkbase_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libgkconshared_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libgkxuloutliner_s.$(LIB_SUFFIX) \
|
||||
$(NULL)
|
||||
|
||||
|
@ -90,8 +88,6 @@ ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
|
|||
EXPORT_OBJS = 1
|
||||
endif
|
||||
|
||||
GARBAGE += $(BUILD_DATE)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
DEFINES += -D_IMPL_NS_HTML
|
||||
|
@ -111,10 +107,6 @@ ifdef MOZ_SVG
|
|||
INCLUDES += -I$(srcdir)/../svg/content/src
|
||||
endif
|
||||
|
||||
$(BUILD_DATE):
|
||||
$(RM) $@
|
||||
$(PERL) $(srcdir)/gbdate.pl > $@
|
||||
|
||||
# To prevent ILink from crashing
|
||||
ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
||||
OS_DLLFLAGS := ilink /FREE /NOE /NOL /DLL /O:nglayout.dll /M /INC:_dllentry
|
||||
|
|
|
@ -27,8 +27,6 @@ DEFINES=-D_IMPL_NS_HTML
|
|||
MODULE=raptor
|
||||
IS_COMPONENT = 1
|
||||
|
||||
BUILD_DATE=gbdate.h
|
||||
|
||||
CPPSRCS=dlldeps.cpp nsLayoutDLF.cpp nsLayoutFactory.cpp
|
||||
|
||||
CPP_OBJS= \
|
||||
|
@ -38,8 +36,7 @@ CPP_OBJS= \
|
|||
.\$(OBJDIR)\nsLayoutModule.obj \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS=nsLayoutCID.h $(BUILD_DATE)
|
||||
|
||||
EXPORTS=nsLayoutCID.h
|
||||
|
||||
MAKE_OBJ_TYPE = DLL
|
||||
DLLNAME = gklayout
|
||||
|
@ -72,7 +69,7 @@ LLIBS= \
|
|||
$(DIST)\lib\layouthtmlstyle_s.lib \
|
||||
$(DIST)\lib\layouthtmltable_s.lib \
|
||||
$(DIST)\lib\layoutxulbase_s.lib \
|
||||
$(DIST)\lib\layoutxulcontent_s.lib \
|
||||
$(DIST)\lib\contentshared_s.lib \
|
||||
$(DIST)\lib\raptorxuloutliner_s.lib \
|
||||
!ifdef MOZ_MATHML
|
||||
$(DIST)\lib\layoutmathmlbase_s.lib \
|
||||
|
@ -101,7 +98,3 @@ install:: $(DLL)
|
|||
clobber::
|
||||
rm -f $(DIST)\bin\$(DLLNAME).dll
|
||||
rm -f $(DIST)\lib\$(DLLNAME).lib
|
||||
|
||||
$(BUILD_DATE)::
|
||||
rm -f $@
|
||||
$(PERL) gbdate.pl > $@
|
||||
|
|
|
@ -513,33 +513,6 @@ nsContentDLF::CreateXULDocumentFromStream(nsIInputStream& aXULStream,
|
|||
return status;
|
||||
}
|
||||
|
||||
static NS_DEFINE_IID(kDocumentFactoryImplCID, NS_CONTENT_DOCUMENT_LOADER_FACTORY_CID);
|
||||
|
||||
static nsresult
|
||||
RegisterTypes(nsIComponentManager* aCompMgr,
|
||||
const char* aCommand,
|
||||
nsIFile* aPath,
|
||||
char** aTypes)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
while (*aTypes) {
|
||||
char contractid[500];
|
||||
char* contentType = *aTypes++;
|
||||
PR_snprintf(contractid, sizeof(contractid),
|
||||
NS_DOCUMENT_LOADER_FACTORY_CONTRACTID_PREFIX "%s;1?type=%s",
|
||||
aCommand, contentType);
|
||||
#ifdef NOISY_REGISTRY
|
||||
printf("Register %s => %s\n", contractid, aPath);
|
||||
#endif
|
||||
rv = aCompMgr->RegisterComponentSpec(kDocumentFactoryImplCID, "Content",
|
||||
contractid, aPath, PR_TRUE, PR_TRUE);
|
||||
if (NS_FAILED(rv)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsContentModule::RegisterDocumentFactories(nsIComponentManager* aCompMgr,
|
||||
nsIFile* aPath)
|
||||
|
@ -549,6 +522,8 @@ nsContentModule::RegisterDocumentFactories(nsIComponentManager* aCompMgr,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
static NS_DEFINE_IID(kDocumentFactoryImplCID, NS_CONTENT_DOCUMENT_LOADER_FACTORY_CID);
|
||||
|
||||
void
|
||||
nsContentModule::UnregisterDocumentFactories(nsIComponentManager* aCompMgr,
|
||||
nsIFile* aPath)
|
||||
|
|
|
@ -73,12 +73,8 @@
|
|||
#include "nsSprocketLayout.h"
|
||||
#include "nsStackLayout.h"
|
||||
#endif
|
||||
#include "nsIHTTPProtocolHandler.h"
|
||||
#include "gbdate.h"
|
||||
#include "nsContentPolicyUtils.h"
|
||||
#define PRODUCT_NAME "Gecko"
|
||||
|
||||
static NS_DEFINE_CID(kHTTPHandlerCID, NS_IHTTPHANDLER_CID);
|
||||
static nsLayoutModule *gModule = NULL;
|
||||
|
||||
extern "C" NS_EXPORT nsresult NSGetModule(nsIComponentManager *servMgr,
|
||||
|
@ -236,8 +232,6 @@ nsLayoutModule::Initialize()
|
|||
}
|
||||
}
|
||||
|
||||
SetUserAgent();
|
||||
|
||||
rv = nsTextTransformer::Initialize();
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
|
@ -417,21 +411,3 @@ nsLayoutModule::CanUnload(nsIComponentManager *aCompMgr, PRBool *okToUnload)
|
|||
*okToUnload = PR_FALSE;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
void
|
||||
nsLayoutModule::SetUserAgent( void )
|
||||
{
|
||||
nsString productName; productName.AssignWithConversion(PRODUCT_NAME);
|
||||
nsString productVersion; productVersion.AssignWithConversion(PRODUCT_VERSION);
|
||||
nsresult rv = nsnull;
|
||||
|
||||
nsCOMPtr<nsIHTTPProtocolHandler> theService(do_GetService(kHTTPHandlerCID,
|
||||
&rv));
|
||||
|
||||
if( NS_SUCCEEDED(rv) && (nsnull != theService) )
|
||||
{
|
||||
rv = theService->SetProduct(productName.GetUnicode());
|
||||
|
||||
rv = theService->SetProductSub(productVersion.GetUnicode());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,3 +5,5 @@
|
|||
nsILineIterator.h
|
||||
nsIHTMLContent.h
|
||||
nsHTMLParts.h
|
||||
nsHTMLAtoms.h
|
||||
nsHTMLAtomList.h
|
||||
|
|
|
@ -45,7 +45,6 @@ CPPSRCS = \
|
|||
nsFrame.cpp \
|
||||
nsFrameManager.cpp \
|
||||
nsHRFrame.cpp \
|
||||
nsHTMLAtoms.cpp \
|
||||
nsHTMLContainerFrame.cpp \
|
||||
nsHTMLIIDs.cpp \
|
||||
nsHTMLFrame.cpp \
|
||||
|
|
|
@ -51,7 +51,6 @@ CPPSRCS= \
|
|||
nsFrame.cpp \
|
||||
nsFrameManager.cpp \
|
||||
nsHRFrame.cpp \
|
||||
nsHTMLAtoms.cpp \
|
||||
nsHTMLContainerFrame.cpp \
|
||||
nsHTMLIIDs.cpp \
|
||||
nsHTMLFrame.cpp \
|
||||
|
@ -94,7 +93,6 @@ CPP_OBJS= \
|
|||
.\$(OBJDIR)\nsFrame.obj \
|
||||
.\$(OBJDIR)\nsFrameManager.obj \
|
||||
.\$(OBJDIR)\nsHRFrame.obj \
|
||||
.\$(OBJDIR)\nsHTMLAtoms.obj \
|
||||
.\$(OBJDIR)\nsHTMLContainerFrame.obj \
|
||||
.\$(OBJDIR)\nsHTMLFrame.obj \
|
||||
.\$(OBJDIR)\nsHTMLImageLoader.obj \
|
||||
|
|
|
@ -26,7 +26,7 @@ VPATH = @srcdir@
|
|||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = public src
|
||||
DIRS = src
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
DEPTH=..\..\..
|
||||
|
||||
DIRS=public src
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
|
@ -31,12 +31,8 @@ LIBRARY_NAME = gkhtmlstyle_s
|
|||
REQUIRES = xpcom string dom widget timer caps editor locale js view necko webshell pref rdf htmlparser txmgr docshell uriloader unicharutil uconv
|
||||
|
||||
CPPSRCS = \
|
||||
nsCSSAtoms.cpp \
|
||||
nsCSSKeywords.cpp \
|
||||
nsCSSFrameConstructor.cpp \
|
||||
nsCSSProps.cpp \
|
||||
nsCSSRendering.cpp \
|
||||
nsStyleUtil.cpp \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS = \
|
||||
|
|
|
@ -32,23 +32,13 @@ EXPORTS = \
|
|||
$(NULL)
|
||||
|
||||
CPPSRCS= \
|
||||
nsCSSAtoms.cpp \
|
||||
nsCSSKeywords.cpp \
|
||||
nsCSSFrameConstructor.cpp \
|
||||
nsCSSProps.cpp \
|
||||
nsCSSRendering.cpp \
|
||||
# nsHTMLStyleSheet.cpp \
|
||||
nsStyleUtil.cpp \
|
||||
$(NULL)
|
||||
|
||||
CPP_OBJS = \
|
||||
.\$(OBJDIR)\nsCSSAtoms.obj \
|
||||
.\$(OBJDIR)\nsCSSKeywords.obj \
|
||||
.\$(OBJDIR)\nsCSSFrameConstructor.obj \
|
||||
.\$(OBJDIR)\nsCSSProps.obj \
|
||||
.\$(OBJDIR)\nsCSSRendering.obj \
|
||||
# .\$(OBJDIR)\nsHTMLStyleSheet.obj \
|
||||
.\$(OBJDIR)\nsStyleUtil.obj \
|
||||
$(NULL)
|
||||
|
||||
LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor -I$(PUBLIC)\netlib \
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче