зеркало из https://github.com/mozilla/pjs.git
Fix for 70809. r=attinasi, sr=brendan
This commit is contained in:
Родитель
5bdd4f228d
Коммит
5a40dceb52
|
@ -1734,6 +1734,63 @@ PRUint32 StylePrintImpl::ComputeCRC32(PRUint32 aCrc) const
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
// --------------------
|
||||||
|
// nsStyleXUL
|
||||||
|
//
|
||||||
|
nsStyleXUL::nsStyleXUL() { }
|
||||||
|
nsStyleXUL::~nsStyleXUL() { }
|
||||||
|
|
||||||
|
struct StyleXULImpl: public nsStyleXUL {
|
||||||
|
StyleXULImpl() { }
|
||||||
|
|
||||||
|
void ResetFrom(const nsStyleXUL* aParent, nsIPresContext* aPresContext);
|
||||||
|
void SetFrom(const nsStyleXUL& aSource);
|
||||||
|
void CopyTo(nsStyleXUL& aDest) const;
|
||||||
|
PRInt32 CalcDifference(const StyleXULImpl& aOther) const;
|
||||||
|
PRUint32 ComputeCRC32(PRUint32 aCrc) const;
|
||||||
|
|
||||||
|
private: // These are not allowed
|
||||||
|
StyleXULImpl(const StyleXULImpl& aOther);
|
||||||
|
StyleXULImpl& operator=(const StyleXULImpl& aOther);
|
||||||
|
};
|
||||||
|
|
||||||
|
void StyleXULImpl::ResetFrom(const nsStyleXUL* aParent, nsIPresContext* aPresContext)
|
||||||
|
{
|
||||||
|
mBoxOrient = NS_STYLE_BOX_ORIENT_HORIZONTAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void StyleXULImpl::SetFrom(const nsStyleXUL& aSource)
|
||||||
|
{
|
||||||
|
nsCRT::memcpy((nsStyleXUL*)this, &aSource, sizeof(nsStyleXUL));
|
||||||
|
}
|
||||||
|
|
||||||
|
void StyleXULImpl::CopyTo(nsStyleXUL& aDest) const
|
||||||
|
{
|
||||||
|
nsCRT::memcpy(&aDest, (const nsStyleXUL*)this, sizeof(nsStyleXUL));
|
||||||
|
}
|
||||||
|
|
||||||
|
PRInt32 StyleXULImpl::CalcDifference(const StyleXULImpl& aOther) const
|
||||||
|
{
|
||||||
|
if (mBoxOrient == aOther.mBoxOrient)
|
||||||
|
return NS_STYLE_HINT_NONE;
|
||||||
|
return NS_STYLE_HINT_REFLOW;
|
||||||
|
}
|
||||||
|
|
||||||
|
PRUint32 StyleXULImpl::ComputeCRC32(PRUint32 aCrc) const
|
||||||
|
{
|
||||||
|
PRUint32 crc = aCrc;
|
||||||
|
#ifdef COMPUTE_STYLEDATA_CRC
|
||||||
|
crc = AccumulateCRC(crc,(const char *)&mBoxOrient,sizeof(mBoxOrient));
|
||||||
|
#endif
|
||||||
|
return crc;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef XP_MAC
|
||||||
|
#pragma mark -
|
||||||
|
#endif
|
||||||
|
#endif // INCLUDE_XUL
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
#ifdef SHARE_STYLECONTEXTS
|
#ifdef SHARE_STYLECONTEXTS
|
||||||
|
@ -1945,6 +2002,22 @@ void StyleOutlineImplLog::ResetFrom(const nsStyleOutline* aParent, nsIPresContex
|
||||||
mSetFromParent = (aParent != nsnull);
|
mSetFromParent = (aParent != nsnull);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
// StyleXULImpl mXUL;
|
||||||
|
struct StyleXULImplLog: public StyleXULImpl {
|
||||||
|
void ResetFrom(const nsStyleXUL* aParent, nsIPresContext* aPresContext);
|
||||||
|
StyleXULImpl mInternalXUL;
|
||||||
|
bool mSetFromParent;
|
||||||
|
};
|
||||||
|
|
||||||
|
void StyleXULImplLog::ResetFrom(const nsStyleXUL* aParent, nsIPresContext* aPresContext)
|
||||||
|
{
|
||||||
|
StyleXULImpl::ResetFrom(aParent, aPresContext);
|
||||||
|
CopyTo(mInternalXUL);
|
||||||
|
mSetFromParent = (aParent != nsnull);
|
||||||
|
}
|
||||||
|
#endif // INCLUDE_XUL
|
||||||
|
|
||||||
#ifdef XP_MAC
|
#ifdef XP_MAC
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
#endif
|
#endif
|
||||||
|
@ -1996,6 +2069,9 @@ private: // all data and methods private: only friends have access
|
||||||
StylePaddingImplLog mPadding;
|
StylePaddingImplLog mPadding;
|
||||||
StyleBorderImplLog mBorder;
|
StyleBorderImplLog mBorder;
|
||||||
StyleOutlineImplLog mOutline;
|
StyleOutlineImplLog mOutline;
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
StyleXULImplLog mXUL;
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
StyleFontImpl mFont;
|
StyleFontImpl mFont;
|
||||||
StyleColorImpl mColor;
|
StyleColorImpl mColor;
|
||||||
|
@ -2011,6 +2087,9 @@ private: // all data and methods private: only friends have access
|
||||||
StylePaddingImpl mPadding;
|
StylePaddingImpl mPadding;
|
||||||
StyleBorderImpl mBorder;
|
StyleBorderImpl mBorder;
|
||||||
StyleOutlineImpl mOutline;
|
StyleOutlineImpl mOutline;
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
StyleXULImpl mXUL;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
PRUint32 mRefCnt;
|
PRUint32 mRefCnt;
|
||||||
|
@ -2145,6 +2224,9 @@ static void LogStyleStructs(nsStyleContextData* aStyleContextData)
|
||||||
case eStyleStruct_Padding: printf("eStyleStruct_Padding "); sizeOfStruct = sizeof(StylePaddingImpl); break;
|
case eStyleStruct_Padding: printf("eStyleStruct_Padding "); sizeOfStruct = sizeof(StylePaddingImpl); break;
|
||||||
case eStyleStruct_Border: printf("eStyleStruct_Border "); sizeOfStruct = sizeof(StyleBorderImpl); break;
|
case eStyleStruct_Border: printf("eStyleStruct_Border "); sizeOfStruct = sizeof(StyleBorderImpl); break;
|
||||||
case eStyleStruct_Outline: printf("eStyleStruct_Outline "); sizeOfStruct = sizeof(StyleOutlineImpl); break;
|
case eStyleStruct_Outline: printf("eStyleStruct_Outline "); sizeOfStruct = sizeof(StyleOutlineImpl); break;
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
case eStyleStruct_XUL: printf("eStyleStruct_XUL "); sizeOfStruct = sizeof(StyleXULImpl); break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
short percentDefault = (totalCount == 0 ? 0 : ((100 * defaultStruct[i]) / totalCount));
|
short percentDefault = (totalCount == 0 ? 0 : ((100 * defaultStruct[i]) / totalCount));
|
||||||
short percentFromParent = (defaultStruct[i] == 0 ? 0 : ((100 * setFromParent[i]) / defaultStruct[i]));
|
short percentFromParent = (defaultStruct[i] == 0 ? 0 : ((100 * setFromParent[i]) / defaultStruct[i]));
|
||||||
|
@ -2284,6 +2366,15 @@ static void LogStyleStructs(nsStyleContextData* aStyleContextData)
|
||||||
setFromParent[i]++;
|
setFromParent[i]++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
case eStyleStruct_XUL:
|
||||||
|
if (aStyleContextData->mXUL.CalcDifference(aStyleContextData->mXUL.mInternalXUL) == NS_STYLE_HINT_NONE) {
|
||||||
|
defaultStruct[i]++;
|
||||||
|
if (aStyleContextData->mXUL.mSetFromParent)
|
||||||
|
setFromParent[i]++;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2330,6 +2421,9 @@ PRUint32 nsStyleContextData::ComputeCRC32(PRUint32 aCrc) const
|
||||||
crc = mPadding.ComputeCRC32(crc);
|
crc = mPadding.ComputeCRC32(crc);
|
||||||
crc = mBorder.ComputeCRC32(crc);
|
crc = mBorder.ComputeCRC32(crc);
|
||||||
crc = mOutline.ComputeCRC32(crc);
|
crc = mOutline.ComputeCRC32(crc);
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
crc = mXUL.ComputeCRC32(crc);
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
crc = 0;
|
crc = 0;
|
||||||
#endif
|
#endif
|
||||||
|
@ -2467,6 +2561,9 @@ protected:
|
||||||
StylePaddingImpl mPadding;
|
StylePaddingImpl mPadding;
|
||||||
StyleBorderImpl mBorder;
|
StyleBorderImpl mBorder;
|
||||||
StyleOutlineImpl mOutline;
|
StyleOutlineImpl mOutline;
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
StyleXULImpl mXUL;
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // #ifdef SHARE_STYLECONTEXTS
|
#endif // #ifdef SHARE_STYLECONTEXTS
|
||||||
|
|
||||||
|
@ -2512,6 +2609,9 @@ StyleContextImpl::StyleContextImpl(nsIStyleContext* aParent,
|
||||||
mTable(),
|
mTable(),
|
||||||
mContent(),
|
mContent(),
|
||||||
mUserInterface(),
|
mUserInterface(),
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
mXUL(),
|
||||||
|
#endif
|
||||||
mPrint()
|
mPrint()
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
@ -2900,6 +3000,9 @@ static void LogGetStyleDataCall(nsStyleStructID aSID, LogCallType aLogCallType,
|
||||||
case eStyleStruct_Border: printf("eStyleStruct_Border "); break;
|
case eStyleStruct_Border: printf("eStyleStruct_Border "); break;
|
||||||
case eStyleStruct_Outline: printf("eStyleStruct_Outline "); break;
|
case eStyleStruct_Outline: printf("eStyleStruct_Outline "); break;
|
||||||
case eStyleStruct_BorderPaddingShortcut: printf("BorderPaddingShortcut "); break;
|
case eStyleStruct_BorderPaddingShortcut: printf("BorderPaddingShortcut "); break;
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
case eStyleStruct_XUL: printf("eStyleStruct_XUL "); break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
short percent = 100*calls[i]/totalCalls;
|
short percent = 100*calls[i]/totalCalls;
|
||||||
short avdepth = calls[i] == 0 ? 0 : round(float(depth[i])/float(calls[i]));
|
short avdepth = calls[i] == 0 ? 0 : round(float(depth[i])/float(calls[i]));
|
||||||
|
@ -3028,6 +3131,11 @@ const nsStyleStruct* StyleContextImpl::GetStyleData(nsStyleStructID aSID)
|
||||||
case eStyleStruct_Outline:
|
case eStyleStruct_Outline:
|
||||||
result = & GETSCDATA(Outline);
|
result = & GETSCDATA(Outline);
|
||||||
break;
|
break;
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
case eStyleStruct_XUL:
|
||||||
|
result = & GETSCDATA(XUL);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
NS_ERROR("Invalid style struct id");
|
NS_ERROR("Invalid style struct id");
|
||||||
break;
|
break;
|
||||||
|
@ -3090,6 +3198,11 @@ nsStyleStruct* StyleContextImpl::GetMutableStyleData(nsStyleStructID aSID)
|
||||||
case eStyleStruct_Outline:
|
case eStyleStruct_Outline:
|
||||||
result = & GETSCDATA(Outline);
|
result = & GETSCDATA(Outline);
|
||||||
break;
|
break;
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
case eStyleStruct_XUL:
|
||||||
|
result = & GETSCDATA(XUL);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
NS_ERROR("Invalid style struct id");
|
NS_ERROR("Invalid style struct id");
|
||||||
break;
|
break;
|
||||||
|
@ -3170,6 +3283,11 @@ StyleContextImpl::GetStyle(nsStyleStructID aSID, nsStyleStruct& aStruct) const
|
||||||
case eStyleStruct_Outline:
|
case eStyleStruct_Outline:
|
||||||
GETSCDATA(Outline).CopyTo((nsStyleOutline&)aStruct);
|
GETSCDATA(Outline).CopyTo((nsStyleOutline&)aStruct);
|
||||||
break;
|
break;
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
case eStyleStruct_XUL:
|
||||||
|
GETSCDATA(XUL).CopyTo((nsStyleXUL&)aStruct);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
case eStyleStruct_BorderPaddingShortcut: {
|
case eStyleStruct_BorderPaddingShortcut: {
|
||||||
nsMargin border, padding;
|
nsMargin border, padding;
|
||||||
if (GETSCDATA(Border).GetBorder(border)) {
|
if (GETSCDATA(Border).GetBorder(border)) {
|
||||||
|
@ -3239,6 +3357,11 @@ StyleContextImpl::SetStyle(nsStyleStructID aSID, const nsStyleStruct& aStruct)
|
||||||
case eStyleStruct_Outline:
|
case eStyleStruct_Outline:
|
||||||
GETSCDATA(Outline).SetFrom((const nsStyleOutline&)aStruct);
|
GETSCDATA(Outline).SetFrom((const nsStyleOutline&)aStruct);
|
||||||
break;
|
break;
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
case eStyleStruct_XUL:
|
||||||
|
GETSCDATA(XUL).SetFrom((const nsStyleXUL&)aStruct);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
NS_ERROR("Invalid style struct id");
|
NS_ERROR("Invalid style struct id");
|
||||||
result = NS_ERROR_INVALID_ARG;
|
result = NS_ERROR_INVALID_ARG;
|
||||||
|
@ -3299,6 +3422,9 @@ StyleContextImpl::RemapStyle(nsIPresContext* aPresContext, PRBool aRecurse)
|
||||||
GETSCDATA(Padding).ResetFrom(&(mParent->GETSCDATA(Padding)), aPresContext);
|
GETSCDATA(Padding).ResetFrom(&(mParent->GETSCDATA(Padding)), aPresContext);
|
||||||
GETSCDATA(Border).ResetFrom(&(mParent->GETSCDATA(Border)), aPresContext);
|
GETSCDATA(Border).ResetFrom(&(mParent->GETSCDATA(Border)), aPresContext);
|
||||||
GETSCDATA(Outline).ResetFrom(&(mParent->GETSCDATA(Outline)), aPresContext);
|
GETSCDATA(Outline).ResetFrom(&(mParent->GETSCDATA(Outline)), aPresContext);
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
GETSCDATA(XUL).ResetFrom(&(mParent->GETSCDATA(XUL)), aPresContext);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
GETSCDATA(Font).ResetFrom(nsnull, aPresContext);
|
GETSCDATA(Font).ResetFrom(nsnull, aPresContext);
|
||||||
|
@ -3315,6 +3441,9 @@ StyleContextImpl::RemapStyle(nsIPresContext* aPresContext, PRBool aRecurse)
|
||||||
GETSCDATA(Padding).ResetFrom(nsnull, aPresContext);
|
GETSCDATA(Padding).ResetFrom(nsnull, aPresContext);
|
||||||
GETSCDATA(Border).ResetFrom(nsnull, aPresContext);
|
GETSCDATA(Border).ResetFrom(nsnull, aPresContext);
|
||||||
GETSCDATA(Outline).ResetFrom(nsnull, aPresContext);
|
GETSCDATA(Outline).ResetFrom(nsnull, aPresContext);
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
GETSCDATA(XUL).ResetFrom(nsnull, aPresContext);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
PRUint32 cnt = 0;
|
PRUint32 cnt = 0;
|
||||||
|
@ -3396,6 +3525,9 @@ StyleContextImpl::RemapStyle(nsIPresContext* aPresContext, PRBool aRecurse)
|
||||||
GETSCDATA(Padding).ResetFrom(nsnull, aPresContext);
|
GETSCDATA(Padding).ResetFrom(nsnull, aPresContext);
|
||||||
GETSCDATA(Border).ResetFrom(nsnull, aPresContext);
|
GETSCDATA(Border).ResetFrom(nsnull, aPresContext);
|
||||||
GETSCDATA(Outline).ResetFrom(nsnull, aPresContext);
|
GETSCDATA(Outline).ResetFrom(nsnull, aPresContext);
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
GETSCDATA(XUL).ResetFrom(nsnull, aPresContext);
|
||||||
|
#endif
|
||||||
GETSCDATA(Display).mVisible = visible;
|
GETSCDATA(Display).mVisible = visible;
|
||||||
GETSCDATA(Display).mDirection = direction;
|
GETSCDATA(Display).mDirection = direction;
|
||||||
GETSCDATA(Display).mLanguage = language;
|
GETSCDATA(Display).mLanguage = language;
|
||||||
|
@ -3589,6 +3721,15 @@ StyleContextImpl::CalcStyleDifference(nsIStyleContext* aOther, PRInt32& aHint,PR
|
||||||
aHint = hint;
|
aHint = hint;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
if (aStopAtFirstDifference && aHint > NS_STYLE_HINT_NONE) return NS_OK;
|
||||||
|
if (aHint < NS_STYLE_HINT_MAX) {
|
||||||
|
hint = GETSCDATA(XUL).CalcDifference(other->GETSCDATA(XUL));
|
||||||
|
if (aHint < hint) {
|
||||||
|
aHint = hint;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
@ -3897,6 +4038,10 @@ void StyleContextImpl::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize)
|
||||||
totalSize += (long)sizeof(GETSCDATA(Border));
|
totalSize += (long)sizeof(GETSCDATA(Border));
|
||||||
printf( " - StyleOutlineImpl: %ld\n", (long)sizeof(GETSCDATA(Outline)));
|
printf( " - StyleOutlineImpl: %ld\n", (long)sizeof(GETSCDATA(Outline)));
|
||||||
totalSize += (long)sizeof(GETSCDATA(Outline));
|
totalSize += (long)sizeof(GETSCDATA(Outline));
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
printf( " - StyleXULImpl: %ld\n", (long)sizeof(GETSCDATA(XUL)));
|
||||||
|
totalSize += (long)sizeof(GETSCDATA(XUL));
|
||||||
|
#endif
|
||||||
printf( " - Total: %ld\n", (long)totalSize);
|
printf( " - Total: %ld\n", (long)totalSize);
|
||||||
printf( "*************************************\n");
|
printf( "*************************************\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,9 @@ static NS_DEFINE_IID(kCSSPageSID, NS_CSS_PAGE_SID);
|
||||||
static NS_DEFINE_IID(kCSSContentSID, NS_CSS_CONTENT_SID);
|
static NS_DEFINE_IID(kCSSContentSID, NS_CSS_CONTENT_SID);
|
||||||
static NS_DEFINE_IID(kCSSUserInterfaceSID, NS_CSS_USER_INTERFACE_SID);
|
static NS_DEFINE_IID(kCSSUserInterfaceSID, NS_CSS_USER_INTERFACE_SID);
|
||||||
static NS_DEFINE_IID(kCSSAuralSID, NS_CSS_AURAL_SID);
|
static NS_DEFINE_IID(kCSSAuralSID, NS_CSS_AURAL_SID);
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
static NS_DEFINE_IID(kCSSXULSID, NS_CSS_XUL_SID);
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CSS_IF_DELETE(ptr) if (nsnull != ptr) { delete ptr; ptr = nsnull; }
|
#define CSS_IF_DELETE(ptr) if (nsnull != ptr) { delete ptr; ptr = nsnull; }
|
||||||
|
|
||||||
|
@ -973,6 +975,41 @@ void nsCSSAural::List(FILE* out, PRInt32 aIndent) const
|
||||||
fputs(buffer, out);
|
fputs(buffer, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
// --- nsCSSXUL -----------------
|
||||||
|
|
||||||
|
nsCSSXUL::nsCSSXUL(void)
|
||||||
|
{
|
||||||
|
MOZ_COUNT_CTOR(nsCSSXUL);
|
||||||
|
}
|
||||||
|
|
||||||
|
nsCSSXUL::nsCSSXUL(const nsCSSXUL& aCopy)
|
||||||
|
: mBoxOrient(aCopy.mBoxOrient)
|
||||||
|
{
|
||||||
|
MOZ_COUNT_CTOR(nsCSSXUL);
|
||||||
|
}
|
||||||
|
|
||||||
|
nsCSSXUL::~nsCSSXUL(void)
|
||||||
|
{
|
||||||
|
MOZ_COUNT_DTOR(nsCSSXUL);
|
||||||
|
}
|
||||||
|
|
||||||
|
const nsID& nsCSSXUL::GetID(void)
|
||||||
|
{
|
||||||
|
return kCSSXULSID;
|
||||||
|
}
|
||||||
|
|
||||||
|
void nsCSSXUL::List(FILE* out, PRInt32 aIndent) const
|
||||||
|
{
|
||||||
|
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
|
||||||
|
|
||||||
|
nsAutoString buffer;
|
||||||
|
|
||||||
|
mBoxOrient.AppendToString(buffer, eCSSProperty_box_orient);
|
||||||
|
fputs(buffer, out);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // INCLUDE_XUL
|
||||||
|
|
||||||
|
|
||||||
// --- nsCSSDeclaration -----------------
|
// --- nsCSSDeclaration -----------------
|
||||||
|
@ -1042,6 +1079,9 @@ protected:
|
||||||
nsCSSContent* mContent;
|
nsCSSContent* mContent;
|
||||||
nsCSSUserInterface* mUserInterface;
|
nsCSSUserInterface* mUserInterface;
|
||||||
nsCSSAural* mAural;
|
nsCSSAural* mAural;
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
nsCSSXUL* mXUL;
|
||||||
|
#endif
|
||||||
|
|
||||||
CSSDeclarationImpl* mImportant;
|
CSSDeclarationImpl* mImportant;
|
||||||
|
|
||||||
|
@ -1084,6 +1124,9 @@ CSSDeclarationImpl::CSSDeclarationImpl(const CSSDeclarationImpl& aCopy)
|
||||||
DECL_IF_COPY(Content);
|
DECL_IF_COPY(Content);
|
||||||
DECL_IF_COPY(UserInterface);
|
DECL_IF_COPY(UserInterface);
|
||||||
DECL_IF_COPY(Aural);
|
DECL_IF_COPY(Aural);
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
DECL_IF_COPY(XUL);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_REFS
|
#ifdef DEBUG_REFS
|
||||||
++gInstanceCount;
|
++gInstanceCount;
|
||||||
|
@ -1126,6 +1169,9 @@ CSSDeclarationImpl::~CSSDeclarationImpl(void)
|
||||||
CSS_IF_DELETE(mContent);
|
CSS_IF_DELETE(mContent);
|
||||||
CSS_IF_DELETE(mUserInterface);
|
CSS_IF_DELETE(mUserInterface);
|
||||||
CSS_IF_DELETE(mAural);
|
CSS_IF_DELETE(mAural);
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
CSS_IF_DELETE(mXUL);
|
||||||
|
#endif
|
||||||
|
|
||||||
NS_IF_RELEASE(mImportant);
|
NS_IF_RELEASE(mImportant);
|
||||||
CSS_IF_DELETE(mOrder);
|
CSS_IF_DELETE(mOrder);
|
||||||
|
@ -1161,7 +1207,11 @@ CSSDeclarationImpl::GetData(const nsID& aSID, nsCSSStruct** aDataPtr)
|
||||||
CSS_IF_GET_ELSE(aSID, Page, aDataPtr)
|
CSS_IF_GET_ELSE(aSID, Page, aDataPtr)
|
||||||
CSS_IF_GET_ELSE(aSID, Content, aDataPtr)
|
CSS_IF_GET_ELSE(aSID, Content, aDataPtr)
|
||||||
CSS_IF_GET_ELSE(aSID, UserInterface, aDataPtr)
|
CSS_IF_GET_ELSE(aSID, UserInterface, aDataPtr)
|
||||||
CSS_IF_GET_ELSE(aSID, Aural, aDataPtr) {
|
CSS_IF_GET_ELSE(aSID, Aural, aDataPtr)
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
CSS_IF_GET_ELSE(aSID, XUL, aDataPtr)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
return NS_NOINTERFACE;
|
return NS_NOINTERFACE;
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
@ -1692,6 +1742,18 @@ CSSDeclarationImpl::AppendValue(nsCSSProperty aProperty, const nsCSSValue& aValu
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
// nsCSSXUL
|
||||||
|
case eCSSProperty_box_orient:
|
||||||
|
CSS_ENSURE(XUL) {
|
||||||
|
switch (aProperty) {
|
||||||
|
case eCSSProperty_box_orient: mXUL->mBoxOrient = aValue; break;
|
||||||
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
// nsCSSAural
|
// nsCSSAural
|
||||||
case eCSSProperty_azimuth:
|
case eCSSProperty_azimuth:
|
||||||
case eCSSProperty_elevation:
|
case eCSSProperty_elevation:
|
||||||
|
@ -2427,6 +2489,20 @@ CSSDeclarationImpl::SetValueImportant(nsCSSProperty aProperty)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
// nsCSSXUL
|
||||||
|
case eCSSProperty_box_orient:
|
||||||
|
if (nsnull != mXUL) {
|
||||||
|
CSS_ENSURE_IMPORTANT(XUL) {
|
||||||
|
switch (aProperty) {
|
||||||
|
CSS_CASE_IMPORTANT(eCSSProperty_box_orient, mXUL->mBoxOrient);
|
||||||
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
// nsCSSAural
|
// nsCSSAural
|
||||||
case eCSSProperty_azimuth:
|
case eCSSProperty_azimuth:
|
||||||
case eCSSProperty_elevation:
|
case eCSSProperty_elevation:
|
||||||
|
@ -3101,6 +3177,18 @@ CSSDeclarationImpl::RemoveProperty(nsCSSProperty aProperty)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
// nsCSSXUL
|
||||||
|
case eCSSProperty_box_orient:
|
||||||
|
CSS_CHECK(XUL) {
|
||||||
|
switch(aProperty) {
|
||||||
|
case eCSSProperty_box_orient: mXUL->mBoxOrient.Reset(); break;
|
||||||
|
CSS_BOGUS_DEFAULT; // Make compiler happy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
// nsCSSAural
|
// nsCSSAural
|
||||||
case eCSSProperty_azimuth:
|
case eCSSProperty_azimuth:
|
||||||
case eCSSProperty_elevation:
|
case eCSSProperty_elevation:
|
||||||
|
@ -3828,6 +3916,21 @@ CSSDeclarationImpl::GetValue(nsCSSProperty aProperty, nsCSSValue& aValue)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
// nsCSSXUL
|
||||||
|
case eCSSProperty_box_orient:
|
||||||
|
if (nsnull != mXUL) {
|
||||||
|
switch (aProperty) {
|
||||||
|
case eCSSProperty_box_orient: aValue = mXUL->mBoxOrient; break;
|
||||||
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
aValue.Reset();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
// nsCSSAural
|
// nsCSSAural
|
||||||
case eCSSProperty_azimuth:
|
case eCSSProperty_azimuth:
|
||||||
case eCSSProperty_elevation:
|
case eCSSProperty_elevation:
|
||||||
|
@ -4615,6 +4718,11 @@ void CSSDeclarationImpl::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSiz
|
||||||
if(mUserInterface && uniqueItems->AddItem(mUserInterface)){
|
if(mUserInterface && uniqueItems->AddItem(mUserInterface)){
|
||||||
aSize += sizeof(*mUserInterface);
|
aSize += sizeof(*mUserInterface);
|
||||||
}
|
}
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
if(mXUL && uniqueItems->AddItem(mXUL)){
|
||||||
|
aSize += sizeof(*mXUL);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if(mAural && uniqueItems->AddItem(mAural)){
|
if(mAural && uniqueItems->AddItem(mAural)){
|
||||||
aSize += sizeof(*mAural);
|
aSize += sizeof(*mAural);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,381 +0,0 @@
|
||||||
/* -*- 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) 1999 Netscape Communications Corporation. All
|
|
||||||
* Rights Reserved.
|
|
||||||
*
|
|
||||||
* Contributor(s):
|
|
||||||
*/
|
|
||||||
|
|
||||||
/******
|
|
||||||
|
|
||||||
This file contains the list of all parsed CSS keywords
|
|
||||||
See nsCSSKeywords.h for access to the enum values for keywords
|
|
||||||
|
|
||||||
It is designed to be used as inline input to nsCSSKeywords.cpp *only*
|
|
||||||
through the magic of C preprocessing.
|
|
||||||
|
|
||||||
All entires must be enclosed in the macro CSS_KEY which will have cruel
|
|
||||||
and unusual things done to it
|
|
||||||
|
|
||||||
It is recommended (but not strictly necessary) to keep all entries
|
|
||||||
in alphabetical order
|
|
||||||
|
|
||||||
Requirements:
|
|
||||||
|
|
||||||
Entries are in the form: (name,id). 'id' must always be the same as 'name'
|
|
||||||
except that all hyphens ('-') in 'name' are converted to underscores ('_')
|
|
||||||
in 'id'. This lets us do nice things with the macros without having to
|
|
||||||
copy/convert strings at runtime.
|
|
||||||
|
|
||||||
'name' entries *must* use only lowercase characters.
|
|
||||||
|
|
||||||
** Break these invarient and bad things will happen. **
|
|
||||||
|
|
||||||
******/
|
|
||||||
|
|
||||||
CSS_KEY(-moz-all, _moz_all)
|
|
||||||
CSS_KEY(-moz-bg-inset, _moz_bg_inset)
|
|
||||||
CSS_KEY(-moz-bg-outset, _moz_bg_outset)
|
|
||||||
CSS_KEY(-moz-center, _moz_center)
|
|
||||||
CSS_KEY(-moz-field, _moz_field)
|
|
||||||
CSS_KEY(-moz-dragtargetzone, _moz_dragtargetzone)
|
|
||||||
CSS_KEY(-moz-mac-focusring, _moz_mac_focusring)
|
|
||||||
CSS_KEY(-moz-mac-menuselect, _moz_mac_menuselect)
|
|
||||||
CSS_KEY(-moz-mac-menushadow, _moz_mac_menushadow)
|
|
||||||
CSS_KEY(-moz-mac-menutextselect, _moz_mac_menutextselect)
|
|
||||||
CSS_KEY(-moz-mac-accentlightesthighlight, _moz_mac_accentlightesthighlight)
|
|
||||||
CSS_KEY(-moz-mac-accentregularhighlight, _moz_mac_accentregularhighlight)
|
|
||||||
CSS_KEY(-moz-mac-accentface, _moz_mac_accentface)
|
|
||||||
CSS_KEY(-moz-mac-accentlightshadow, _moz_mac_accentlightshadow)
|
|
||||||
CSS_KEY(-moz-mac-accentregularshadow, _moz_mac_accentregularshadow)
|
|
||||||
CSS_KEY(-moz-mac-accentdarkshadow, _moz_mac_accentdarkshadow)
|
|
||||||
CSS_KEY(-moz-mac-accentdarkestshadow, _moz_mac_accentdarkestshadow)
|
|
||||||
CSS_KEY(-moz-right, _moz_right)
|
|
||||||
CSS_KEY(-moz-pre-wrap, _moz_pre_wrap)
|
|
||||||
CSS_KEY(-moz-scrollbars-none, _moz_scrollbars_none)
|
|
||||||
CSS_KEY(-moz-scrollbars-horizontal, _moz_scrollbars_horizontal)
|
|
||||||
CSS_KEY(-moz-scrollbars-vertical, _moz_scrollbars_vertical)
|
|
||||||
CSS_KEY(-moz-box, _moz_box)
|
|
||||||
CSS_KEY(-moz-inline-box, _moz_inline_box)
|
|
||||||
CSS_KEY(-moz-grid, _moz_grid)
|
|
||||||
CSS_KEY(-moz-inline-grid, _moz_inline_grid)
|
|
||||||
CSS_KEY(-moz-grid-group, _moz_grid_group)
|
|
||||||
CSS_KEY(-moz-grid-line, _moz_grid_line)
|
|
||||||
CSS_KEY(-moz-stack, _moz_stack)
|
|
||||||
CSS_KEY(-moz-inline-stack, _moz_inline_stack)
|
|
||||||
CSS_KEY(above, above)
|
|
||||||
CSS_KEY(absolute, absolute)
|
|
||||||
CSS_KEY(activeborder, activeborder)
|
|
||||||
CSS_KEY(activecaption, activecaption)
|
|
||||||
CSS_KEY(alias, alias)
|
|
||||||
CSS_KEY(all, all)
|
|
||||||
CSS_KEY(always, always)
|
|
||||||
CSS_KEY(appworkspace, appworkspace)
|
|
||||||
CSS_KEY(arabic-indic, arabic_indic)
|
|
||||||
CSS_KEY(armenian, armenian)
|
|
||||||
CSS_KEY(auto, auto)
|
|
||||||
CSS_KEY(avoid, avoid)
|
|
||||||
CSS_KEY(background, background)
|
|
||||||
CSS_KEY(baseline, baseline)
|
|
||||||
CSS_KEY(behind, behind)
|
|
||||||
CSS_KEY(below, below)
|
|
||||||
CSS_KEY(bengali, bengali)
|
|
||||||
CSS_KEY(bidi-override, bidi_override)
|
|
||||||
CSS_KEY(blink, blink)
|
|
||||||
CSS_KEY(block, block)
|
|
||||||
CSS_KEY(bold, bold)
|
|
||||||
CSS_KEY(bolder, bolder)
|
|
||||||
CSS_KEY(border-box, border_box)
|
|
||||||
CSS_KEY(both, both)
|
|
||||||
CSS_KEY(bottom, bottom)
|
|
||||||
CSS_KEY(button, button)
|
|
||||||
CSS_KEY(buttonface, buttonface)
|
|
||||||
CSS_KEY(buttonhighlight, buttonhighlight)
|
|
||||||
CSS_KEY(buttonshadow, buttonshadow)
|
|
||||||
CSS_KEY(buttontext, buttontext)
|
|
||||||
CSS_KEY(capitalize, capitalize)
|
|
||||||
CSS_KEY(caption, caption)
|
|
||||||
CSS_KEY(captiontext, captiontext)
|
|
||||||
CSS_KEY(cell, cell)
|
|
||||||
CSS_KEY(center, center)
|
|
||||||
CSS_KEY(center-left, center_left)
|
|
||||||
CSS_KEY(center-right, center_right)
|
|
||||||
CSS_KEY(ch, ch)
|
|
||||||
CSS_KEY(circle, circle)
|
|
||||||
CSS_KEY(cjk-earthly-branch, cjk_earthly_branch)
|
|
||||||
CSS_KEY(cjk-heavenly-stem, cjk_heavenly_stem)
|
|
||||||
CSS_KEY(cjk-ideographic, cjk_ideographic)
|
|
||||||
CSS_KEY(close-quote, close_quote)
|
|
||||||
CSS_KEY(cm, cm)
|
|
||||||
CSS_KEY(code, code)
|
|
||||||
CSS_KEY(collapse, collapse)
|
|
||||||
CSS_KEY(compact, compact)
|
|
||||||
CSS_KEY(condensed, condensed)
|
|
||||||
CSS_KEY(content-box, content_box)
|
|
||||||
CSS_KEY(context-menu, context_menu)
|
|
||||||
CSS_KEY(continuous, continuous)
|
|
||||||
CSS_KEY(copy, copy)
|
|
||||||
CSS_KEY(count-down, count_down)
|
|
||||||
CSS_KEY(count-up, count_up)
|
|
||||||
CSS_KEY(count-up-down, count_up_down)
|
|
||||||
CSS_KEY(crop, crop)
|
|
||||||
CSS_KEY(cross, cross)
|
|
||||||
CSS_KEY(crosshair, crosshair)
|
|
||||||
CSS_KEY(dashed, dashed)
|
|
||||||
CSS_KEY(decimal, decimal)
|
|
||||||
CSS_KEY(decimal-leading-zero, decimal_leading_zero)
|
|
||||||
CSS_KEY(default, default)
|
|
||||||
CSS_KEY(deg, deg)
|
|
||||||
CSS_KEY(desktop, desktop)
|
|
||||||
CSS_KEY(devanagari, devanagari)
|
|
||||||
CSS_KEY(dialog, dialog)
|
|
||||||
CSS_KEY(digits, digits)
|
|
||||||
CSS_KEY(disabled, disabled)
|
|
||||||
CSS_KEY(disc, disc)
|
|
||||||
CSS_KEY(document, document)
|
|
||||||
CSS_KEY(dotted, dotted)
|
|
||||||
CSS_KEY(double, double)
|
|
||||||
CSS_KEY(e-resize, e_resize)
|
|
||||||
CSS_KEY(element, element)
|
|
||||||
CSS_KEY(elements, elements)
|
|
||||||
CSS_KEY(em, em)
|
|
||||||
CSS_KEY(embed, embed)
|
|
||||||
CSS_KEY(enabled, enabled)
|
|
||||||
CSS_KEY(end, end)
|
|
||||||
CSS_KEY(ex, ex)
|
|
||||||
CSS_KEY(expanded, expanded)
|
|
||||||
CSS_KEY(extra-condensed, extra_condensed)
|
|
||||||
CSS_KEY(extra-expanded, extra_expanded)
|
|
||||||
CSS_KEY(far-left, far_left)
|
|
||||||
CSS_KEY(far-right, far_right)
|
|
||||||
CSS_KEY(fast, fast)
|
|
||||||
CSS_KEY(faster, faster)
|
|
||||||
CSS_KEY(field, field)
|
|
||||||
CSS_KEY(fixed, fixed)
|
|
||||||
CSS_KEY(georgian, georgian)
|
|
||||||
CSS_KEY(grab, grab)
|
|
||||||
CSS_KEY(grabbing, grabbing)
|
|
||||||
CSS_KEY(grad, grad)
|
|
||||||
CSS_KEY(graytext, graytext)
|
|
||||||
CSS_KEY(groove, groove)
|
|
||||||
CSS_KEY(gujarati, gujarati)
|
|
||||||
CSS_KEY(gurmukhi, gurmukhi)
|
|
||||||
CSS_KEY(hebrew, hebrew)
|
|
||||||
CSS_KEY(help, help)
|
|
||||||
CSS_KEY(hidden, hidden)
|
|
||||||
CSS_KEY(hide, hide)
|
|
||||||
CSS_KEY(high, high)
|
|
||||||
CSS_KEY(higher, higher)
|
|
||||||
CSS_KEY(highlight, highlight)
|
|
||||||
CSS_KEY(highlighttext, highlighttext)
|
|
||||||
CSS_KEY(hiragana, hiragana)
|
|
||||||
CSS_KEY(hiragana-iroha, hiragana_iroha)
|
|
||||||
CSS_KEY(horizontal, horizontal)
|
|
||||||
CSS_KEY(hz, hz)
|
|
||||||
CSS_KEY(icon, icon)
|
|
||||||
CSS_KEY(ignore, ignore)
|
|
||||||
CSS_KEY(in, in)
|
|
||||||
CSS_KEY(inactiveborder, inactiveborder)
|
|
||||||
CSS_KEY(inactivecaption, inactivecaption)
|
|
||||||
CSS_KEY(inactivecaptiontext, inactivecaptiontext)
|
|
||||||
CSS_KEY(info, info)
|
|
||||||
CSS_KEY(infobackground, infobackground)
|
|
||||||
CSS_KEY(infotext, infotext)
|
|
||||||
CSS_KEY(inherit, inherit)
|
|
||||||
CSS_KEY(inline, inline)
|
|
||||||
CSS_KEY(inline-axis, inline_axis)
|
|
||||||
CSS_KEY(inline-block, inline_block)
|
|
||||||
CSS_KEY(inline-table, inline_table)
|
|
||||||
CSS_KEY(inset, inset)
|
|
||||||
CSS_KEY(inside, inside)
|
|
||||||
CSS_KEY(invert, invert)
|
|
||||||
CSS_KEY(italic, italic)
|
|
||||||
CSS_KEY(japanese-formal, japanese_formal)
|
|
||||||
CSS_KEY(japanese-informal, japanese_informal)
|
|
||||||
CSS_KEY(justify, justify)
|
|
||||||
CSS_KEY(kannada, kannada)
|
|
||||||
CSS_KEY(katakana, katakana)
|
|
||||||
CSS_KEY(katakana-iroha, katakana_iroha)
|
|
||||||
CSS_KEY(khmer, khmer)
|
|
||||||
CSS_KEY(khz, khz)
|
|
||||||
CSS_KEY(landscape, landscape)
|
|
||||||
CSS_KEY(lao, lao)
|
|
||||||
CSS_KEY(large, large)
|
|
||||||
CSS_KEY(larger, larger)
|
|
||||||
CSS_KEY(left, left)
|
|
||||||
CSS_KEY(left-side, left_side)
|
|
||||||
CSS_KEY(leftwards, leftwards)
|
|
||||||
CSS_KEY(level, level)
|
|
||||||
CSS_KEY(lighter, lighter)
|
|
||||||
CSS_KEY(line-through, line_through)
|
|
||||||
CSS_KEY(list, list)
|
|
||||||
CSS_KEY(list-item, list_item)
|
|
||||||
CSS_KEY(loud, loud)
|
|
||||||
CSS_KEY(low, low)
|
|
||||||
CSS_KEY(lower, lower)
|
|
||||||
CSS_KEY(lower-alpha, lower_alpha)
|
|
||||||
CSS_KEY(lower-greek, lower_greek)
|
|
||||||
CSS_KEY(lower-latin, lower_latin)
|
|
||||||
CSS_KEY(lower-roman, lower_roman)
|
|
||||||
CSS_KEY(lowercase, lowercase)
|
|
||||||
CSS_KEY(ltr, ltr)
|
|
||||||
CSS_KEY(malayalam, malayalam)
|
|
||||||
CSS_KEY(margin-box, margin_box)
|
|
||||||
CSS_KEY(marker, marker)
|
|
||||||
CSS_KEY(medium, medium)
|
|
||||||
CSS_KEY(menu, menu)
|
|
||||||
CSS_KEY(menutext, menutext)
|
|
||||||
CSS_KEY(message-box, message_box)
|
|
||||||
CSS_KEY(middle, middle)
|
|
||||||
CSS_KEY(mix, mix)
|
|
||||||
CSS_KEY(mm, mm)
|
|
||||||
CSS_KEY(move, move)
|
|
||||||
CSS_KEY(ms, ms)
|
|
||||||
CSS_KEY(myanmar, myanmar)
|
|
||||||
CSS_KEY(n-resize, n_resize)
|
|
||||||
CSS_KEY(narrower, narrower)
|
|
||||||
CSS_KEY(ne-resize, ne_resize)
|
|
||||||
CSS_KEY(no-close-quote, no_close_quote)
|
|
||||||
CSS_KEY(no-open-quote, no_open_quote)
|
|
||||||
CSS_KEY(no-repeat, no_repeat)
|
|
||||||
CSS_KEY(none, none)
|
|
||||||
CSS_KEY(normal, normal)
|
|
||||||
CSS_KEY(noshade, noshade)
|
|
||||||
CSS_KEY(nowrap, nowrap)
|
|
||||||
CSS_KEY(nw-resize, nw_resize)
|
|
||||||
CSS_KEY(oblique, oblique)
|
|
||||||
CSS_KEY(once, once)
|
|
||||||
CSS_KEY(open-quote, open_quote)
|
|
||||||
CSS_KEY(oriya, oriya)
|
|
||||||
CSS_KEY(outset, outset)
|
|
||||||
CSS_KEY(outside, outside)
|
|
||||||
CSS_KEY(overline, overline)
|
|
||||||
CSS_KEY(padding-box, padding_box)
|
|
||||||
CSS_KEY(paragraph, paragraph)
|
|
||||||
CSS_KEY(pc, pc)
|
|
||||||
CSS_KEY(persian, persian)
|
|
||||||
CSS_KEY(pointer, pointer)
|
|
||||||
CSS_KEY(portrait, portrait)
|
|
||||||
CSS_KEY(pre, pre)
|
|
||||||
CSS_KEY(pt, pt)
|
|
||||||
CSS_KEY(pull-down-menu, pull_down_menu)
|
|
||||||
CSS_KEY(px, px)
|
|
||||||
CSS_KEY(rad, rad)
|
|
||||||
CSS_KEY(read-only, read_only)
|
|
||||||
CSS_KEY(read-write, read_write)
|
|
||||||
CSS_KEY(relative, relative)
|
|
||||||
CSS_KEY(repeat, repeat)
|
|
||||||
CSS_KEY(repeat-x, repeat_x)
|
|
||||||
CSS_KEY(repeat-y, repeat_y)
|
|
||||||
CSS_KEY(reverse, reverse)
|
|
||||||
CSS_KEY(ridge, ridge)
|
|
||||||
CSS_KEY(right, right)
|
|
||||||
CSS_KEY(right-side, right_side)
|
|
||||||
CSS_KEY(rightwards, rightwards)
|
|
||||||
CSS_KEY(rtl, rtl)
|
|
||||||
CSS_KEY(run-in, run_in)
|
|
||||||
CSS_KEY(s, s)
|
|
||||||
CSS_KEY(s-resize, s_resize)
|
|
||||||
CSS_KEY(scroll, scroll)
|
|
||||||
CSS_KEY(scrollbar, scrollbar)
|
|
||||||
CSS_KEY(se-resize, se_resize)
|
|
||||||
CSS_KEY(select-all, select_all)
|
|
||||||
CSS_KEY(select-before, select_before)
|
|
||||||
CSS_KEY(select-after, select_after)
|
|
||||||
CSS_KEY(select-same, select_same)
|
|
||||||
CSS_KEY(select-menu, select_menu)
|
|
||||||
CSS_KEY(semi-condensed, semi_condensed)
|
|
||||||
CSS_KEY(semi-expanded, semi_expanded)
|
|
||||||
CSS_KEY(separate, separate)
|
|
||||||
CSS_KEY(show, show)
|
|
||||||
CSS_KEY(silent, silent)
|
|
||||||
CSS_KEY(simp-chinese-formal, simp_chinese_formal)
|
|
||||||
CSS_KEY(simp-chinese-informal, simp_chinese_informal)
|
|
||||||
CSS_KEY(slow, slow)
|
|
||||||
CSS_KEY(slower, slower)
|
|
||||||
CSS_KEY(small, small)
|
|
||||||
CSS_KEY(small-caps, small_caps)
|
|
||||||
CSS_KEY(small-caption, small_caption)
|
|
||||||
CSS_KEY(smaller, smaller)
|
|
||||||
CSS_KEY(soft, soft)
|
|
||||||
CSS_KEY(solid, solid)
|
|
||||||
CSS_KEY(spell-out, spell_out)
|
|
||||||
CSS_KEY(spinning, spinning)
|
|
||||||
CSS_KEY(square, square)
|
|
||||||
CSS_KEY(start, start)
|
|
||||||
CSS_KEY(static, static)
|
|
||||||
CSS_KEY(status-bar, status_bar)
|
|
||||||
CSS_KEY(stretch, stretch)
|
|
||||||
CSS_KEY(sub, sub)
|
|
||||||
CSS_KEY(super, super)
|
|
||||||
CSS_KEY(sw-resize, sw_resize)
|
|
||||||
CSS_KEY(table, table)
|
|
||||||
CSS_KEY(table-caption, table_caption)
|
|
||||||
CSS_KEY(table-cell, table_cell)
|
|
||||||
CSS_KEY(table-column, table_column)
|
|
||||||
CSS_KEY(table-column-group, table_column_group)
|
|
||||||
CSS_KEY(table-footer-group, table_footer_group)
|
|
||||||
CSS_KEY(table-header-group, table_header_group)
|
|
||||||
CSS_KEY(table-row, table_row)
|
|
||||||
CSS_KEY(table-row-group, table_row_group)
|
|
||||||
CSS_KEY(tamil, tamil)
|
|
||||||
CSS_KEY(telugu, telugu)
|
|
||||||
CSS_KEY(text, text)
|
|
||||||
CSS_KEY(text-bottom, text_bottom)
|
|
||||||
CSS_KEY(text-top, text_top)
|
|
||||||
CSS_KEY(thai, thai)
|
|
||||||
CSS_KEY(thick, thick)
|
|
||||||
CSS_KEY(thin, thin)
|
|
||||||
CSS_KEY(threeddarkshadow, threeddarkshadow)
|
|
||||||
CSS_KEY(threedface, threedface)
|
|
||||||
CSS_KEY(threedhighlight, threedhighlight)
|
|
||||||
CSS_KEY(threedlightshadow, threedlightshadow)
|
|
||||||
CSS_KEY(threedshadow, threedshadow)
|
|
||||||
CSS_KEY(toggle, toggle)
|
|
||||||
CSS_KEY(top, top)
|
|
||||||
CSS_KEY(trad-chinese-formal, trad_chinese_formal)
|
|
||||||
CSS_KEY(trad-chinese-informal, trad_chinese_informal)
|
|
||||||
CSS_KEY(transparent, transparent)
|
|
||||||
CSS_KEY(tri-state, tri_state)
|
|
||||||
CSS_KEY(ultra-condensed, ultra_condensed)
|
|
||||||
CSS_KEY(ultra-expanded, ultra_expanded)
|
|
||||||
CSS_KEY(underline, underline)
|
|
||||||
CSS_KEY(upper-alpha, upper_alpha)
|
|
||||||
CSS_KEY(upper-latin, upper_latin)
|
|
||||||
CSS_KEY(upper-roman, upper_roman)
|
|
||||||
CSS_KEY(uppercase, uppercase)
|
|
||||||
CSS_KEY(urdu, urdu)
|
|
||||||
CSS_KEY(vertical, vertical)
|
|
||||||
CSS_KEY(visible, visible)
|
|
||||||
CSS_KEY(w-resize, w_resize)
|
|
||||||
CSS_KEY(wait, wait)
|
|
||||||
CSS_KEY(wider, wider)
|
|
||||||
CSS_KEY(window, window)
|
|
||||||
CSS_KEY(windowframe, windowframe)
|
|
||||||
CSS_KEY(windowtext, windowtext)
|
|
||||||
CSS_KEY(workspace, workspace)
|
|
||||||
CSS_KEY(write-only, write_only)
|
|
||||||
CSS_KEY(x-fast, x_fast)
|
|
||||||
CSS_KEY(x-high, x_high)
|
|
||||||
CSS_KEY(x-large, x_large)
|
|
||||||
CSS_KEY(x-loud, x_loud)
|
|
||||||
CSS_KEY(x-low, x_low)
|
|
||||||
CSS_KEY(x-slow, x_slow)
|
|
||||||
CSS_KEY(x-small, x_small)
|
|
||||||
CSS_KEY(x-soft, x_soft)
|
|
||||||
CSS_KEY(xx-large, xx_large)
|
|
||||||
CSS_KEY(xx-small, xx_small)
|
|
|
@ -1318,6 +1318,7 @@ PRBool CSSParserImpl::ParseSelectorList(PRInt32& aErrorCode,
|
||||||
REPORT_UNEXPECTED_EOF();
|
REPORT_UNEXPECTED_EOF();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eCSSToken_Symbol == tk->mType) {
|
if (eCSSToken_Symbol == tk->mType) {
|
||||||
if (',' == tk->mSymbol) {
|
if (',' == tk->mSymbol) {
|
||||||
SelectorList* newList = nsnull;
|
SelectorList* newList = nsnull;
|
||||||
|
@ -3187,6 +3188,11 @@ PRBool CSSParserImpl::ParseSingleValueProperty(PRInt32& aErrorCode,
|
||||||
case eCSSProperty_left:
|
case eCSSProperty_left:
|
||||||
case eCSSProperty_right:
|
case eCSSProperty_right:
|
||||||
return ParseVariant(aErrorCode, aValue, VARIANT_AHLP, nsnull);
|
return ParseVariant(aErrorCode, aValue, VARIANT_AHLP, nsnull);
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
case eCSSProperty_box_orient:
|
||||||
|
return ParseVariant(aErrorCode, aValue, VARIANT_HK,
|
||||||
|
nsCSSProps::kBoxOrientKTable);
|
||||||
|
#endif
|
||||||
case eCSSProperty_box_sizing:
|
case eCSSProperty_box_sizing:
|
||||||
return ParseVariant(aErrorCode, aValue, VARIANT_HK,
|
return ParseVariant(aErrorCode, aValue, VARIANT_HK,
|
||||||
nsCSSProps::kBoxSizingKTable);
|
nsCSSProps::kBoxSizingKTable);
|
||||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,130 +0,0 @@
|
||||||
/* -*- 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):
|
|
||||||
*/
|
|
||||||
#ifndef nsCSSProps_h___
|
|
||||||
#define nsCSSProps_h___
|
|
||||||
|
|
||||||
#include "nslayout.h"
|
|
||||||
#include "nsString.h"
|
|
||||||
|
|
||||||
/*
|
|
||||||
Declare the enum list using the magic of preprocessing
|
|
||||||
enum values are "eCSSProperty_foo" (where foo is the property)
|
|
||||||
|
|
||||||
To change the list of properties, see nsCSSPropList.h
|
|
||||||
|
|
||||||
*/
|
|
||||||
#define CSS_PROP(_name, _id, _hint) eCSSProperty_##_id,
|
|
||||||
enum nsCSSProperty {
|
|
||||||
eCSSProperty_UNKNOWN = -1,
|
|
||||||
#include "nsCSSPropList.h"
|
|
||||||
eCSSProperty_COUNT
|
|
||||||
};
|
|
||||||
#undef CSS_PROP
|
|
||||||
|
|
||||||
|
|
||||||
class NS_LAYOUT nsCSSProps {
|
|
||||||
public:
|
|
||||||
static void AddRefTable(void);
|
|
||||||
static void ReleaseTable(void);
|
|
||||||
|
|
||||||
// Given a property string, return the enum value
|
|
||||||
static nsCSSProperty LookupProperty(const nsAReadableString& aProperty);
|
|
||||||
static nsCSSProperty LookupProperty(const nsCString& aProperty);
|
|
||||||
|
|
||||||
// Given a property enum, get the string value
|
|
||||||
static const nsCString& GetStringValue(nsCSSProperty aProperty);
|
|
||||||
|
|
||||||
// Given a CSS Property and a Property Enum Value
|
|
||||||
// Return back a const nsString& representation of the
|
|
||||||
// value. Return back nullstr if no value is found
|
|
||||||
static const nsCString& LookupPropertyValue(nsCSSProperty aProperty, PRInt32 aValue);
|
|
||||||
|
|
||||||
// Get a color name for a predefined color value like buttonhighlight or activeborder
|
|
||||||
// Sets the aStr param to the name of the propertyID
|
|
||||||
static PRBool GetColorName(PRInt32 aPropID, nsCString &aStr);
|
|
||||||
|
|
||||||
static PRInt32 SearchKeywordTableInt(PRInt32 aValue, const PRInt32 aTable[]);
|
|
||||||
static const nsCString& SearchKeywordTable(PRInt32 aValue, const PRInt32 aTable[]);
|
|
||||||
|
|
||||||
static const PRInt32 kHintTable[];
|
|
||||||
|
|
||||||
// Keyword/Enum value tables
|
|
||||||
static const PRInt32 kAzimuthKTable[];
|
|
||||||
static const PRInt32 kBackgroundAttachmentKTable[];
|
|
||||||
static const PRInt32 kBackgroundColorKTable[];
|
|
||||||
static const PRInt32 kBackgroundRepeatKTable[];
|
|
||||||
static const PRInt32 kBorderCollapseKTable[];
|
|
||||||
static const PRInt32 kBorderColorKTable[];
|
|
||||||
static const PRInt32 kBorderStyleKTable[];
|
|
||||||
static const PRInt32 kBorderWidthKTable[];
|
|
||||||
static const PRInt32 kBoxSizingKTable[];
|
|
||||||
static const PRInt32 kCaptionSideKTable[];
|
|
||||||
static const PRInt32 kClearKTable[];
|
|
||||||
static const PRInt32 kColorKTable[];
|
|
||||||
static const PRInt32 kContentKTable[];
|
|
||||||
static const PRInt32 kCursorKTable[];
|
|
||||||
static const PRInt32 kDirectionKTable[];
|
|
||||||
static const PRInt32 kDisplayKTable[];
|
|
||||||
static const PRInt32 kElevationKTable[];
|
|
||||||
static const PRInt32 kEmptyCellsKTable[];
|
|
||||||
static const PRInt32 kFloatKTable[];
|
|
||||||
static const PRInt32 kFloatEdgeKTable[];
|
|
||||||
static const PRInt32 kFontKTable[];
|
|
||||||
static const PRInt32 kFontSizeKTable[];
|
|
||||||
static const PRInt32 kFontStretchKTable[];
|
|
||||||
static const PRInt32 kFontStyleKTable[];
|
|
||||||
static const PRInt32 kFontVariantKTable[];
|
|
||||||
static const PRInt32 kFontWeightKTable[];
|
|
||||||
static const PRInt32 kKeyEquivalentKTable[];
|
|
||||||
static const PRInt32 kListStylePositionKTable[];
|
|
||||||
static const PRInt32 kListStyleKTable[];
|
|
||||||
static const PRInt32 kOutlineColorKTable[];
|
|
||||||
static const PRInt32 kOverflowKTable[];
|
|
||||||
static const PRInt32 kPageBreakKTable[];
|
|
||||||
static const PRInt32 kPageBreakInsideKTable[];
|
|
||||||
static const PRInt32 kPageMarksKTable[];
|
|
||||||
static const PRInt32 kPageSizeKTable[];
|
|
||||||
static const PRInt32 kPitchKTable[];
|
|
||||||
static const PRInt32 kPlayDuringKTable[];
|
|
||||||
static const PRInt32 kPositionKTable[];
|
|
||||||
static const PRInt32 kResizerKTable[];
|
|
||||||
static const PRInt32 kSpeakKTable[];
|
|
||||||
static const PRInt32 kSpeakHeaderKTable[];
|
|
||||||
static const PRInt32 kSpeakNumeralKTable[];
|
|
||||||
static const PRInt32 kSpeakPunctuationKTable[];
|
|
||||||
static const PRInt32 kSpeechRateKTable[];
|
|
||||||
static const PRInt32 kTableLayoutKTable[];
|
|
||||||
static const PRInt32 kTextAlignKTable[];
|
|
||||||
static const PRInt32 kTextDecorationKTable[];
|
|
||||||
static const PRInt32 kTextTransformKTable[];
|
|
||||||
static const PRInt32 kUnicodeBidiKTable[];
|
|
||||||
static const PRInt32 kUserFocusKTable[];
|
|
||||||
static const PRInt32 kUserInputKTable[];
|
|
||||||
static const PRInt32 kUserModifyKTable[];
|
|
||||||
static const PRInt32 kUserSelectKTable[];
|
|
||||||
static const PRInt32 kVerticalAlignKTable[];
|
|
||||||
static const PRInt32 kVisibilityKTable[];
|
|
||||||
static const PRInt32 kVolumeKTable[];
|
|
||||||
static const PRInt32 kWhitespaceKTable[];
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* nsCSSProps_h___ */
|
|
|
@ -48,7 +48,9 @@ static NS_DEFINE_IID(kCSSPageSID, NS_CSS_PAGE_SID);
|
||||||
static NS_DEFINE_IID(kCSSContentSID, NS_CSS_CONTENT_SID);
|
static NS_DEFINE_IID(kCSSContentSID, NS_CSS_CONTENT_SID);
|
||||||
static NS_DEFINE_IID(kCSSUserInterfaceSID, NS_CSS_USER_INTERFACE_SID);
|
static NS_DEFINE_IID(kCSSUserInterfaceSID, NS_CSS_USER_INTERFACE_SID);
|
||||||
static NS_DEFINE_IID(kCSSAuralSID, NS_CSS_AURAL_SID);
|
static NS_DEFINE_IID(kCSSAuralSID, NS_CSS_AURAL_SID);
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
static NS_DEFINE_IID(kCSSXULSID, NS_CSS_XUL_SID);
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CSS_IF_DELETE(ptr) if (nsnull != ptr) { delete ptr; ptr = nsnull; }
|
#define CSS_IF_DELETE(ptr) if (nsnull != ptr) { delete ptr; ptr = nsnull; }
|
||||||
|
|
||||||
|
@ -973,6 +975,41 @@ void nsCSSAural::List(FILE* out, PRInt32 aIndent) const
|
||||||
fputs(buffer, out);
|
fputs(buffer, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
// --- nsCSSXUL -----------------
|
||||||
|
|
||||||
|
nsCSSXUL::nsCSSXUL(void)
|
||||||
|
{
|
||||||
|
MOZ_COUNT_CTOR(nsCSSXUL);
|
||||||
|
}
|
||||||
|
|
||||||
|
nsCSSXUL::nsCSSXUL(const nsCSSXUL& aCopy)
|
||||||
|
: mBoxOrient(aCopy.mBoxOrient)
|
||||||
|
{
|
||||||
|
MOZ_COUNT_CTOR(nsCSSXUL);
|
||||||
|
}
|
||||||
|
|
||||||
|
nsCSSXUL::~nsCSSXUL(void)
|
||||||
|
{
|
||||||
|
MOZ_COUNT_DTOR(nsCSSXUL);
|
||||||
|
}
|
||||||
|
|
||||||
|
const nsID& nsCSSXUL::GetID(void)
|
||||||
|
{
|
||||||
|
return kCSSXULSID;
|
||||||
|
}
|
||||||
|
|
||||||
|
void nsCSSXUL::List(FILE* out, PRInt32 aIndent) const
|
||||||
|
{
|
||||||
|
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
|
||||||
|
|
||||||
|
nsAutoString buffer;
|
||||||
|
|
||||||
|
mBoxOrient.AppendToString(buffer, eCSSProperty_box_orient);
|
||||||
|
fputs(buffer, out);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // INCLUDE_XUL
|
||||||
|
|
||||||
|
|
||||||
// --- nsCSSDeclaration -----------------
|
// --- nsCSSDeclaration -----------------
|
||||||
|
@ -1042,6 +1079,9 @@ protected:
|
||||||
nsCSSContent* mContent;
|
nsCSSContent* mContent;
|
||||||
nsCSSUserInterface* mUserInterface;
|
nsCSSUserInterface* mUserInterface;
|
||||||
nsCSSAural* mAural;
|
nsCSSAural* mAural;
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
nsCSSXUL* mXUL;
|
||||||
|
#endif
|
||||||
|
|
||||||
CSSDeclarationImpl* mImportant;
|
CSSDeclarationImpl* mImportant;
|
||||||
|
|
||||||
|
@ -1084,6 +1124,9 @@ CSSDeclarationImpl::CSSDeclarationImpl(const CSSDeclarationImpl& aCopy)
|
||||||
DECL_IF_COPY(Content);
|
DECL_IF_COPY(Content);
|
||||||
DECL_IF_COPY(UserInterface);
|
DECL_IF_COPY(UserInterface);
|
||||||
DECL_IF_COPY(Aural);
|
DECL_IF_COPY(Aural);
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
DECL_IF_COPY(XUL);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_REFS
|
#ifdef DEBUG_REFS
|
||||||
++gInstanceCount;
|
++gInstanceCount;
|
||||||
|
@ -1126,6 +1169,9 @@ CSSDeclarationImpl::~CSSDeclarationImpl(void)
|
||||||
CSS_IF_DELETE(mContent);
|
CSS_IF_DELETE(mContent);
|
||||||
CSS_IF_DELETE(mUserInterface);
|
CSS_IF_DELETE(mUserInterface);
|
||||||
CSS_IF_DELETE(mAural);
|
CSS_IF_DELETE(mAural);
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
CSS_IF_DELETE(mXUL);
|
||||||
|
#endif
|
||||||
|
|
||||||
NS_IF_RELEASE(mImportant);
|
NS_IF_RELEASE(mImportant);
|
||||||
CSS_IF_DELETE(mOrder);
|
CSS_IF_DELETE(mOrder);
|
||||||
|
@ -1161,7 +1207,11 @@ CSSDeclarationImpl::GetData(const nsID& aSID, nsCSSStruct** aDataPtr)
|
||||||
CSS_IF_GET_ELSE(aSID, Page, aDataPtr)
|
CSS_IF_GET_ELSE(aSID, Page, aDataPtr)
|
||||||
CSS_IF_GET_ELSE(aSID, Content, aDataPtr)
|
CSS_IF_GET_ELSE(aSID, Content, aDataPtr)
|
||||||
CSS_IF_GET_ELSE(aSID, UserInterface, aDataPtr)
|
CSS_IF_GET_ELSE(aSID, UserInterface, aDataPtr)
|
||||||
CSS_IF_GET_ELSE(aSID, Aural, aDataPtr) {
|
CSS_IF_GET_ELSE(aSID, Aural, aDataPtr)
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
CSS_IF_GET_ELSE(aSID, XUL, aDataPtr)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
return NS_NOINTERFACE;
|
return NS_NOINTERFACE;
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
@ -1692,6 +1742,18 @@ CSSDeclarationImpl::AppendValue(nsCSSProperty aProperty, const nsCSSValue& aValu
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
// nsCSSXUL
|
||||||
|
case eCSSProperty_box_orient:
|
||||||
|
CSS_ENSURE(XUL) {
|
||||||
|
switch (aProperty) {
|
||||||
|
case eCSSProperty_box_orient: mXUL->mBoxOrient = aValue; break;
|
||||||
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
// nsCSSAural
|
// nsCSSAural
|
||||||
case eCSSProperty_azimuth:
|
case eCSSProperty_azimuth:
|
||||||
case eCSSProperty_elevation:
|
case eCSSProperty_elevation:
|
||||||
|
@ -2427,6 +2489,20 @@ CSSDeclarationImpl::SetValueImportant(nsCSSProperty aProperty)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
// nsCSSXUL
|
||||||
|
case eCSSProperty_box_orient:
|
||||||
|
if (nsnull != mXUL) {
|
||||||
|
CSS_ENSURE_IMPORTANT(XUL) {
|
||||||
|
switch (aProperty) {
|
||||||
|
CSS_CASE_IMPORTANT(eCSSProperty_box_orient, mXUL->mBoxOrient);
|
||||||
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
// nsCSSAural
|
// nsCSSAural
|
||||||
case eCSSProperty_azimuth:
|
case eCSSProperty_azimuth:
|
||||||
case eCSSProperty_elevation:
|
case eCSSProperty_elevation:
|
||||||
|
@ -3101,6 +3177,18 @@ CSSDeclarationImpl::RemoveProperty(nsCSSProperty aProperty)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
// nsCSSXUL
|
||||||
|
case eCSSProperty_box_orient:
|
||||||
|
CSS_CHECK(XUL) {
|
||||||
|
switch(aProperty) {
|
||||||
|
case eCSSProperty_box_orient: mXUL->mBoxOrient.Reset(); break;
|
||||||
|
CSS_BOGUS_DEFAULT; // Make compiler happy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
// nsCSSAural
|
// nsCSSAural
|
||||||
case eCSSProperty_azimuth:
|
case eCSSProperty_azimuth:
|
||||||
case eCSSProperty_elevation:
|
case eCSSProperty_elevation:
|
||||||
|
@ -3828,6 +3916,21 @@ CSSDeclarationImpl::GetValue(nsCSSProperty aProperty, nsCSSValue& aValue)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
// nsCSSXUL
|
||||||
|
case eCSSProperty_box_orient:
|
||||||
|
if (nsnull != mXUL) {
|
||||||
|
switch (aProperty) {
|
||||||
|
case eCSSProperty_box_orient: aValue = mXUL->mBoxOrient; break;
|
||||||
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
aValue.Reset();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
// nsCSSAural
|
// nsCSSAural
|
||||||
case eCSSProperty_azimuth:
|
case eCSSProperty_azimuth:
|
||||||
case eCSSProperty_elevation:
|
case eCSSProperty_elevation:
|
||||||
|
@ -4615,6 +4718,11 @@ void CSSDeclarationImpl::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSiz
|
||||||
if(mUserInterface && uniqueItems->AddItem(mUserInterface)){
|
if(mUserInterface && uniqueItems->AddItem(mUserInterface)){
|
||||||
aSize += sizeof(*mUserInterface);
|
aSize += sizeof(*mUserInterface);
|
||||||
}
|
}
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
if(mXUL && uniqueItems->AddItem(mXUL)){
|
||||||
|
aSize += sizeof(*mXUL);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if(mAural && uniqueItems->AddItem(mAural)){
|
if(mAural && uniqueItems->AddItem(mAural)){
|
||||||
aSize += sizeof(*mAural);
|
aSize += sizeof(*mAural);
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,6 +78,9 @@ static NS_DEFINE_IID(kCSSContentSID, NS_CSS_CONTENT_SID);
|
||||||
static NS_DEFINE_IID(kCSSUserInterfaceSID, NS_CSS_USER_INTERFACE_SID);
|
static NS_DEFINE_IID(kCSSUserInterfaceSID, NS_CSS_USER_INTERFACE_SID);
|
||||||
static NS_DEFINE_IID(kCSSBreaksSID, NS_CSS_BREAKS_SID);
|
static NS_DEFINE_IID(kCSSBreaksSID, NS_CSS_BREAKS_SID);
|
||||||
static NS_DEFINE_IID(kCSSPageSID, NS_CSS_PAGE_SID);
|
static NS_DEFINE_IID(kCSSPageSID, NS_CSS_PAGE_SID);
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
static NS_DEFINE_IID(kCSSXULSID, NS_CSS_XUL_SID);
|
||||||
|
#endif
|
||||||
|
|
||||||
// -- nsCSSSelector -------------------------------
|
// -- nsCSSSelector -------------------------------
|
||||||
|
|
||||||
|
@ -3319,6 +3322,34 @@ MapDeclarationPrintInto(nsICSSDeclaration* aDeclaration,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
static void
|
||||||
|
MapDeclarationXULInto(nsICSSDeclaration* aDeclaration,
|
||||||
|
nsIMutableStyleContext* aContext, nsIStyleContext* aParentContext,
|
||||||
|
nsStyleFont* aFont, nsIPresContext* aPresContext)
|
||||||
|
{
|
||||||
|
nsCSSXUL* ourXUL;
|
||||||
|
if (NS_OK == aDeclaration->GetData(kCSSXULSID, (nsCSSStruct**)&ourXUL)) {
|
||||||
|
if (nsnull != ourXUL) {
|
||||||
|
nsStyleXUL* xul = (nsStyleXUL*)aContext->GetMutableStyleData(eStyleStruct_XUL);
|
||||||
|
|
||||||
|
const nsStyleXUL* parentXUL = xul;
|
||||||
|
if (nsnull != aParentContext) {
|
||||||
|
parentXUL = (const nsStyleXUL*)aParentContext->GetStyleData(eStyleStruct_XUL);
|
||||||
|
}
|
||||||
|
|
||||||
|
// box-orient: enum, inherit
|
||||||
|
if (eCSSUnit_Enumerated == ourXUL->mBoxOrient.GetUnit()) {
|
||||||
|
xul->mBoxOrient = ourXUL->mBoxOrient.GetIntValue();
|
||||||
|
}
|
||||||
|
else if (eCSSUnit_Inherit == ourXUL->mBoxOrient.GetUnit()) {
|
||||||
|
xul->mBoxOrient = parentXUL->mBoxOrient;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // INCLUDE_XUL
|
||||||
|
|
||||||
void MapDeclarationInto(nsICSSDeclaration* aDeclaration,
|
void MapDeclarationInto(nsICSSDeclaration* aDeclaration,
|
||||||
nsIMutableStyleContext* aContext, nsIPresContext* aPresContext)
|
nsIMutableStyleContext* aContext, nsIPresContext* aPresContext)
|
||||||
{
|
{
|
||||||
|
@ -3336,6 +3367,9 @@ void MapDeclarationInto(nsICSSDeclaration* aDeclaration,
|
||||||
MapDeclarationContentInto(aDeclaration, aContext, parentContext, font, aPresContext);
|
MapDeclarationContentInto(aDeclaration, aContext, parentContext, font, aPresContext);
|
||||||
MapDeclarationUIInto(aDeclaration, aContext, parentContext, font, aPresContext);
|
MapDeclarationUIInto(aDeclaration, aContext, parentContext, font, aPresContext);
|
||||||
MapDeclarationPrintInto(aDeclaration, aContext, parentContext, font, aPresContext);
|
MapDeclarationPrintInto(aDeclaration, aContext, parentContext, font, aPresContext);
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
MapDeclarationXULInto(aDeclaration, aContext, parentContext, font, aPresContext);
|
||||||
|
#endif
|
||||||
|
|
||||||
NS_IF_RELEASE(parentContext);
|
NS_IF_RELEASE(parentContext);
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,6 +91,11 @@ struct nsCSSStruct {
|
||||||
#define NS_CSS_AURAL_SID \
|
#define NS_CSS_AURAL_SID \
|
||||||
{0x166d2bb0, 0x5a3b, 0x11d2, {0x80, 0x3b, 0x00, 0x60, 0x08, 0x15, 0x9b, 0x5a}}
|
{0x166d2bb0, 0x5a3b, 0x11d2, {0x80, 0x3b, 0x00, 0x60, 0x08, 0x15, 0x9b, 0x5a}}
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
// {FC075D62-B1CF-47a1-AF4E-CB40E11A4314}
|
||||||
|
#define NS_CSS_XUL_SID \
|
||||||
|
{ 0xfc075d62, 0xb1cf, 0x47a1, { 0xaf, 0x4e, 0xcb, 0x40, 0xe1, 0x1a, 0x43, 0x14 } }
|
||||||
|
#endif
|
||||||
|
|
||||||
// IID for the nsICSSDeclaration interface {7b36b9ac-b48d-11d1-9ca5-0060088f9ff7}
|
// IID for the nsICSSDeclaration interface {7b36b9ac-b48d-11d1-9ca5-0060088f9ff7}
|
||||||
#define NS_ICSS_DECLARATION_IID \
|
#define NS_ICSS_DECLARATION_IID \
|
||||||
|
@ -384,6 +389,19 @@ struct nsCSSAural : public nsCSSStruct { // NEW
|
||||||
nsCSSValue mVolume;
|
nsCSSValue mVolume;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
struct nsCSSXUL : public nsCSSStruct {
|
||||||
|
nsCSSXUL(void);
|
||||||
|
nsCSSXUL(const nsCSSXUL& aCopy);
|
||||||
|
virtual ~nsCSSXUL(void);
|
||||||
|
|
||||||
|
const nsID& GetID(void);
|
||||||
|
void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
||||||
|
|
||||||
|
nsCSSValue mBoxOrient;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
class nsICSSDeclaration : public nsISupports {
|
class nsICSSDeclaration : public nsISupports {
|
||||||
public:
|
public:
|
||||||
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICSS_DECLARATION_IID);
|
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICSS_DECLARATION_IID);
|
||||||
|
|
|
@ -97,6 +97,7 @@ CSS_KEY(bengali, bengali)
|
||||||
CSS_KEY(bidi-override, bidi_override)
|
CSS_KEY(bidi-override, bidi_override)
|
||||||
CSS_KEY(blink, blink)
|
CSS_KEY(blink, blink)
|
||||||
CSS_KEY(block, block)
|
CSS_KEY(block, block)
|
||||||
|
CSS_KEY(block-axis, block_axis)
|
||||||
CSS_KEY(bold, bold)
|
CSS_KEY(bold, bold)
|
||||||
CSS_KEY(bolder, bolder)
|
CSS_KEY(bolder, bolder)
|
||||||
CSS_KEY(border-box, border_box)
|
CSS_KEY(border-box, border_box)
|
||||||
|
|
|
@ -76,6 +76,9 @@ public:
|
||||||
static const PRInt32 kBorderColorKTable[];
|
static const PRInt32 kBorderColorKTable[];
|
||||||
static const PRInt32 kBorderStyleKTable[];
|
static const PRInt32 kBorderStyleKTable[];
|
||||||
static const PRInt32 kBorderWidthKTable[];
|
static const PRInt32 kBorderWidthKTable[];
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
static const PRInt32 kBoxOrientKTable[];
|
||||||
|
#endif
|
||||||
static const PRInt32 kBoxSizingKTable[];
|
static const PRInt32 kBoxSizingKTable[];
|
||||||
static const PRInt32 kCaptionSideKTable[];
|
static const PRInt32 kCaptionSideKTable[];
|
||||||
static const PRInt32 kClearKTable[];
|
static const PRInt32 kClearKTable[];
|
||||||
|
|
|
@ -48,7 +48,9 @@ static NS_DEFINE_IID(kCSSPageSID, NS_CSS_PAGE_SID);
|
||||||
static NS_DEFINE_IID(kCSSContentSID, NS_CSS_CONTENT_SID);
|
static NS_DEFINE_IID(kCSSContentSID, NS_CSS_CONTENT_SID);
|
||||||
static NS_DEFINE_IID(kCSSUserInterfaceSID, NS_CSS_USER_INTERFACE_SID);
|
static NS_DEFINE_IID(kCSSUserInterfaceSID, NS_CSS_USER_INTERFACE_SID);
|
||||||
static NS_DEFINE_IID(kCSSAuralSID, NS_CSS_AURAL_SID);
|
static NS_DEFINE_IID(kCSSAuralSID, NS_CSS_AURAL_SID);
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
static NS_DEFINE_IID(kCSSXULSID, NS_CSS_XUL_SID);
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CSS_IF_DELETE(ptr) if (nsnull != ptr) { delete ptr; ptr = nsnull; }
|
#define CSS_IF_DELETE(ptr) if (nsnull != ptr) { delete ptr; ptr = nsnull; }
|
||||||
|
|
||||||
|
@ -973,6 +975,41 @@ void nsCSSAural::List(FILE* out, PRInt32 aIndent) const
|
||||||
fputs(buffer, out);
|
fputs(buffer, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
// --- nsCSSXUL -----------------
|
||||||
|
|
||||||
|
nsCSSXUL::nsCSSXUL(void)
|
||||||
|
{
|
||||||
|
MOZ_COUNT_CTOR(nsCSSXUL);
|
||||||
|
}
|
||||||
|
|
||||||
|
nsCSSXUL::nsCSSXUL(const nsCSSXUL& aCopy)
|
||||||
|
: mBoxOrient(aCopy.mBoxOrient)
|
||||||
|
{
|
||||||
|
MOZ_COUNT_CTOR(nsCSSXUL);
|
||||||
|
}
|
||||||
|
|
||||||
|
nsCSSXUL::~nsCSSXUL(void)
|
||||||
|
{
|
||||||
|
MOZ_COUNT_DTOR(nsCSSXUL);
|
||||||
|
}
|
||||||
|
|
||||||
|
const nsID& nsCSSXUL::GetID(void)
|
||||||
|
{
|
||||||
|
return kCSSXULSID;
|
||||||
|
}
|
||||||
|
|
||||||
|
void nsCSSXUL::List(FILE* out, PRInt32 aIndent) const
|
||||||
|
{
|
||||||
|
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
|
||||||
|
|
||||||
|
nsAutoString buffer;
|
||||||
|
|
||||||
|
mBoxOrient.AppendToString(buffer, eCSSProperty_box_orient);
|
||||||
|
fputs(buffer, out);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // INCLUDE_XUL
|
||||||
|
|
||||||
|
|
||||||
// --- nsCSSDeclaration -----------------
|
// --- nsCSSDeclaration -----------------
|
||||||
|
@ -1042,6 +1079,9 @@ protected:
|
||||||
nsCSSContent* mContent;
|
nsCSSContent* mContent;
|
||||||
nsCSSUserInterface* mUserInterface;
|
nsCSSUserInterface* mUserInterface;
|
||||||
nsCSSAural* mAural;
|
nsCSSAural* mAural;
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
nsCSSXUL* mXUL;
|
||||||
|
#endif
|
||||||
|
|
||||||
CSSDeclarationImpl* mImportant;
|
CSSDeclarationImpl* mImportant;
|
||||||
|
|
||||||
|
@ -1084,6 +1124,9 @@ CSSDeclarationImpl::CSSDeclarationImpl(const CSSDeclarationImpl& aCopy)
|
||||||
DECL_IF_COPY(Content);
|
DECL_IF_COPY(Content);
|
||||||
DECL_IF_COPY(UserInterface);
|
DECL_IF_COPY(UserInterface);
|
||||||
DECL_IF_COPY(Aural);
|
DECL_IF_COPY(Aural);
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
DECL_IF_COPY(XUL);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_REFS
|
#ifdef DEBUG_REFS
|
||||||
++gInstanceCount;
|
++gInstanceCount;
|
||||||
|
@ -1126,6 +1169,9 @@ CSSDeclarationImpl::~CSSDeclarationImpl(void)
|
||||||
CSS_IF_DELETE(mContent);
|
CSS_IF_DELETE(mContent);
|
||||||
CSS_IF_DELETE(mUserInterface);
|
CSS_IF_DELETE(mUserInterface);
|
||||||
CSS_IF_DELETE(mAural);
|
CSS_IF_DELETE(mAural);
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
CSS_IF_DELETE(mXUL);
|
||||||
|
#endif
|
||||||
|
|
||||||
NS_IF_RELEASE(mImportant);
|
NS_IF_RELEASE(mImportant);
|
||||||
CSS_IF_DELETE(mOrder);
|
CSS_IF_DELETE(mOrder);
|
||||||
|
@ -1161,7 +1207,11 @@ CSSDeclarationImpl::GetData(const nsID& aSID, nsCSSStruct** aDataPtr)
|
||||||
CSS_IF_GET_ELSE(aSID, Page, aDataPtr)
|
CSS_IF_GET_ELSE(aSID, Page, aDataPtr)
|
||||||
CSS_IF_GET_ELSE(aSID, Content, aDataPtr)
|
CSS_IF_GET_ELSE(aSID, Content, aDataPtr)
|
||||||
CSS_IF_GET_ELSE(aSID, UserInterface, aDataPtr)
|
CSS_IF_GET_ELSE(aSID, UserInterface, aDataPtr)
|
||||||
CSS_IF_GET_ELSE(aSID, Aural, aDataPtr) {
|
CSS_IF_GET_ELSE(aSID, Aural, aDataPtr)
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
CSS_IF_GET_ELSE(aSID, XUL, aDataPtr)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
return NS_NOINTERFACE;
|
return NS_NOINTERFACE;
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
@ -1692,6 +1742,18 @@ CSSDeclarationImpl::AppendValue(nsCSSProperty aProperty, const nsCSSValue& aValu
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
// nsCSSXUL
|
||||||
|
case eCSSProperty_box_orient:
|
||||||
|
CSS_ENSURE(XUL) {
|
||||||
|
switch (aProperty) {
|
||||||
|
case eCSSProperty_box_orient: mXUL->mBoxOrient = aValue; break;
|
||||||
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
// nsCSSAural
|
// nsCSSAural
|
||||||
case eCSSProperty_azimuth:
|
case eCSSProperty_azimuth:
|
||||||
case eCSSProperty_elevation:
|
case eCSSProperty_elevation:
|
||||||
|
@ -2427,6 +2489,20 @@ CSSDeclarationImpl::SetValueImportant(nsCSSProperty aProperty)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
// nsCSSXUL
|
||||||
|
case eCSSProperty_box_orient:
|
||||||
|
if (nsnull != mXUL) {
|
||||||
|
CSS_ENSURE_IMPORTANT(XUL) {
|
||||||
|
switch (aProperty) {
|
||||||
|
CSS_CASE_IMPORTANT(eCSSProperty_box_orient, mXUL->mBoxOrient);
|
||||||
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
// nsCSSAural
|
// nsCSSAural
|
||||||
case eCSSProperty_azimuth:
|
case eCSSProperty_azimuth:
|
||||||
case eCSSProperty_elevation:
|
case eCSSProperty_elevation:
|
||||||
|
@ -3101,6 +3177,18 @@ CSSDeclarationImpl::RemoveProperty(nsCSSProperty aProperty)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
// nsCSSXUL
|
||||||
|
case eCSSProperty_box_orient:
|
||||||
|
CSS_CHECK(XUL) {
|
||||||
|
switch(aProperty) {
|
||||||
|
case eCSSProperty_box_orient: mXUL->mBoxOrient.Reset(); break;
|
||||||
|
CSS_BOGUS_DEFAULT; // Make compiler happy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
// nsCSSAural
|
// nsCSSAural
|
||||||
case eCSSProperty_azimuth:
|
case eCSSProperty_azimuth:
|
||||||
case eCSSProperty_elevation:
|
case eCSSProperty_elevation:
|
||||||
|
@ -3828,6 +3916,21 @@ CSSDeclarationImpl::GetValue(nsCSSProperty aProperty, nsCSSValue& aValue)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
// nsCSSXUL
|
||||||
|
case eCSSProperty_box_orient:
|
||||||
|
if (nsnull != mXUL) {
|
||||||
|
switch (aProperty) {
|
||||||
|
case eCSSProperty_box_orient: aValue = mXUL->mBoxOrient; break;
|
||||||
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
aValue.Reset();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
// nsCSSAural
|
// nsCSSAural
|
||||||
case eCSSProperty_azimuth:
|
case eCSSProperty_azimuth:
|
||||||
case eCSSProperty_elevation:
|
case eCSSProperty_elevation:
|
||||||
|
@ -4615,6 +4718,11 @@ void CSSDeclarationImpl::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSiz
|
||||||
if(mUserInterface && uniqueItems->AddItem(mUserInterface)){
|
if(mUserInterface && uniqueItems->AddItem(mUserInterface)){
|
||||||
aSize += sizeof(*mUserInterface);
|
aSize += sizeof(*mUserInterface);
|
||||||
}
|
}
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
if(mXUL && uniqueItems->AddItem(mXUL)){
|
||||||
|
aSize += sizeof(*mXUL);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if(mAural && uniqueItems->AddItem(mAural)){
|
if(mAural && uniqueItems->AddItem(mAural)){
|
||||||
aSize += sizeof(*mAural);
|
aSize += sizeof(*mAural);
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,6 +97,7 @@ CSS_KEY(bengali, bengali)
|
||||||
CSS_KEY(bidi-override, bidi_override)
|
CSS_KEY(bidi-override, bidi_override)
|
||||||
CSS_KEY(blink, blink)
|
CSS_KEY(blink, blink)
|
||||||
CSS_KEY(block, block)
|
CSS_KEY(block, block)
|
||||||
|
CSS_KEY(block-axis, block_axis)
|
||||||
CSS_KEY(bold, bold)
|
CSS_KEY(bold, bold)
|
||||||
CSS_KEY(bolder, bolder)
|
CSS_KEY(bolder, bolder)
|
||||||
CSS_KEY(border-box, border_box)
|
CSS_KEY(border-box, border_box)
|
||||||
|
|
|
@ -1318,6 +1318,7 @@ PRBool CSSParserImpl::ParseSelectorList(PRInt32& aErrorCode,
|
||||||
REPORT_UNEXPECTED_EOF();
|
REPORT_UNEXPECTED_EOF();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eCSSToken_Symbol == tk->mType) {
|
if (eCSSToken_Symbol == tk->mType) {
|
||||||
if (',' == tk->mSymbol) {
|
if (',' == tk->mSymbol) {
|
||||||
SelectorList* newList = nsnull;
|
SelectorList* newList = nsnull;
|
||||||
|
@ -3187,6 +3188,11 @@ PRBool CSSParserImpl::ParseSingleValueProperty(PRInt32& aErrorCode,
|
||||||
case eCSSProperty_left:
|
case eCSSProperty_left:
|
||||||
case eCSSProperty_right:
|
case eCSSProperty_right:
|
||||||
return ParseVariant(aErrorCode, aValue, VARIANT_AHLP, nsnull);
|
return ParseVariant(aErrorCode, aValue, VARIANT_AHLP, nsnull);
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
case eCSSProperty_box_orient:
|
||||||
|
return ParseVariant(aErrorCode, aValue, VARIANT_HK,
|
||||||
|
nsCSSProps::kBoxOrientKTable);
|
||||||
|
#endif
|
||||||
case eCSSProperty_box_sizing:
|
case eCSSProperty_box_sizing:
|
||||||
return ParseVariant(aErrorCode, aValue, VARIANT_HK,
|
return ParseVariant(aErrorCode, aValue, VARIANT_HK,
|
||||||
nsCSSProps::kBoxSizingKTable);
|
nsCSSProps::kBoxSizingKTable);
|
||||||
|
|
|
@ -76,6 +76,9 @@ public:
|
||||||
static const PRInt32 kBorderColorKTable[];
|
static const PRInt32 kBorderColorKTable[];
|
||||||
static const PRInt32 kBorderStyleKTable[];
|
static const PRInt32 kBorderStyleKTable[];
|
||||||
static const PRInt32 kBorderWidthKTable[];
|
static const PRInt32 kBorderWidthKTable[];
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
static const PRInt32 kBoxOrientKTable[];
|
||||||
|
#endif
|
||||||
static const PRInt32 kBoxSizingKTable[];
|
static const PRInt32 kBoxSizingKTable[];
|
||||||
static const PRInt32 kCaptionSideKTable[];
|
static const PRInt32 kCaptionSideKTable[];
|
||||||
static const PRInt32 kClearKTable[];
|
static const PRInt32 kClearKTable[];
|
||||||
|
|
|
@ -48,7 +48,9 @@ static NS_DEFINE_IID(kCSSPageSID, NS_CSS_PAGE_SID);
|
||||||
static NS_DEFINE_IID(kCSSContentSID, NS_CSS_CONTENT_SID);
|
static NS_DEFINE_IID(kCSSContentSID, NS_CSS_CONTENT_SID);
|
||||||
static NS_DEFINE_IID(kCSSUserInterfaceSID, NS_CSS_USER_INTERFACE_SID);
|
static NS_DEFINE_IID(kCSSUserInterfaceSID, NS_CSS_USER_INTERFACE_SID);
|
||||||
static NS_DEFINE_IID(kCSSAuralSID, NS_CSS_AURAL_SID);
|
static NS_DEFINE_IID(kCSSAuralSID, NS_CSS_AURAL_SID);
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
static NS_DEFINE_IID(kCSSXULSID, NS_CSS_XUL_SID);
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CSS_IF_DELETE(ptr) if (nsnull != ptr) { delete ptr; ptr = nsnull; }
|
#define CSS_IF_DELETE(ptr) if (nsnull != ptr) { delete ptr; ptr = nsnull; }
|
||||||
|
|
||||||
|
@ -973,6 +975,41 @@ void nsCSSAural::List(FILE* out, PRInt32 aIndent) const
|
||||||
fputs(buffer, out);
|
fputs(buffer, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
// --- nsCSSXUL -----------------
|
||||||
|
|
||||||
|
nsCSSXUL::nsCSSXUL(void)
|
||||||
|
{
|
||||||
|
MOZ_COUNT_CTOR(nsCSSXUL);
|
||||||
|
}
|
||||||
|
|
||||||
|
nsCSSXUL::nsCSSXUL(const nsCSSXUL& aCopy)
|
||||||
|
: mBoxOrient(aCopy.mBoxOrient)
|
||||||
|
{
|
||||||
|
MOZ_COUNT_CTOR(nsCSSXUL);
|
||||||
|
}
|
||||||
|
|
||||||
|
nsCSSXUL::~nsCSSXUL(void)
|
||||||
|
{
|
||||||
|
MOZ_COUNT_DTOR(nsCSSXUL);
|
||||||
|
}
|
||||||
|
|
||||||
|
const nsID& nsCSSXUL::GetID(void)
|
||||||
|
{
|
||||||
|
return kCSSXULSID;
|
||||||
|
}
|
||||||
|
|
||||||
|
void nsCSSXUL::List(FILE* out, PRInt32 aIndent) const
|
||||||
|
{
|
||||||
|
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
|
||||||
|
|
||||||
|
nsAutoString buffer;
|
||||||
|
|
||||||
|
mBoxOrient.AppendToString(buffer, eCSSProperty_box_orient);
|
||||||
|
fputs(buffer, out);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // INCLUDE_XUL
|
||||||
|
|
||||||
|
|
||||||
// --- nsCSSDeclaration -----------------
|
// --- nsCSSDeclaration -----------------
|
||||||
|
@ -1042,6 +1079,9 @@ protected:
|
||||||
nsCSSContent* mContent;
|
nsCSSContent* mContent;
|
||||||
nsCSSUserInterface* mUserInterface;
|
nsCSSUserInterface* mUserInterface;
|
||||||
nsCSSAural* mAural;
|
nsCSSAural* mAural;
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
nsCSSXUL* mXUL;
|
||||||
|
#endif
|
||||||
|
|
||||||
CSSDeclarationImpl* mImportant;
|
CSSDeclarationImpl* mImportant;
|
||||||
|
|
||||||
|
@ -1084,6 +1124,9 @@ CSSDeclarationImpl::CSSDeclarationImpl(const CSSDeclarationImpl& aCopy)
|
||||||
DECL_IF_COPY(Content);
|
DECL_IF_COPY(Content);
|
||||||
DECL_IF_COPY(UserInterface);
|
DECL_IF_COPY(UserInterface);
|
||||||
DECL_IF_COPY(Aural);
|
DECL_IF_COPY(Aural);
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
DECL_IF_COPY(XUL);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_REFS
|
#ifdef DEBUG_REFS
|
||||||
++gInstanceCount;
|
++gInstanceCount;
|
||||||
|
@ -1126,6 +1169,9 @@ CSSDeclarationImpl::~CSSDeclarationImpl(void)
|
||||||
CSS_IF_DELETE(mContent);
|
CSS_IF_DELETE(mContent);
|
||||||
CSS_IF_DELETE(mUserInterface);
|
CSS_IF_DELETE(mUserInterface);
|
||||||
CSS_IF_DELETE(mAural);
|
CSS_IF_DELETE(mAural);
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
CSS_IF_DELETE(mXUL);
|
||||||
|
#endif
|
||||||
|
|
||||||
NS_IF_RELEASE(mImportant);
|
NS_IF_RELEASE(mImportant);
|
||||||
CSS_IF_DELETE(mOrder);
|
CSS_IF_DELETE(mOrder);
|
||||||
|
@ -1161,7 +1207,11 @@ CSSDeclarationImpl::GetData(const nsID& aSID, nsCSSStruct** aDataPtr)
|
||||||
CSS_IF_GET_ELSE(aSID, Page, aDataPtr)
|
CSS_IF_GET_ELSE(aSID, Page, aDataPtr)
|
||||||
CSS_IF_GET_ELSE(aSID, Content, aDataPtr)
|
CSS_IF_GET_ELSE(aSID, Content, aDataPtr)
|
||||||
CSS_IF_GET_ELSE(aSID, UserInterface, aDataPtr)
|
CSS_IF_GET_ELSE(aSID, UserInterface, aDataPtr)
|
||||||
CSS_IF_GET_ELSE(aSID, Aural, aDataPtr) {
|
CSS_IF_GET_ELSE(aSID, Aural, aDataPtr)
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
CSS_IF_GET_ELSE(aSID, XUL, aDataPtr)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
return NS_NOINTERFACE;
|
return NS_NOINTERFACE;
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
@ -1692,6 +1742,18 @@ CSSDeclarationImpl::AppendValue(nsCSSProperty aProperty, const nsCSSValue& aValu
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
// nsCSSXUL
|
||||||
|
case eCSSProperty_box_orient:
|
||||||
|
CSS_ENSURE(XUL) {
|
||||||
|
switch (aProperty) {
|
||||||
|
case eCSSProperty_box_orient: mXUL->mBoxOrient = aValue; break;
|
||||||
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
// nsCSSAural
|
// nsCSSAural
|
||||||
case eCSSProperty_azimuth:
|
case eCSSProperty_azimuth:
|
||||||
case eCSSProperty_elevation:
|
case eCSSProperty_elevation:
|
||||||
|
@ -2427,6 +2489,20 @@ CSSDeclarationImpl::SetValueImportant(nsCSSProperty aProperty)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
// nsCSSXUL
|
||||||
|
case eCSSProperty_box_orient:
|
||||||
|
if (nsnull != mXUL) {
|
||||||
|
CSS_ENSURE_IMPORTANT(XUL) {
|
||||||
|
switch (aProperty) {
|
||||||
|
CSS_CASE_IMPORTANT(eCSSProperty_box_orient, mXUL->mBoxOrient);
|
||||||
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
// nsCSSAural
|
// nsCSSAural
|
||||||
case eCSSProperty_azimuth:
|
case eCSSProperty_azimuth:
|
||||||
case eCSSProperty_elevation:
|
case eCSSProperty_elevation:
|
||||||
|
@ -3101,6 +3177,18 @@ CSSDeclarationImpl::RemoveProperty(nsCSSProperty aProperty)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
// nsCSSXUL
|
||||||
|
case eCSSProperty_box_orient:
|
||||||
|
CSS_CHECK(XUL) {
|
||||||
|
switch(aProperty) {
|
||||||
|
case eCSSProperty_box_orient: mXUL->mBoxOrient.Reset(); break;
|
||||||
|
CSS_BOGUS_DEFAULT; // Make compiler happy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
// nsCSSAural
|
// nsCSSAural
|
||||||
case eCSSProperty_azimuth:
|
case eCSSProperty_azimuth:
|
||||||
case eCSSProperty_elevation:
|
case eCSSProperty_elevation:
|
||||||
|
@ -3828,6 +3916,21 @@ CSSDeclarationImpl::GetValue(nsCSSProperty aProperty, nsCSSValue& aValue)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
// nsCSSXUL
|
||||||
|
case eCSSProperty_box_orient:
|
||||||
|
if (nsnull != mXUL) {
|
||||||
|
switch (aProperty) {
|
||||||
|
case eCSSProperty_box_orient: aValue = mXUL->mBoxOrient; break;
|
||||||
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
aValue.Reset();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
// nsCSSAural
|
// nsCSSAural
|
||||||
case eCSSProperty_azimuth:
|
case eCSSProperty_azimuth:
|
||||||
case eCSSProperty_elevation:
|
case eCSSProperty_elevation:
|
||||||
|
@ -4615,6 +4718,11 @@ void CSSDeclarationImpl::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSiz
|
||||||
if(mUserInterface && uniqueItems->AddItem(mUserInterface)){
|
if(mUserInterface && uniqueItems->AddItem(mUserInterface)){
|
||||||
aSize += sizeof(*mUserInterface);
|
aSize += sizeof(*mUserInterface);
|
||||||
}
|
}
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
if(mXUL && uniqueItems->AddItem(mXUL)){
|
||||||
|
aSize += sizeof(*mXUL);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if(mAural && uniqueItems->AddItem(mAural)){
|
if(mAural && uniqueItems->AddItem(mAural)){
|
||||||
aSize += sizeof(*mAural);
|
aSize += sizeof(*mAural);
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,6 +78,9 @@ static NS_DEFINE_IID(kCSSContentSID, NS_CSS_CONTENT_SID);
|
||||||
static NS_DEFINE_IID(kCSSUserInterfaceSID, NS_CSS_USER_INTERFACE_SID);
|
static NS_DEFINE_IID(kCSSUserInterfaceSID, NS_CSS_USER_INTERFACE_SID);
|
||||||
static NS_DEFINE_IID(kCSSBreaksSID, NS_CSS_BREAKS_SID);
|
static NS_DEFINE_IID(kCSSBreaksSID, NS_CSS_BREAKS_SID);
|
||||||
static NS_DEFINE_IID(kCSSPageSID, NS_CSS_PAGE_SID);
|
static NS_DEFINE_IID(kCSSPageSID, NS_CSS_PAGE_SID);
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
static NS_DEFINE_IID(kCSSXULSID, NS_CSS_XUL_SID);
|
||||||
|
#endif
|
||||||
|
|
||||||
// -- nsCSSSelector -------------------------------
|
// -- nsCSSSelector -------------------------------
|
||||||
|
|
||||||
|
@ -3319,6 +3322,34 @@ MapDeclarationPrintInto(nsICSSDeclaration* aDeclaration,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
static void
|
||||||
|
MapDeclarationXULInto(nsICSSDeclaration* aDeclaration,
|
||||||
|
nsIMutableStyleContext* aContext, nsIStyleContext* aParentContext,
|
||||||
|
nsStyleFont* aFont, nsIPresContext* aPresContext)
|
||||||
|
{
|
||||||
|
nsCSSXUL* ourXUL;
|
||||||
|
if (NS_OK == aDeclaration->GetData(kCSSXULSID, (nsCSSStruct**)&ourXUL)) {
|
||||||
|
if (nsnull != ourXUL) {
|
||||||
|
nsStyleXUL* xul = (nsStyleXUL*)aContext->GetMutableStyleData(eStyleStruct_XUL);
|
||||||
|
|
||||||
|
const nsStyleXUL* parentXUL = xul;
|
||||||
|
if (nsnull != aParentContext) {
|
||||||
|
parentXUL = (const nsStyleXUL*)aParentContext->GetStyleData(eStyleStruct_XUL);
|
||||||
|
}
|
||||||
|
|
||||||
|
// box-orient: enum, inherit
|
||||||
|
if (eCSSUnit_Enumerated == ourXUL->mBoxOrient.GetUnit()) {
|
||||||
|
xul->mBoxOrient = ourXUL->mBoxOrient.GetIntValue();
|
||||||
|
}
|
||||||
|
else if (eCSSUnit_Inherit == ourXUL->mBoxOrient.GetUnit()) {
|
||||||
|
xul->mBoxOrient = parentXUL->mBoxOrient;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // INCLUDE_XUL
|
||||||
|
|
||||||
void MapDeclarationInto(nsICSSDeclaration* aDeclaration,
|
void MapDeclarationInto(nsICSSDeclaration* aDeclaration,
|
||||||
nsIMutableStyleContext* aContext, nsIPresContext* aPresContext)
|
nsIMutableStyleContext* aContext, nsIPresContext* aPresContext)
|
||||||
{
|
{
|
||||||
|
@ -3336,6 +3367,9 @@ void MapDeclarationInto(nsICSSDeclaration* aDeclaration,
|
||||||
MapDeclarationContentInto(aDeclaration, aContext, parentContext, font, aPresContext);
|
MapDeclarationContentInto(aDeclaration, aContext, parentContext, font, aPresContext);
|
||||||
MapDeclarationUIInto(aDeclaration, aContext, parentContext, font, aPresContext);
|
MapDeclarationUIInto(aDeclaration, aContext, parentContext, font, aPresContext);
|
||||||
MapDeclarationPrintInto(aDeclaration, aContext, parentContext, font, aPresContext);
|
MapDeclarationPrintInto(aDeclaration, aContext, parentContext, font, aPresContext);
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
MapDeclarationXULInto(aDeclaration, aContext, parentContext, font, aPresContext);
|
||||||
|
#endif
|
||||||
|
|
||||||
NS_IF_RELEASE(parentContext);
|
NS_IF_RELEASE(parentContext);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1734,6 +1734,63 @@ PRUint32 StylePrintImpl::ComputeCRC32(PRUint32 aCrc) const
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
// --------------------
|
||||||
|
// nsStyleXUL
|
||||||
|
//
|
||||||
|
nsStyleXUL::nsStyleXUL() { }
|
||||||
|
nsStyleXUL::~nsStyleXUL() { }
|
||||||
|
|
||||||
|
struct StyleXULImpl: public nsStyleXUL {
|
||||||
|
StyleXULImpl() { }
|
||||||
|
|
||||||
|
void ResetFrom(const nsStyleXUL* aParent, nsIPresContext* aPresContext);
|
||||||
|
void SetFrom(const nsStyleXUL& aSource);
|
||||||
|
void CopyTo(nsStyleXUL& aDest) const;
|
||||||
|
PRInt32 CalcDifference(const StyleXULImpl& aOther) const;
|
||||||
|
PRUint32 ComputeCRC32(PRUint32 aCrc) const;
|
||||||
|
|
||||||
|
private: // These are not allowed
|
||||||
|
StyleXULImpl(const StyleXULImpl& aOther);
|
||||||
|
StyleXULImpl& operator=(const StyleXULImpl& aOther);
|
||||||
|
};
|
||||||
|
|
||||||
|
void StyleXULImpl::ResetFrom(const nsStyleXUL* aParent, nsIPresContext* aPresContext)
|
||||||
|
{
|
||||||
|
mBoxOrient = NS_STYLE_BOX_ORIENT_HORIZONTAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void StyleXULImpl::SetFrom(const nsStyleXUL& aSource)
|
||||||
|
{
|
||||||
|
nsCRT::memcpy((nsStyleXUL*)this, &aSource, sizeof(nsStyleXUL));
|
||||||
|
}
|
||||||
|
|
||||||
|
void StyleXULImpl::CopyTo(nsStyleXUL& aDest) const
|
||||||
|
{
|
||||||
|
nsCRT::memcpy(&aDest, (const nsStyleXUL*)this, sizeof(nsStyleXUL));
|
||||||
|
}
|
||||||
|
|
||||||
|
PRInt32 StyleXULImpl::CalcDifference(const StyleXULImpl& aOther) const
|
||||||
|
{
|
||||||
|
if (mBoxOrient == aOther.mBoxOrient)
|
||||||
|
return NS_STYLE_HINT_NONE;
|
||||||
|
return NS_STYLE_HINT_REFLOW;
|
||||||
|
}
|
||||||
|
|
||||||
|
PRUint32 StyleXULImpl::ComputeCRC32(PRUint32 aCrc) const
|
||||||
|
{
|
||||||
|
PRUint32 crc = aCrc;
|
||||||
|
#ifdef COMPUTE_STYLEDATA_CRC
|
||||||
|
crc = AccumulateCRC(crc,(const char *)&mBoxOrient,sizeof(mBoxOrient));
|
||||||
|
#endif
|
||||||
|
return crc;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef XP_MAC
|
||||||
|
#pragma mark -
|
||||||
|
#endif
|
||||||
|
#endif // INCLUDE_XUL
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
#ifdef SHARE_STYLECONTEXTS
|
#ifdef SHARE_STYLECONTEXTS
|
||||||
|
@ -1945,6 +2002,22 @@ void StyleOutlineImplLog::ResetFrom(const nsStyleOutline* aParent, nsIPresContex
|
||||||
mSetFromParent = (aParent != nsnull);
|
mSetFromParent = (aParent != nsnull);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
// StyleXULImpl mXUL;
|
||||||
|
struct StyleXULImplLog: public StyleXULImpl {
|
||||||
|
void ResetFrom(const nsStyleXUL* aParent, nsIPresContext* aPresContext);
|
||||||
|
StyleXULImpl mInternalXUL;
|
||||||
|
bool mSetFromParent;
|
||||||
|
};
|
||||||
|
|
||||||
|
void StyleXULImplLog::ResetFrom(const nsStyleXUL* aParent, nsIPresContext* aPresContext)
|
||||||
|
{
|
||||||
|
StyleXULImpl::ResetFrom(aParent, aPresContext);
|
||||||
|
CopyTo(mInternalXUL);
|
||||||
|
mSetFromParent = (aParent != nsnull);
|
||||||
|
}
|
||||||
|
#endif // INCLUDE_XUL
|
||||||
|
|
||||||
#ifdef XP_MAC
|
#ifdef XP_MAC
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
#endif
|
#endif
|
||||||
|
@ -1996,6 +2069,9 @@ private: // all data and methods private: only friends have access
|
||||||
StylePaddingImplLog mPadding;
|
StylePaddingImplLog mPadding;
|
||||||
StyleBorderImplLog mBorder;
|
StyleBorderImplLog mBorder;
|
||||||
StyleOutlineImplLog mOutline;
|
StyleOutlineImplLog mOutline;
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
StyleXULImplLog mXUL;
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
StyleFontImpl mFont;
|
StyleFontImpl mFont;
|
||||||
StyleColorImpl mColor;
|
StyleColorImpl mColor;
|
||||||
|
@ -2011,6 +2087,9 @@ private: // all data and methods private: only friends have access
|
||||||
StylePaddingImpl mPadding;
|
StylePaddingImpl mPadding;
|
||||||
StyleBorderImpl mBorder;
|
StyleBorderImpl mBorder;
|
||||||
StyleOutlineImpl mOutline;
|
StyleOutlineImpl mOutline;
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
StyleXULImpl mXUL;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
PRUint32 mRefCnt;
|
PRUint32 mRefCnt;
|
||||||
|
@ -2145,6 +2224,9 @@ static void LogStyleStructs(nsStyleContextData* aStyleContextData)
|
||||||
case eStyleStruct_Padding: printf("eStyleStruct_Padding "); sizeOfStruct = sizeof(StylePaddingImpl); break;
|
case eStyleStruct_Padding: printf("eStyleStruct_Padding "); sizeOfStruct = sizeof(StylePaddingImpl); break;
|
||||||
case eStyleStruct_Border: printf("eStyleStruct_Border "); sizeOfStruct = sizeof(StyleBorderImpl); break;
|
case eStyleStruct_Border: printf("eStyleStruct_Border "); sizeOfStruct = sizeof(StyleBorderImpl); break;
|
||||||
case eStyleStruct_Outline: printf("eStyleStruct_Outline "); sizeOfStruct = sizeof(StyleOutlineImpl); break;
|
case eStyleStruct_Outline: printf("eStyleStruct_Outline "); sizeOfStruct = sizeof(StyleOutlineImpl); break;
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
case eStyleStruct_XUL: printf("eStyleStruct_XUL "); sizeOfStruct = sizeof(StyleXULImpl); break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
short percentDefault = (totalCount == 0 ? 0 : ((100 * defaultStruct[i]) / totalCount));
|
short percentDefault = (totalCount == 0 ? 0 : ((100 * defaultStruct[i]) / totalCount));
|
||||||
short percentFromParent = (defaultStruct[i] == 0 ? 0 : ((100 * setFromParent[i]) / defaultStruct[i]));
|
short percentFromParent = (defaultStruct[i] == 0 ? 0 : ((100 * setFromParent[i]) / defaultStruct[i]));
|
||||||
|
@ -2284,6 +2366,15 @@ static void LogStyleStructs(nsStyleContextData* aStyleContextData)
|
||||||
setFromParent[i]++;
|
setFromParent[i]++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
case eStyleStruct_XUL:
|
||||||
|
if (aStyleContextData->mXUL.CalcDifference(aStyleContextData->mXUL.mInternalXUL) == NS_STYLE_HINT_NONE) {
|
||||||
|
defaultStruct[i]++;
|
||||||
|
if (aStyleContextData->mXUL.mSetFromParent)
|
||||||
|
setFromParent[i]++;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2330,6 +2421,9 @@ PRUint32 nsStyleContextData::ComputeCRC32(PRUint32 aCrc) const
|
||||||
crc = mPadding.ComputeCRC32(crc);
|
crc = mPadding.ComputeCRC32(crc);
|
||||||
crc = mBorder.ComputeCRC32(crc);
|
crc = mBorder.ComputeCRC32(crc);
|
||||||
crc = mOutline.ComputeCRC32(crc);
|
crc = mOutline.ComputeCRC32(crc);
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
crc = mXUL.ComputeCRC32(crc);
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
crc = 0;
|
crc = 0;
|
||||||
#endif
|
#endif
|
||||||
|
@ -2467,6 +2561,9 @@ protected:
|
||||||
StylePaddingImpl mPadding;
|
StylePaddingImpl mPadding;
|
||||||
StyleBorderImpl mBorder;
|
StyleBorderImpl mBorder;
|
||||||
StyleOutlineImpl mOutline;
|
StyleOutlineImpl mOutline;
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
StyleXULImpl mXUL;
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // #ifdef SHARE_STYLECONTEXTS
|
#endif // #ifdef SHARE_STYLECONTEXTS
|
||||||
|
|
||||||
|
@ -2512,6 +2609,9 @@ StyleContextImpl::StyleContextImpl(nsIStyleContext* aParent,
|
||||||
mTable(),
|
mTable(),
|
||||||
mContent(),
|
mContent(),
|
||||||
mUserInterface(),
|
mUserInterface(),
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
mXUL(),
|
||||||
|
#endif
|
||||||
mPrint()
|
mPrint()
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
@ -2900,6 +3000,9 @@ static void LogGetStyleDataCall(nsStyleStructID aSID, LogCallType aLogCallType,
|
||||||
case eStyleStruct_Border: printf("eStyleStruct_Border "); break;
|
case eStyleStruct_Border: printf("eStyleStruct_Border "); break;
|
||||||
case eStyleStruct_Outline: printf("eStyleStruct_Outline "); break;
|
case eStyleStruct_Outline: printf("eStyleStruct_Outline "); break;
|
||||||
case eStyleStruct_BorderPaddingShortcut: printf("BorderPaddingShortcut "); break;
|
case eStyleStruct_BorderPaddingShortcut: printf("BorderPaddingShortcut "); break;
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
case eStyleStruct_XUL: printf("eStyleStruct_XUL "); break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
short percent = 100*calls[i]/totalCalls;
|
short percent = 100*calls[i]/totalCalls;
|
||||||
short avdepth = calls[i] == 0 ? 0 : round(float(depth[i])/float(calls[i]));
|
short avdepth = calls[i] == 0 ? 0 : round(float(depth[i])/float(calls[i]));
|
||||||
|
@ -3028,6 +3131,11 @@ const nsStyleStruct* StyleContextImpl::GetStyleData(nsStyleStructID aSID)
|
||||||
case eStyleStruct_Outline:
|
case eStyleStruct_Outline:
|
||||||
result = & GETSCDATA(Outline);
|
result = & GETSCDATA(Outline);
|
||||||
break;
|
break;
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
case eStyleStruct_XUL:
|
||||||
|
result = & GETSCDATA(XUL);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
NS_ERROR("Invalid style struct id");
|
NS_ERROR("Invalid style struct id");
|
||||||
break;
|
break;
|
||||||
|
@ -3090,6 +3198,11 @@ nsStyleStruct* StyleContextImpl::GetMutableStyleData(nsStyleStructID aSID)
|
||||||
case eStyleStruct_Outline:
|
case eStyleStruct_Outline:
|
||||||
result = & GETSCDATA(Outline);
|
result = & GETSCDATA(Outline);
|
||||||
break;
|
break;
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
case eStyleStruct_XUL:
|
||||||
|
result = & GETSCDATA(XUL);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
NS_ERROR("Invalid style struct id");
|
NS_ERROR("Invalid style struct id");
|
||||||
break;
|
break;
|
||||||
|
@ -3170,6 +3283,11 @@ StyleContextImpl::GetStyle(nsStyleStructID aSID, nsStyleStruct& aStruct) const
|
||||||
case eStyleStruct_Outline:
|
case eStyleStruct_Outline:
|
||||||
GETSCDATA(Outline).CopyTo((nsStyleOutline&)aStruct);
|
GETSCDATA(Outline).CopyTo((nsStyleOutline&)aStruct);
|
||||||
break;
|
break;
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
case eStyleStruct_XUL:
|
||||||
|
GETSCDATA(XUL).CopyTo((nsStyleXUL&)aStruct);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
case eStyleStruct_BorderPaddingShortcut: {
|
case eStyleStruct_BorderPaddingShortcut: {
|
||||||
nsMargin border, padding;
|
nsMargin border, padding;
|
||||||
if (GETSCDATA(Border).GetBorder(border)) {
|
if (GETSCDATA(Border).GetBorder(border)) {
|
||||||
|
@ -3239,6 +3357,11 @@ StyleContextImpl::SetStyle(nsStyleStructID aSID, const nsStyleStruct& aStruct)
|
||||||
case eStyleStruct_Outline:
|
case eStyleStruct_Outline:
|
||||||
GETSCDATA(Outline).SetFrom((const nsStyleOutline&)aStruct);
|
GETSCDATA(Outline).SetFrom((const nsStyleOutline&)aStruct);
|
||||||
break;
|
break;
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
case eStyleStruct_XUL:
|
||||||
|
GETSCDATA(XUL).SetFrom((const nsStyleXUL&)aStruct);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
NS_ERROR("Invalid style struct id");
|
NS_ERROR("Invalid style struct id");
|
||||||
result = NS_ERROR_INVALID_ARG;
|
result = NS_ERROR_INVALID_ARG;
|
||||||
|
@ -3299,6 +3422,9 @@ StyleContextImpl::RemapStyle(nsIPresContext* aPresContext, PRBool aRecurse)
|
||||||
GETSCDATA(Padding).ResetFrom(&(mParent->GETSCDATA(Padding)), aPresContext);
|
GETSCDATA(Padding).ResetFrom(&(mParent->GETSCDATA(Padding)), aPresContext);
|
||||||
GETSCDATA(Border).ResetFrom(&(mParent->GETSCDATA(Border)), aPresContext);
|
GETSCDATA(Border).ResetFrom(&(mParent->GETSCDATA(Border)), aPresContext);
|
||||||
GETSCDATA(Outline).ResetFrom(&(mParent->GETSCDATA(Outline)), aPresContext);
|
GETSCDATA(Outline).ResetFrom(&(mParent->GETSCDATA(Outline)), aPresContext);
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
GETSCDATA(XUL).ResetFrom(&(mParent->GETSCDATA(XUL)), aPresContext);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
GETSCDATA(Font).ResetFrom(nsnull, aPresContext);
|
GETSCDATA(Font).ResetFrom(nsnull, aPresContext);
|
||||||
|
@ -3315,6 +3441,9 @@ StyleContextImpl::RemapStyle(nsIPresContext* aPresContext, PRBool aRecurse)
|
||||||
GETSCDATA(Padding).ResetFrom(nsnull, aPresContext);
|
GETSCDATA(Padding).ResetFrom(nsnull, aPresContext);
|
||||||
GETSCDATA(Border).ResetFrom(nsnull, aPresContext);
|
GETSCDATA(Border).ResetFrom(nsnull, aPresContext);
|
||||||
GETSCDATA(Outline).ResetFrom(nsnull, aPresContext);
|
GETSCDATA(Outline).ResetFrom(nsnull, aPresContext);
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
GETSCDATA(XUL).ResetFrom(nsnull, aPresContext);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
PRUint32 cnt = 0;
|
PRUint32 cnt = 0;
|
||||||
|
@ -3396,6 +3525,9 @@ StyleContextImpl::RemapStyle(nsIPresContext* aPresContext, PRBool aRecurse)
|
||||||
GETSCDATA(Padding).ResetFrom(nsnull, aPresContext);
|
GETSCDATA(Padding).ResetFrom(nsnull, aPresContext);
|
||||||
GETSCDATA(Border).ResetFrom(nsnull, aPresContext);
|
GETSCDATA(Border).ResetFrom(nsnull, aPresContext);
|
||||||
GETSCDATA(Outline).ResetFrom(nsnull, aPresContext);
|
GETSCDATA(Outline).ResetFrom(nsnull, aPresContext);
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
GETSCDATA(XUL).ResetFrom(nsnull, aPresContext);
|
||||||
|
#endif
|
||||||
GETSCDATA(Display).mVisible = visible;
|
GETSCDATA(Display).mVisible = visible;
|
||||||
GETSCDATA(Display).mDirection = direction;
|
GETSCDATA(Display).mDirection = direction;
|
||||||
GETSCDATA(Display).mLanguage = language;
|
GETSCDATA(Display).mLanguage = language;
|
||||||
|
@ -3589,6 +3721,15 @@ StyleContextImpl::CalcStyleDifference(nsIStyleContext* aOther, PRInt32& aHint,PR
|
||||||
aHint = hint;
|
aHint = hint;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
if (aStopAtFirstDifference && aHint > NS_STYLE_HINT_NONE) return NS_OK;
|
||||||
|
if (aHint < NS_STYLE_HINT_MAX) {
|
||||||
|
hint = GETSCDATA(XUL).CalcDifference(other->GETSCDATA(XUL));
|
||||||
|
if (aHint < hint) {
|
||||||
|
aHint = hint;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
@ -3897,6 +4038,10 @@ void StyleContextImpl::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize)
|
||||||
totalSize += (long)sizeof(GETSCDATA(Border));
|
totalSize += (long)sizeof(GETSCDATA(Border));
|
||||||
printf( " - StyleOutlineImpl: %ld\n", (long)sizeof(GETSCDATA(Outline)));
|
printf( " - StyleOutlineImpl: %ld\n", (long)sizeof(GETSCDATA(Outline)));
|
||||||
totalSize += (long)sizeof(GETSCDATA(Outline));
|
totalSize += (long)sizeof(GETSCDATA(Outline));
|
||||||
|
#ifdef INCLUDE_XUL
|
||||||
|
printf( " - StyleXULImpl: %ld\n", (long)sizeof(GETSCDATA(XUL)));
|
||||||
|
totalSize += (long)sizeof(GETSCDATA(XUL));
|
||||||
|
#endif
|
||||||
printf( " - Total: %ld\n", (long)totalSize);
|
printf( " - Total: %ld\n", (long)totalSize);
|
||||||
printf( "*************************************\n");
|
printf( "*************************************\n");
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче