2001-09-25 05:32:19 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
1998-04-14 00:24:54 +04:00
|
|
|
*
|
2001-09-25 05:32:19 +04:00
|
|
|
* 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/
|
1998-04-14 00:24:54 +04:00
|
|
|
*
|
2001-09-25 05:32:19 +04:00
|
|
|
* 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.
|
1998-04-14 00:24:54 +04:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2001-09-25 05:32:19 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
1999-11-06 06:40:37 +03:00
|
|
|
*
|
2001-09-25 05:32:19 +04:00
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the NPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the NPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
2001-08-14 11:59:59 +04:00
|
|
|
#include "nscore.h"
|
1998-04-14 00:24:54 +04:00
|
|
|
#include "nsICSSDeclaration.h"
|
|
|
|
#include "nsString.h"
|
2001-10-26 06:38:29 +04:00
|
|
|
#include "nsUnicharUtils.h"
|
1998-04-14 00:24:54 +04:00
|
|
|
#include "nsCRT.h"
|
|
|
|
#include "nsCSSProps.h"
|
|
|
|
#include "nsUnitConversion.h"
|
1998-07-17 09:50:35 +04:00
|
|
|
#include "nsVoidArray.h"
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1998-07-15 02:34:27 +04:00
|
|
|
#include "nsStyleConsts.h"
|
|
|
|
|
2000-03-31 11:08:36 +04:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsIStyleSet.h"
|
|
|
|
#include "nsISizeOfHandler.h"
|
|
|
|
|
|
|
|
// #define DEBUG_REFS
|
1998-04-22 10:38:31 +04:00
|
|
|
|
1998-07-18 03:00:54 +04:00
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
static NS_DEFINE_IID(kCSSFontSID, NS_CSS_FONT_SID);
|
|
|
|
static NS_DEFINE_IID(kCSSColorSID, NS_CSS_COLOR_SID);
|
1998-04-25 22:43:42 +04:00
|
|
|
static NS_DEFINE_IID(kCSSDisplaySID, NS_CSS_DISPLAY_SID);
|
1998-04-14 00:24:54 +04:00
|
|
|
static NS_DEFINE_IID(kCSSTextSID, NS_CSS_TEXT_SID);
|
|
|
|
static NS_DEFINE_IID(kCSSMarginSID, NS_CSS_MARGIN_SID);
|
|
|
|
static NS_DEFINE_IID(kCSSPositionSID, NS_CSS_POSITION_SID);
|
|
|
|
static NS_DEFINE_IID(kCSSListSID, NS_CSS_LIST_SID);
|
1998-10-08 05:31:58 +04:00
|
|
|
static NS_DEFINE_IID(kCSSTableSID, NS_CSS_TABLE_SID);
|
|
|
|
static NS_DEFINE_IID(kCSSBreaksSID, NS_CSS_BREAKS_SID);
|
|
|
|
static NS_DEFINE_IID(kCSSPageSID, NS_CSS_PAGE_SID);
|
|
|
|
static NS_DEFINE_IID(kCSSContentSID, NS_CSS_CONTENT_SID);
|
1999-07-24 23:04:42 +04:00
|
|
|
static NS_DEFINE_IID(kCSSUserInterfaceSID, NS_CSS_USER_INTERFACE_SID);
|
1998-10-08 05:31:58 +04:00
|
|
|
static NS_DEFINE_IID(kCSSAuralSID, NS_CSS_AURAL_SID);
|
2001-03-06 05:30:30 +03:00
|
|
|
#ifdef INCLUDE_XUL
|
|
|
|
static NS_DEFINE_IID(kCSSXULSID, NS_CSS_XUL_SID);
|
|
|
|
#endif
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1998-10-27 02:22:40 +03:00
|
|
|
#define CSS_IF_DELETE(ptr) if (nsnull != ptr) { delete ptr; ptr = nsnull; }
|
|
|
|
|
1999-02-12 20:45:58 +03:00
|
|
|
nsCSSStruct::~nsCSSStruct()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
// --- nsCSSFont -----------------
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1999-06-03 05:58:11 +04:00
|
|
|
nsCSSFont::nsCSSFont(void)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSFont);
|
1999-06-03 05:58:11 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
nsCSSFont::nsCSSFont(const nsCSSFont& aCopy)
|
|
|
|
: mFamily(aCopy.mFamily),
|
|
|
|
mStyle(aCopy.mStyle),
|
|
|
|
mVariant(aCopy.mVariant),
|
|
|
|
mWeight(aCopy.mWeight),
|
|
|
|
mSize(aCopy.mSize),
|
|
|
|
mSizeAdjust(aCopy.mSizeAdjust),
|
|
|
|
mStretch(aCopy.mStretch)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSFont);
|
1999-06-03 05:58:11 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
nsCSSFont::~nsCSSFont(void)
|
1999-02-12 20:45:58 +03:00
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_DTOR(nsCSSFont);
|
1999-02-12 20:45:58 +03:00
|
|
|
}
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
const nsID& nsCSSFont::GetID(void)
|
|
|
|
{
|
|
|
|
return kCSSFontSID;
|
|
|
|
}
|
|
|
|
|
|
|
|
void nsCSSFont::List(FILE* out, PRInt32 aIndent) const
|
|
|
|
{
|
|
|
|
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
|
|
|
|
|
|
|
|
nsAutoString buffer;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
mFamily.AppendToString(buffer, eCSSProperty_font_family);
|
|
|
|
mStyle.AppendToString(buffer, eCSSProperty_font_style);
|
|
|
|
mVariant.AppendToString(buffer, eCSSProperty_font_variant);
|
|
|
|
mWeight.AppendToString(buffer, eCSSProperty_font_weight);
|
|
|
|
mSize.AppendToString(buffer, eCSSProperty_font_size);
|
|
|
|
mSizeAdjust.AppendToString(buffer, eCSSProperty_font_size_adjust);
|
|
|
|
mStretch.AppendToString(buffer, eCSSProperty_font_stretch);
|
2001-10-16 07:53:44 +04:00
|
|
|
fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out);
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
|
1998-10-27 02:22:40 +03:00
|
|
|
// --- support -----------------
|
|
|
|
|
1999-06-03 05:58:11 +04:00
|
|
|
#define CSS_IF_COPY(val, type) \
|
1999-06-15 01:16:05 +04:00
|
|
|
if (aCopy.val) (val) = new type(*(aCopy.val));
|
1999-06-03 05:58:11 +04:00
|
|
|
|
1998-10-27 02:22:40 +03:00
|
|
|
nsCSSValueList::nsCSSValueList(void)
|
|
|
|
: mValue(),
|
|
|
|
mNext(nsnull)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSValueList);
|
1998-10-27 02:22:40 +03:00
|
|
|
}
|
|
|
|
|
1999-06-03 05:58:11 +04:00
|
|
|
nsCSSValueList::nsCSSValueList(const nsCSSValueList& aCopy)
|
|
|
|
: mValue(aCopy.mValue),
|
|
|
|
mNext(nsnull)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSValueList);
|
1999-06-03 05:58:11 +04:00
|
|
|
CSS_IF_COPY(mNext, nsCSSValueList);
|
|
|
|
}
|
|
|
|
|
1998-10-27 02:22:40 +03:00
|
|
|
nsCSSValueList::~nsCSSValueList(void)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_DTOR(nsCSSValueList);
|
1998-10-27 02:22:40 +03:00
|
|
|
CSS_IF_DELETE(mNext);
|
|
|
|
}
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
// --- nsCSSColor -----------------
|
|
|
|
|
1998-10-27 02:22:40 +03:00
|
|
|
nsCSSColor::nsCSSColor(void)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSColor);
|
1998-10-27 02:22:40 +03:00
|
|
|
}
|
|
|
|
|
1999-06-03 05:58:11 +04:00
|
|
|
nsCSSColor::nsCSSColor(const nsCSSColor& aCopy)
|
|
|
|
: mColor(aCopy.mColor),
|
|
|
|
mBackColor(aCopy.mBackColor),
|
|
|
|
mBackImage(aCopy.mBackImage),
|
|
|
|
mBackRepeat(aCopy.mBackRepeat),
|
|
|
|
mBackAttachment(aCopy.mBackAttachment),
|
|
|
|
mBackPositionX(aCopy.mBackPositionX),
|
2001-06-01 02:19:43 +04:00
|
|
|
mBackPositionY(aCopy.mBackPositionY)
|
1999-06-03 05:58:11 +04:00
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSColor);
|
1999-06-03 05:58:11 +04:00
|
|
|
}
|
|
|
|
|
1998-10-27 02:22:40 +03:00
|
|
|
nsCSSColor::~nsCSSColor(void)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_DTOR(nsCSSColor);
|
1998-10-27 02:22:40 +03:00
|
|
|
}
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
const nsID& nsCSSColor::GetID(void)
|
|
|
|
{
|
|
|
|
return kCSSColorSID;
|
|
|
|
}
|
|
|
|
|
|
|
|
void nsCSSColor::List(FILE* out, PRInt32 aIndent) const
|
|
|
|
{
|
|
|
|
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
|
|
|
|
|
|
|
|
nsAutoString buffer;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
mColor.AppendToString(buffer, eCSSProperty_color);
|
|
|
|
mBackColor.AppendToString(buffer, eCSSProperty_background_color);
|
|
|
|
mBackImage.AppendToString(buffer, eCSSProperty_background_image);
|
|
|
|
mBackRepeat.AppendToString(buffer, eCSSProperty_background_repeat);
|
|
|
|
mBackAttachment.AppendToString(buffer, eCSSProperty_background_attachment);
|
|
|
|
mBackPositionX.AppendToString(buffer, eCSSProperty_background_x_position);
|
|
|
|
mBackPositionY.AppendToString(buffer, eCSSProperty_background_y_position);
|
2001-10-16 07:53:44 +04:00
|
|
|
fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out);
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
|
1998-10-27 02:22:40 +03:00
|
|
|
// --- nsCSSText support -----------------
|
1998-10-08 05:31:58 +04:00
|
|
|
|
|
|
|
nsCSSShadow::nsCSSShadow(void)
|
|
|
|
: mNext(nsnull)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSShadow);
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
|
1999-06-03 05:58:11 +04:00
|
|
|
nsCSSShadow::nsCSSShadow(const nsCSSShadow& aCopy)
|
|
|
|
: mColor(aCopy.mColor),
|
|
|
|
mXOffset(aCopy.mXOffset),
|
|
|
|
mYOffset(aCopy.mYOffset),
|
|
|
|
mRadius(aCopy.mRadius),
|
|
|
|
mNext(nsnull)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSShadow);
|
1999-06-03 05:58:11 +04:00
|
|
|
CSS_IF_COPY(mNext, nsCSSShadow);
|
|
|
|
}
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
nsCSSShadow::~nsCSSShadow(void)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_DTOR(nsCSSShadow);
|
1998-10-27 02:22:40 +03:00
|
|
|
CSS_IF_DELETE(mNext);
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// --- nsCSSText -----------------
|
|
|
|
|
|
|
|
nsCSSText::nsCSSText(void)
|
|
|
|
: mTextShadow(nsnull)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSText);
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
|
1999-06-03 05:58:11 +04:00
|
|
|
nsCSSText::nsCSSText(const nsCSSText& aCopy)
|
|
|
|
: mWordSpacing(aCopy.mWordSpacing),
|
|
|
|
mLetterSpacing(aCopy.mLetterSpacing),
|
|
|
|
mVerticalAlign(aCopy.mVerticalAlign),
|
|
|
|
mTextTransform(aCopy.mTextTransform),
|
|
|
|
mTextAlign(aCopy.mTextAlign),
|
|
|
|
mTextIndent(aCopy.mTextIndent),
|
2001-10-25 07:21:53 +04:00
|
|
|
mDecoration(aCopy.mDecoration),
|
1999-06-03 05:58:11 +04:00
|
|
|
mTextShadow(nsnull),
|
|
|
|
mUnicodeBidi(aCopy.mUnicodeBidi),
|
|
|
|
mLineHeight(aCopy.mLineHeight),
|
|
|
|
mWhiteSpace(aCopy.mWhiteSpace)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSText);
|
1999-06-03 05:58:11 +04:00
|
|
|
}
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
nsCSSText::~nsCSSText(void)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_DTOR(nsCSSText);
|
1998-10-27 02:22:40 +03:00
|
|
|
CSS_IF_DELETE(mTextShadow);
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
const nsID& nsCSSText::GetID(void)
|
|
|
|
{
|
|
|
|
return kCSSTextSID;
|
|
|
|
}
|
|
|
|
|
|
|
|
void nsCSSText::List(FILE* out, PRInt32 aIndent) const
|
|
|
|
{
|
|
|
|
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
|
|
|
|
|
|
|
|
nsAutoString buffer;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
mWordSpacing.AppendToString(buffer, eCSSProperty_word_spacing);
|
|
|
|
mLetterSpacing.AppendToString(buffer, eCSSProperty_letter_spacing);
|
|
|
|
mDecoration.AppendToString(buffer, eCSSProperty_text_decoration);
|
|
|
|
mVerticalAlign.AppendToString(buffer, eCSSProperty_vertical_align);
|
|
|
|
mTextTransform.AppendToString(buffer, eCSSProperty_text_transform);
|
|
|
|
mTextAlign.AppendToString(buffer, eCSSProperty_text_align);
|
|
|
|
mTextIndent.AppendToString(buffer, eCSSProperty_text_indent);
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mTextShadow) {
|
1998-10-27 02:22:40 +03:00
|
|
|
if (mTextShadow->mXOffset.IsLengthUnit()) {
|
1998-10-08 05:31:58 +04:00
|
|
|
nsCSSShadow* shadow = mTextShadow;
|
|
|
|
while (nsnull != shadow) {
|
1999-07-18 04:25:28 +04:00
|
|
|
shadow->mColor.AppendToString(buffer, eCSSProperty_text_shadow_color);
|
|
|
|
shadow->mXOffset.AppendToString(buffer, eCSSProperty_text_shadow_x);
|
|
|
|
shadow->mYOffset.AppendToString(buffer, eCSSProperty_text_shadow_y);
|
|
|
|
shadow->mRadius.AppendToString(buffer, eCSSProperty_text_shadow_radius);
|
1998-10-08 05:31:58 +04:00
|
|
|
shadow = shadow->mNext;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
1999-07-18 04:25:28 +04:00
|
|
|
mTextShadow->mXOffset.AppendToString(buffer, eCSSProperty_text_shadow);
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
}
|
1999-07-18 04:25:28 +04:00
|
|
|
mUnicodeBidi.AppendToString(buffer, eCSSProperty_unicode_bidi);
|
|
|
|
mLineHeight.AppendToString(buffer, eCSSProperty_line_height);
|
|
|
|
mWhiteSpace.AppendToString(buffer, eCSSProperty_white_space);
|
2001-10-16 07:53:44 +04:00
|
|
|
fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out);
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
// --- nsCSSRect -----------------
|
|
|
|
|
1999-06-03 05:58:11 +04:00
|
|
|
nsCSSRect::nsCSSRect(void)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSRect);
|
1999-06-03 05:58:11 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
nsCSSRect::nsCSSRect(const nsCSSRect& aCopy)
|
|
|
|
: mTop(aCopy.mTop),
|
|
|
|
mRight(aCopy.mRight),
|
|
|
|
mBottom(aCopy.mBottom),
|
|
|
|
mLeft(aCopy.mLeft)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSRect);
|
1999-06-03 05:58:11 +04:00
|
|
|
}
|
|
|
|
|
2000-05-04 01:21:30 +04:00
|
|
|
nsCSSRect::~nsCSSRect()
|
|
|
|
{
|
|
|
|
MOZ_COUNT_DTOR(nsCSSRect);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
void nsCSSRect::List(FILE* out, nsCSSProperty aPropID, PRInt32 aIndent) const
|
1998-05-27 03:16:55 +04:00
|
|
|
{
|
|
|
|
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
|
|
|
|
|
|
|
|
nsAutoString buffer;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
if (eCSSProperty_UNKNOWN < aPropID) {
|
2001-10-27 10:44:19 +04:00
|
|
|
buffer.AppendWithConversion(nsCSSProps::GetStringValue(aPropID).get());
|
2000-04-16 00:15:37 +04:00
|
|
|
buffer.AppendWithConversion(": ");
|
1998-05-27 03:16:55 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
mTop.AppendToString(buffer);
|
|
|
|
mRight.AppendToString(buffer);
|
|
|
|
mBottom.AppendToString(buffer);
|
|
|
|
mLeft.AppendToString(buffer);
|
2001-10-16 07:53:44 +04:00
|
|
|
fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out);
|
1998-05-27 03:16:55 +04:00
|
|
|
}
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
void nsCSSRect::List(FILE* out, PRInt32 aIndent, const nsCSSProperty aTRBL[]) const
|
1998-09-23 06:34:21 +04:00
|
|
|
{
|
|
|
|
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
|
|
|
|
|
|
|
|
nsAutoString buffer;
|
|
|
|
|
|
|
|
if (eCSSUnit_Null != mTop.GetUnit()) {
|
2001-10-27 10:44:19 +04:00
|
|
|
buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[0]).get());
|
2000-04-16 00:15:37 +04:00
|
|
|
buffer.AppendWithConversion(": ");
|
1998-09-23 06:34:21 +04:00
|
|
|
mTop.AppendToString(buffer);
|
|
|
|
}
|
|
|
|
if (eCSSUnit_Null != mRight.GetUnit()) {
|
2001-10-27 10:44:19 +04:00
|
|
|
buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[1]).get());
|
2000-04-16 00:15:37 +04:00
|
|
|
buffer.AppendWithConversion(": ");
|
1998-09-23 06:34:21 +04:00
|
|
|
mRight.AppendToString(buffer);
|
|
|
|
}
|
|
|
|
if (eCSSUnit_Null != mBottom.GetUnit()) {
|
2001-10-27 10:44:19 +04:00
|
|
|
buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[2]).get());
|
2000-04-16 00:15:37 +04:00
|
|
|
buffer.AppendWithConversion(": ");
|
1998-09-23 06:34:21 +04:00
|
|
|
mBottom.AppendToString(buffer);
|
|
|
|
}
|
|
|
|
if (eCSSUnit_Null != mLeft.GetUnit()) {
|
2001-10-27 10:44:19 +04:00
|
|
|
buffer.AppendWithConversion(nsCSSProps::GetStringValue(aTRBL[3]).get());
|
2000-04-16 00:15:37 +04:00
|
|
|
buffer.AppendWithConversion(": ");
|
1998-09-23 06:34:21 +04:00
|
|
|
mLeft.AppendToString(buffer);
|
|
|
|
}
|
|
|
|
|
2001-10-16 07:53:44 +04:00
|
|
|
fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out);
|
1998-09-23 06:34:21 +04:00
|
|
|
}
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
// --- nsCSSDisplay -----------------
|
|
|
|
|
1998-05-27 03:16:55 +04:00
|
|
|
nsCSSDisplay::nsCSSDisplay(void)
|
|
|
|
: mClip(nsnull)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSDisplay);
|
1998-05-27 03:16:55 +04:00
|
|
|
}
|
|
|
|
|
1999-06-03 05:58:11 +04:00
|
|
|
nsCSSDisplay::nsCSSDisplay(const nsCSSDisplay& aCopy)
|
|
|
|
: mDirection(aCopy.mDirection),
|
|
|
|
mDisplay(aCopy.mDisplay),
|
2001-06-01 02:19:43 +04:00
|
|
|
mBinding(aCopy.mBinding),
|
|
|
|
mPosition(aCopy.mPosition),
|
1999-06-03 05:58:11 +04:00
|
|
|
mFloat(aCopy.mFloat),
|
|
|
|
mClear(aCopy.mClear),
|
|
|
|
mClip(nsnull),
|
|
|
|
mOverflow(aCopy.mOverflow),
|
2001-06-01 02:19:43 +04:00
|
|
|
mVisibility(aCopy.mVisibility),
|
|
|
|
mOpacity(aCopy.mOpacity)
|
1999-06-03 05:58:11 +04:00
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSDisplay);
|
1999-06-03 05:58:11 +04:00
|
|
|
CSS_IF_COPY(mClip, nsCSSRect);
|
|
|
|
}
|
|
|
|
|
1998-05-27 03:16:55 +04:00
|
|
|
nsCSSDisplay::~nsCSSDisplay(void)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_DTOR(nsCSSDisplay);
|
1998-10-27 02:22:40 +03:00
|
|
|
CSS_IF_DELETE(mClip);
|
1998-05-27 03:16:55 +04:00
|
|
|
}
|
|
|
|
|
1998-04-25 22:43:42 +04:00
|
|
|
const nsID& nsCSSDisplay::GetID(void)
|
|
|
|
{
|
|
|
|
return kCSSDisplaySID;
|
|
|
|
}
|
|
|
|
|
|
|
|
void nsCSSDisplay::List(FILE* out, PRInt32 aIndent) const
|
|
|
|
{
|
|
|
|
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
|
|
|
|
|
|
|
|
nsAutoString buffer;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
mDirection.AppendToString(buffer, eCSSProperty_direction);
|
|
|
|
mDisplay.AppendToString(buffer, eCSSProperty_display);
|
2001-06-01 02:19:43 +04:00
|
|
|
mBinding.AppendToString(buffer, eCSSProperty_binding);
|
|
|
|
mPosition.AppendToString(buffer, eCSSProperty_position);
|
1999-07-18 04:25:28 +04:00
|
|
|
mFloat.AppendToString(buffer, eCSSProperty_float);
|
|
|
|
mClear.AppendToString(buffer, eCSSProperty_clear);
|
|
|
|
mVisibility.AppendToString(buffer, eCSSProperty_visibility);
|
2001-06-01 02:19:43 +04:00
|
|
|
mOpacity.AppendToString(buffer, eCSSProperty_opacity);
|
|
|
|
|
2001-10-16 07:53:44 +04:00
|
|
|
fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out);
|
1998-05-27 03:16:55 +04:00
|
|
|
if (nsnull != mClip) {
|
1999-07-18 04:25:28 +04:00
|
|
|
mClip->List(out, eCSSProperty_clip);
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
1998-05-27 03:16:55 +04:00
|
|
|
buffer.SetLength(0);
|
1999-07-18 04:25:28 +04:00
|
|
|
mOverflow.AppendToString(buffer, eCSSProperty_overflow);
|
2001-10-16 07:53:44 +04:00
|
|
|
fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out);
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
// --- nsCSSMargin -----------------
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
nsCSSMargin::nsCSSMargin(void)
|
1998-10-08 05:31:58 +04:00
|
|
|
: mMargin(nsnull), mPadding(nsnull),
|
2001-12-05 11:35:05 +03:00
|
|
|
mBorderWidth(nsnull), mBorderColor(nsnull), mBorderColors(nsnull),
|
|
|
|
mBorderStyle(nsnull), mBorderRadius(nsnull), mOutlineRadius(nsnull)
|
1998-04-14 00:24:54 +04:00
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSMargin);
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
|
1999-06-03 05:58:11 +04:00
|
|
|
nsCSSMargin::nsCSSMargin(const nsCSSMargin& aCopy)
|
|
|
|
: mMargin(nsnull), mPadding(nsnull),
|
2000-03-30 07:21:26 +04:00
|
|
|
mBorderWidth(nsnull), mBorderColor(nsnull), mBorderStyle(nsnull), mBorderRadius(nsnull),
|
2001-12-05 11:35:05 +03:00
|
|
|
mBorderColors(nsnull),
|
1999-06-03 05:58:11 +04:00
|
|
|
mOutlineWidth(aCopy.mOutlineWidth),
|
|
|
|
mOutlineColor(aCopy.mOutlineColor),
|
1999-07-24 23:04:42 +04:00
|
|
|
mOutlineStyle(aCopy.mOutlineStyle),
|
2000-03-30 07:21:26 +04:00
|
|
|
mOutlineRadius(nsnull),
|
1999-07-24 23:04:42 +04:00
|
|
|
mFloatEdge(aCopy.mFloatEdge)
|
1999-06-03 05:58:11 +04:00
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSMargin);
|
1999-06-03 05:58:11 +04:00
|
|
|
CSS_IF_COPY(mMargin, nsCSSRect);
|
|
|
|
CSS_IF_COPY(mPadding, nsCSSRect);
|
|
|
|
CSS_IF_COPY(mBorderWidth, nsCSSRect);
|
|
|
|
CSS_IF_COPY(mBorderColor, nsCSSRect);
|
|
|
|
CSS_IF_COPY(mBorderStyle, nsCSSRect);
|
1999-12-22 14:27:10 +03:00
|
|
|
CSS_IF_COPY(mBorderRadius, nsCSSRect);
|
2000-01-24 14:19:55 +03:00
|
|
|
CSS_IF_COPY(mOutlineRadius, nsCSSRect);
|
2001-12-05 11:35:05 +03:00
|
|
|
if (aCopy.mBorderColors) {
|
|
|
|
EnsureBorderColors();
|
|
|
|
for (PRInt32 i = 0; i < 4; i++)
|
|
|
|
CSS_IF_COPY(mBorderColors[i], nsCSSValueList);
|
|
|
|
}
|
1999-06-03 05:58:11 +04:00
|
|
|
}
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
nsCSSMargin::~nsCSSMargin(void)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_DTOR(nsCSSMargin);
|
1998-10-27 02:22:40 +03:00
|
|
|
CSS_IF_DELETE(mMargin);
|
|
|
|
CSS_IF_DELETE(mPadding);
|
|
|
|
CSS_IF_DELETE(mBorderWidth);
|
|
|
|
CSS_IF_DELETE(mBorderColor);
|
|
|
|
CSS_IF_DELETE(mBorderStyle);
|
1999-12-22 14:27:10 +03:00
|
|
|
CSS_IF_DELETE(mBorderRadius);
|
2000-01-24 14:19:55 +03:00
|
|
|
CSS_IF_DELETE(mOutlineRadius);
|
2001-12-05 11:35:05 +03:00
|
|
|
if (mBorderColors) {
|
|
|
|
for (PRInt32 i = 0; i < 4; i++)
|
|
|
|
CSS_IF_DELETE(mBorderColors[i]);
|
|
|
|
delete []mBorderColors;
|
|
|
|
}
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
const nsID& nsCSSMargin::GetID(void)
|
|
|
|
{
|
|
|
|
return kCSSMarginSID;
|
|
|
|
}
|
|
|
|
|
|
|
|
void nsCSSMargin::List(FILE* out, PRInt32 aIndent) const
|
|
|
|
{
|
|
|
|
if (nsnull != mMargin) {
|
1999-07-18 04:25:28 +04:00
|
|
|
static const nsCSSProperty trbl[] = {
|
|
|
|
eCSSProperty_margin_top,
|
|
|
|
eCSSProperty_margin_right,
|
|
|
|
eCSSProperty_margin_bottom,
|
|
|
|
eCSSProperty_margin_left
|
1998-09-23 06:34:21 +04:00
|
|
|
};
|
|
|
|
mMargin->List(out, aIndent, trbl);
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
if (nsnull != mPadding) {
|
1999-07-18 04:25:28 +04:00
|
|
|
static const nsCSSProperty trbl[] = {
|
|
|
|
eCSSProperty_padding_top,
|
|
|
|
eCSSProperty_padding_right,
|
|
|
|
eCSSProperty_padding_bottom,
|
|
|
|
eCSSProperty_padding_left
|
1998-09-23 06:34:21 +04:00
|
|
|
};
|
|
|
|
mPadding->List(out, aIndent, trbl);
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mBorderWidth) {
|
1999-07-18 04:25:28 +04:00
|
|
|
static const nsCSSProperty trbl[] = {
|
|
|
|
eCSSProperty_border_top_width,
|
|
|
|
eCSSProperty_border_right_width,
|
|
|
|
eCSSProperty_border_bottom_width,
|
|
|
|
eCSSProperty_border_left_width
|
1998-09-23 06:34:21 +04:00
|
|
|
};
|
1998-10-08 05:31:58 +04:00
|
|
|
mBorderWidth->List(out, aIndent, trbl);
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mBorderColor) {
|
1999-07-18 04:25:28 +04:00
|
|
|
mBorderColor->List(out, eCSSProperty_border_color, aIndent);
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mBorderStyle) {
|
1999-07-18 04:25:28 +04:00
|
|
|
mBorderStyle->List(out, eCSSProperty_border_style, aIndent);
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
1999-12-22 14:27:10 +03:00
|
|
|
if (nsnull != mBorderRadius) {
|
|
|
|
static const nsCSSProperty trbl[] = {
|
|
|
|
eCSSProperty__moz_border_radius_topLeft,
|
|
|
|
eCSSProperty__moz_border_radius_topRight,
|
|
|
|
eCSSProperty__moz_border_radius_bottomRight,
|
|
|
|
eCSSProperty__moz_border_radius_bottomLeft
|
|
|
|
};
|
|
|
|
mBorderRadius->List(out, aIndent, trbl);
|
|
|
|
}
|
1998-10-08 05:31:58 +04:00
|
|
|
|
|
|
|
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
|
|
|
|
|
|
|
|
nsAutoString buffer;
|
1999-07-18 04:25:28 +04:00
|
|
|
mOutlineWidth.AppendToString(buffer, eCSSProperty_outline_width);
|
|
|
|
mOutlineColor.AppendToString(buffer, eCSSProperty_outline_color);
|
|
|
|
mOutlineStyle.AppendToString(buffer, eCSSProperty_outline_style);
|
2000-01-24 14:19:55 +03:00
|
|
|
if (nsnull != mOutlineRadius) {
|
|
|
|
static const nsCSSProperty trbl[] = {
|
|
|
|
eCSSProperty__moz_outline_radius_topLeft,
|
|
|
|
eCSSProperty__moz_outline_radius_topRight,
|
|
|
|
eCSSProperty__moz_outline_radius_bottomRight,
|
|
|
|
eCSSProperty__moz_outline_radius_bottomLeft
|
|
|
|
};
|
|
|
|
mOutlineRadius->List(out, aIndent, trbl);
|
|
|
|
}
|
1999-07-24 23:04:42 +04:00
|
|
|
mFloatEdge.AppendToString(buffer, eCSSProperty_float_edge);
|
2001-10-16 07:53:44 +04:00
|
|
|
fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out);
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
|
2001-12-05 11:35:05 +03:00
|
|
|
inline void nsCSSMargin::EnsureBorderColors()
|
|
|
|
{
|
|
|
|
if (!mBorderColors) {
|
|
|
|
PRInt32 i;
|
|
|
|
mBorderColors = new nsCSSValueList*[4];
|
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
mBorderColors[i] = nsnull;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
// --- nsCSSPosition -----------------
|
|
|
|
|
|
|
|
nsCSSPosition::nsCSSPosition(void)
|
|
|
|
: mOffset(nsnull)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSPosition);
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
|
1999-06-03 05:58:11 +04:00
|
|
|
nsCSSPosition::nsCSSPosition(const nsCSSPosition& aCopy)
|
2001-06-01 02:19:43 +04:00
|
|
|
: mWidth(aCopy.mWidth),
|
1999-06-03 05:58:11 +04:00
|
|
|
mMinWidth(aCopy.mMinWidth),
|
|
|
|
mMaxWidth(aCopy.mMaxWidth),
|
|
|
|
mHeight(aCopy.mHeight),
|
|
|
|
mMinHeight(aCopy.mMinHeight),
|
|
|
|
mMaxHeight(aCopy.mMaxHeight),
|
1999-07-24 23:04:42 +04:00
|
|
|
mBoxSizing(aCopy.mBoxSizing),
|
1999-06-03 05:58:11 +04:00
|
|
|
mOffset(nsnull),
|
|
|
|
mZIndex(aCopy.mZIndex)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSPosition);
|
1999-06-03 05:58:11 +04:00
|
|
|
CSS_IF_COPY(mOffset, nsCSSRect);
|
|
|
|
}
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
nsCSSPosition::~nsCSSPosition(void)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_DTOR(nsCSSPosition);
|
1998-10-27 02:22:40 +03:00
|
|
|
CSS_IF_DELETE(mOffset);
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
const nsID& nsCSSPosition::GetID(void)
|
|
|
|
{
|
|
|
|
return kCSSPositionSID;
|
|
|
|
}
|
|
|
|
|
|
|
|
void nsCSSPosition::List(FILE* out, PRInt32 aIndent) const
|
|
|
|
{
|
|
|
|
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
|
|
|
|
|
|
|
|
nsAutoString buffer;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
mWidth.AppendToString(buffer, eCSSProperty_width);
|
|
|
|
mMinWidth.AppendToString(buffer, eCSSProperty_min_width);
|
|
|
|
mMaxWidth.AppendToString(buffer, eCSSProperty_max_width);
|
|
|
|
mHeight.AppendToString(buffer, eCSSProperty_height);
|
|
|
|
mMinHeight.AppendToString(buffer, eCSSProperty_min_height);
|
|
|
|
mMaxHeight.AppendToString(buffer, eCSSProperty_max_height);
|
1999-07-24 23:04:42 +04:00
|
|
|
mBoxSizing.AppendToString(buffer, eCSSProperty_box_sizing);
|
1999-07-18 04:25:28 +04:00
|
|
|
mZIndex.AppendToString(buffer, eCSSProperty_z_index);
|
2001-10-16 07:53:44 +04:00
|
|
|
fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out);
|
1998-10-08 05:31:58 +04:00
|
|
|
|
|
|
|
if (nsnull != mOffset) {
|
1999-07-18 04:25:28 +04:00
|
|
|
static const nsCSSProperty trbl[] = {
|
|
|
|
eCSSProperty_top,
|
|
|
|
eCSSProperty_right,
|
|
|
|
eCSSProperty_bottom,
|
|
|
|
eCSSProperty_left
|
1998-10-08 05:31:58 +04:00
|
|
|
};
|
|
|
|
mOffset->List(out, aIndent, trbl);
|
|
|
|
}
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
// --- nsCSSList -----------------
|
|
|
|
|
1999-06-03 05:58:11 +04:00
|
|
|
nsCSSList::nsCSSList(void)
|
2001-12-05 11:35:05 +03:00
|
|
|
:mImageRegion(nsnull)
|
1999-06-03 05:58:11 +04:00
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSList);
|
1999-06-03 05:58:11 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
nsCSSList::nsCSSList(const nsCSSList& aCopy)
|
|
|
|
: mType(aCopy.mType),
|
|
|
|
mImage(aCopy.mImage),
|
2001-12-05 11:35:05 +03:00
|
|
|
mPosition(aCopy.mPosition),
|
|
|
|
mImageRegion(nsnull)
|
1999-06-03 05:58:11 +04:00
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSList);
|
2001-12-05 11:35:05 +03:00
|
|
|
CSS_IF_COPY(mImageRegion, nsCSSRect);
|
1999-06-03 05:58:11 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
nsCSSList::~nsCSSList(void)
|
1999-02-12 20:45:58 +03:00
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_DTOR(nsCSSList);
|
2001-12-05 11:35:05 +03:00
|
|
|
CSS_IF_DELETE(mImageRegion);
|
1999-02-12 20:45:58 +03:00
|
|
|
}
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
const nsID& nsCSSList::GetID(void)
|
|
|
|
{
|
|
|
|
return kCSSListSID;
|
|
|
|
}
|
|
|
|
|
|
|
|
void nsCSSList::List(FILE* out, PRInt32 aIndent) const
|
|
|
|
{
|
|
|
|
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
|
|
|
|
|
|
|
|
nsAutoString buffer;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
mType.AppendToString(buffer, eCSSProperty_list_style_type);
|
|
|
|
mImage.AppendToString(buffer, eCSSProperty_list_style_image);
|
|
|
|
mPosition.AppendToString(buffer, eCSSProperty_list_style_position);
|
2001-10-16 07:53:44 +04:00
|
|
|
fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out);
|
2001-12-05 11:35:05 +03:00
|
|
|
|
|
|
|
if (mImageRegion) {
|
|
|
|
static const nsCSSProperty trbl[] = {
|
|
|
|
eCSSProperty_top,
|
|
|
|
eCSSProperty_right,
|
|
|
|
eCSSProperty_bottom,
|
|
|
|
eCSSProperty_left
|
|
|
|
};
|
|
|
|
mImageRegion->List(out, aIndent, trbl);
|
|
|
|
}
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
// --- nsCSSTable -----------------
|
|
|
|
|
1999-06-03 05:58:11 +04:00
|
|
|
nsCSSTable::nsCSSTable(void)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSTable);
|
1999-06-03 05:58:11 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
nsCSSTable::nsCSSTable(const nsCSSTable& aCopy)
|
|
|
|
: mBorderCollapse(aCopy.mBorderCollapse),
|
|
|
|
mBorderSpacingX(aCopy.mBorderSpacingX),
|
|
|
|
mBorderSpacingY(aCopy.mBorderSpacingY),
|
|
|
|
mCaptionSide(aCopy.mCaptionSide),
|
|
|
|
mEmptyCells(aCopy.mEmptyCells),
|
|
|
|
mLayout(aCopy.mLayout)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSTable);
|
1999-06-03 05:58:11 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
nsCSSTable::~nsCSSTable(void)
|
1999-02-12 20:45:58 +03:00
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_DTOR(nsCSSTable);
|
1999-02-12 20:45:58 +03:00
|
|
|
}
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
const nsID& nsCSSTable::GetID(void)
|
|
|
|
{
|
|
|
|
return kCSSTableSID;
|
|
|
|
}
|
|
|
|
|
|
|
|
void nsCSSTable::List(FILE* out, PRInt32 aIndent) const
|
|
|
|
{
|
|
|
|
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
|
|
|
|
|
|
|
|
nsAutoString buffer;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
mBorderCollapse.AppendToString(buffer, eCSSProperty_border_collapse);
|
|
|
|
mBorderSpacingX.AppendToString(buffer, eCSSProperty_border_x_spacing);
|
|
|
|
mBorderSpacingY.AppendToString(buffer, eCSSProperty_border_y_spacing);
|
|
|
|
mCaptionSide.AppendToString(buffer, eCSSProperty_caption_side);
|
|
|
|
mEmptyCells.AppendToString(buffer, eCSSProperty_empty_cells);
|
|
|
|
mLayout.AppendToString(buffer, eCSSProperty_table_layout);
|
1998-10-08 05:31:58 +04:00
|
|
|
|
2001-10-16 07:53:44 +04:00
|
|
|
fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out);
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// --- nsCSSBreaks -----------------
|
|
|
|
|
1999-06-03 05:58:11 +04:00
|
|
|
nsCSSBreaks::nsCSSBreaks(void)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSBreaks);
|
1999-06-03 05:58:11 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
nsCSSBreaks::nsCSSBreaks(const nsCSSBreaks& aCopy)
|
|
|
|
: mOrphans(aCopy.mOrphans),
|
|
|
|
mWidows(aCopy.mWidows),
|
|
|
|
mPage(aCopy.mPage),
|
|
|
|
mPageBreakAfter(aCopy.mPageBreakAfter),
|
|
|
|
mPageBreakBefore(aCopy.mPageBreakBefore),
|
|
|
|
mPageBreakInside(aCopy.mPageBreakInside)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSBreaks);
|
1999-06-03 05:58:11 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
nsCSSBreaks::~nsCSSBreaks(void)
|
1999-02-12 20:45:58 +03:00
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_DTOR(nsCSSBreaks);
|
1999-02-12 20:45:58 +03:00
|
|
|
}
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
const nsID& nsCSSBreaks::GetID(void)
|
|
|
|
{
|
|
|
|
return kCSSBreaksSID;
|
|
|
|
}
|
|
|
|
|
|
|
|
void nsCSSBreaks::List(FILE* out, PRInt32 aIndent) const
|
|
|
|
{
|
|
|
|
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
|
|
|
|
|
|
|
|
nsAutoString buffer;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
mOrphans.AppendToString(buffer, eCSSProperty_orphans);
|
|
|
|
mWidows.AppendToString(buffer, eCSSProperty_widows);
|
|
|
|
mPage.AppendToString(buffer, eCSSProperty_page);
|
|
|
|
mPageBreakAfter.AppendToString(buffer, eCSSProperty_page_break_after);
|
|
|
|
mPageBreakBefore.AppendToString(buffer, eCSSProperty_page_break_before);
|
|
|
|
mPageBreakInside.AppendToString(buffer, eCSSProperty_page_break_inside);
|
1998-10-08 05:31:58 +04:00
|
|
|
|
2001-10-16 07:53:44 +04:00
|
|
|
fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out);
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// --- nsCSSPage -----------------
|
|
|
|
|
1999-06-03 05:58:11 +04:00
|
|
|
nsCSSPage::nsCSSPage(void)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSPage);
|
1999-06-03 05:58:11 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
nsCSSPage::nsCSSPage(const nsCSSPage& aCopy)
|
|
|
|
: mMarks(aCopy.mMarks),
|
|
|
|
mSizeWidth(aCopy.mSizeWidth),
|
|
|
|
mSizeHeight(aCopy.mSizeHeight)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSPage);
|
1999-06-03 05:58:11 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
nsCSSPage::~nsCSSPage(void)
|
1999-02-12 20:45:58 +03:00
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_DTOR(nsCSSPage);
|
1999-02-12 20:45:58 +03:00
|
|
|
}
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
const nsID& nsCSSPage::GetID(void)
|
|
|
|
{
|
|
|
|
return kCSSPageSID;
|
|
|
|
}
|
|
|
|
|
|
|
|
void nsCSSPage::List(FILE* out, PRInt32 aIndent) const
|
|
|
|
{
|
|
|
|
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
|
|
|
|
|
|
|
|
nsAutoString buffer;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
mMarks.AppendToString(buffer, eCSSProperty_marks);
|
|
|
|
mSizeWidth.AppendToString(buffer, eCSSProperty_size_width);
|
|
|
|
mSizeHeight.AppendToString(buffer, eCSSProperty_size_height);
|
1998-10-08 05:31:58 +04:00
|
|
|
|
2001-10-16 07:53:44 +04:00
|
|
|
fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out);
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
|
1998-10-27 02:22:40 +03:00
|
|
|
// --- nsCSSContent support -----------------
|
|
|
|
|
|
|
|
nsCSSCounterData::nsCSSCounterData(void)
|
|
|
|
: mNext(nsnull)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSCounterData);
|
1998-10-27 02:22:40 +03:00
|
|
|
}
|
|
|
|
|
1999-06-03 05:58:11 +04:00
|
|
|
nsCSSCounterData::nsCSSCounterData(const nsCSSCounterData& aCopy)
|
|
|
|
: mCounter(aCopy.mCounter),
|
|
|
|
mValue(aCopy.mValue),
|
|
|
|
mNext(nsnull)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSCounterData);
|
1999-06-03 05:58:11 +04:00
|
|
|
CSS_IF_COPY(mNext, nsCSSCounterData);
|
|
|
|
}
|
|
|
|
|
1998-10-27 02:22:40 +03:00
|
|
|
nsCSSCounterData::~nsCSSCounterData(void)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_DTOR(nsCSSCounterData);
|
1998-10-27 02:22:40 +03:00
|
|
|
CSS_IF_DELETE(mNext);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsCSSQuotes::nsCSSQuotes(void)
|
|
|
|
: mNext(nsnull)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSQuotes);
|
1998-10-27 02:22:40 +03:00
|
|
|
}
|
|
|
|
|
1999-06-03 05:58:11 +04:00
|
|
|
nsCSSQuotes::nsCSSQuotes(const nsCSSQuotes& aCopy)
|
|
|
|
: mOpen(aCopy.mOpen),
|
|
|
|
mClose(aCopy.mClose),
|
|
|
|
mNext(nsnull)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSQuotes);
|
1999-06-03 05:58:11 +04:00
|
|
|
CSS_IF_COPY(mNext, nsCSSQuotes);
|
|
|
|
}
|
|
|
|
|
1998-10-27 02:22:40 +03:00
|
|
|
nsCSSQuotes::~nsCSSQuotes(void)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_DTOR(nsCSSQuotes);
|
1998-10-27 02:22:40 +03:00
|
|
|
CSS_IF_DELETE(mNext);
|
|
|
|
}
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
// --- nsCSSContent -----------------
|
|
|
|
|
1998-10-27 02:22:40 +03:00
|
|
|
nsCSSContent::nsCSSContent(void)
|
|
|
|
: mContent(nsnull),
|
|
|
|
mCounterIncrement(nsnull),
|
|
|
|
mCounterReset(nsnull),
|
|
|
|
mQuotes(nsnull)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSContent);
|
1998-10-27 02:22:40 +03:00
|
|
|
}
|
|
|
|
|
1999-06-03 05:58:11 +04:00
|
|
|
nsCSSContent::nsCSSContent(const nsCSSContent& aCopy)
|
|
|
|
: mContent(nsnull),
|
|
|
|
mCounterIncrement(nsnull),
|
|
|
|
mCounterReset(nsnull),
|
|
|
|
mMarkerOffset(aCopy.mMarkerOffset),
|
|
|
|
mQuotes(nsnull)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSContent);
|
1999-06-03 05:58:11 +04:00
|
|
|
CSS_IF_COPY(mContent, nsCSSValueList);
|
|
|
|
CSS_IF_COPY(mCounterIncrement, nsCSSCounterData);
|
|
|
|
CSS_IF_COPY(mCounterReset, nsCSSCounterData);
|
|
|
|
CSS_IF_COPY(mQuotes, nsCSSQuotes);
|
|
|
|
}
|
|
|
|
|
1998-10-27 02:22:40 +03:00
|
|
|
nsCSSContent::~nsCSSContent(void)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_DTOR(nsCSSContent);
|
1998-10-27 02:22:40 +03:00
|
|
|
CSS_IF_DELETE(mContent);
|
|
|
|
CSS_IF_DELETE(mCounterIncrement);
|
|
|
|
CSS_IF_DELETE(mCounterReset);
|
|
|
|
CSS_IF_DELETE(mQuotes);
|
|
|
|
}
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
const nsID& nsCSSContent::GetID(void)
|
|
|
|
{
|
|
|
|
return kCSSContentSID;
|
|
|
|
}
|
|
|
|
|
|
|
|
void nsCSSContent::List(FILE* out, PRInt32 aIndent) const
|
|
|
|
{
|
|
|
|
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
|
|
|
|
|
|
|
|
nsAutoString buffer;
|
|
|
|
|
1998-10-27 02:22:40 +03:00
|
|
|
nsCSSValueList* content = mContent;
|
|
|
|
while (nsnull != content) {
|
1999-07-18 04:25:28 +04:00
|
|
|
content->mValue.AppendToString(buffer, eCSSProperty_content);
|
1998-10-27 02:22:40 +03:00
|
|
|
content = content->mNext;
|
|
|
|
}
|
|
|
|
nsCSSCounterData* counter = mCounterIncrement;
|
|
|
|
while (nsnull != counter) {
|
1999-07-18 04:25:28 +04:00
|
|
|
counter->mCounter.AppendToString(buffer, eCSSProperty_counter_increment);
|
|
|
|
counter->mValue.AppendToString(buffer, eCSSProperty_UNKNOWN);
|
1998-10-27 02:22:40 +03:00
|
|
|
counter = counter->mNext;
|
|
|
|
}
|
|
|
|
counter = mCounterReset;
|
|
|
|
while (nsnull != counter) {
|
1999-07-18 04:25:28 +04:00
|
|
|
counter->mCounter.AppendToString(buffer, eCSSProperty_counter_reset);
|
|
|
|
counter->mValue.AppendToString(buffer, eCSSProperty_UNKNOWN);
|
1998-10-27 02:22:40 +03:00
|
|
|
counter = counter->mNext;
|
|
|
|
}
|
1999-07-18 04:25:28 +04:00
|
|
|
mMarkerOffset.AppendToString(buffer, eCSSProperty_marker_offset);
|
1998-10-27 02:22:40 +03:00
|
|
|
nsCSSQuotes* quotes = mQuotes;
|
|
|
|
while (nsnull != quotes) {
|
1999-07-18 04:25:28 +04:00
|
|
|
quotes->mOpen.AppendToString(buffer, eCSSProperty_quotes_open);
|
|
|
|
quotes->mClose.AppendToString(buffer, eCSSProperty_quotes_close);
|
1998-10-27 02:22:40 +03:00
|
|
|
quotes = quotes->mNext;
|
|
|
|
}
|
1998-10-08 05:31:58 +04:00
|
|
|
|
2001-10-16 07:53:44 +04:00
|
|
|
fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out);
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
|
1999-07-24 23:04:42 +04:00
|
|
|
// --- nsCSSUserInterface -----------------
|
|
|
|
|
|
|
|
nsCSSUserInterface::nsCSSUserInterface(void)
|
2001-06-01 02:19:43 +04:00
|
|
|
: mKeyEquivalent(nsnull), mCursor(nsnull)
|
1999-07-24 23:04:42 +04:00
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSUserInterface);
|
1999-07-24 23:04:42 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
nsCSSUserInterface::nsCSSUserInterface(const nsCSSUserInterface& aCopy)
|
|
|
|
: mUserInput(aCopy.mUserInput),
|
1999-09-04 03:40:35 +04:00
|
|
|
mUserModify(aCopy.mUserModify),
|
|
|
|
mUserSelect(aCopy.mUserSelect),
|
1999-07-24 23:04:42 +04:00
|
|
|
mKeyEquivalent(nsnull),
|
1999-09-04 03:40:35 +04:00
|
|
|
mUserFocus(aCopy.mUserFocus),
|
2001-08-08 08:21:53 +04:00
|
|
|
mResizer(aCopy.mResizer),
|
|
|
|
mCursor(nsnull)
|
1999-07-24 23:04:42 +04:00
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSUserInterface);
|
2001-06-01 02:19:43 +04:00
|
|
|
CSS_IF_COPY(mCursor, nsCSSValueList);
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_IF_COPY(mKeyEquivalent, nsCSSValueList);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsCSSUserInterface::~nsCSSUserInterface(void)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_DTOR(nsCSSUserInterface);
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_IF_DELETE(mKeyEquivalent);
|
2001-06-01 02:19:43 +04:00
|
|
|
CSS_IF_DELETE(mCursor);
|
1999-07-24 23:04:42 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
const nsID& nsCSSUserInterface::GetID(void)
|
|
|
|
{
|
|
|
|
return kCSSUserInterfaceSID;
|
|
|
|
}
|
|
|
|
|
|
|
|
void nsCSSUserInterface::List(FILE* out, PRInt32 aIndent) const
|
|
|
|
{
|
|
|
|
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
|
|
|
|
|
|
|
|
nsAutoString buffer;
|
|
|
|
|
|
|
|
mUserInput.AppendToString(buffer, eCSSProperty_user_input);
|
1999-09-04 03:40:35 +04:00
|
|
|
mUserModify.AppendToString(buffer, eCSSProperty_user_modify);
|
|
|
|
mUserSelect.AppendToString(buffer, eCSSProperty_user_select);
|
1999-07-24 23:04:42 +04:00
|
|
|
nsCSSValueList* keyEquiv = mKeyEquivalent;
|
|
|
|
while (nsnull != keyEquiv) {
|
|
|
|
keyEquiv->mValue.AppendToString(buffer, eCSSProperty_key_equivalent);
|
|
|
|
keyEquiv= keyEquiv->mNext;
|
|
|
|
}
|
1999-09-04 03:40:35 +04:00
|
|
|
mUserFocus.AppendToString(buffer, eCSSProperty_user_focus);
|
1999-07-24 23:04:42 +04:00
|
|
|
mResizer.AppendToString(buffer, eCSSProperty_resizer);
|
2001-06-01 02:19:43 +04:00
|
|
|
|
|
|
|
nsCSSValueList* cursor = mCursor;
|
|
|
|
while (nsnull != cursor) {
|
|
|
|
cursor->mValue.AppendToString(buffer, eCSSProperty_cursor);
|
|
|
|
cursor = cursor->mNext;
|
|
|
|
}
|
|
|
|
|
2001-10-16 07:53:44 +04:00
|
|
|
fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out);
|
1999-07-24 23:04:42 +04:00
|
|
|
}
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
// --- nsCSSAural -----------------
|
|
|
|
|
1999-06-03 05:58:11 +04:00
|
|
|
nsCSSAural::nsCSSAural(void)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSAural);
|
1999-06-03 05:58:11 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
nsCSSAural::nsCSSAural(const nsCSSAural& aCopy)
|
|
|
|
: mAzimuth(aCopy.mAzimuth),
|
|
|
|
mElevation(aCopy.mElevation),
|
|
|
|
mCueAfter(aCopy.mCueAfter),
|
|
|
|
mCueBefore(aCopy.mCueBefore),
|
|
|
|
mPauseAfter(aCopy.mPauseAfter),
|
|
|
|
mPauseBefore(aCopy.mPauseBefore),
|
|
|
|
mPitch(aCopy.mPitch),
|
|
|
|
mPitchRange(aCopy.mPitchRange),
|
|
|
|
mPlayDuring(aCopy.mPlayDuring),
|
|
|
|
mPlayDuringFlags(aCopy.mPlayDuringFlags),
|
|
|
|
mRichness(aCopy.mRichness),
|
|
|
|
mSpeak(aCopy.mSpeak),
|
|
|
|
mSpeakHeader(aCopy.mSpeakHeader),
|
|
|
|
mSpeakNumeral(aCopy.mSpeakNumeral),
|
|
|
|
mSpeakPunctuation(aCopy.mSpeakPunctuation),
|
|
|
|
mSpeechRate(aCopy.mSpeechRate),
|
|
|
|
mStress(aCopy.mStress),
|
|
|
|
mVoiceFamily(aCopy.mVoiceFamily),
|
|
|
|
mVolume(aCopy.mVolume)
|
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_CTOR(nsCSSAural);
|
1999-06-03 05:58:11 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
nsCSSAural::~nsCSSAural(void)
|
1999-02-12 20:45:58 +03:00
|
|
|
{
|
2000-05-04 01:21:30 +04:00
|
|
|
MOZ_COUNT_DTOR(nsCSSAural);
|
1999-02-12 20:45:58 +03:00
|
|
|
}
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
const nsID& nsCSSAural::GetID(void)
|
|
|
|
{
|
|
|
|
return kCSSAuralSID;
|
|
|
|
}
|
|
|
|
|
|
|
|
void nsCSSAural::List(FILE* out, PRInt32 aIndent) const
|
|
|
|
{
|
|
|
|
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
|
|
|
|
|
|
|
|
nsAutoString buffer;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
mAzimuth.AppendToString(buffer, eCSSProperty_azimuth);
|
|
|
|
mElevation.AppendToString(buffer, eCSSProperty_elevation);
|
|
|
|
mCueAfter.AppendToString(buffer, eCSSProperty_cue_after);
|
|
|
|
mCueBefore.AppendToString(buffer, eCSSProperty_cue_before);
|
|
|
|
mPauseAfter.AppendToString(buffer, eCSSProperty_pause_after);
|
|
|
|
mPauseBefore.AppendToString(buffer, eCSSProperty_pause_before);
|
|
|
|
mPitch.AppendToString(buffer, eCSSProperty_pitch);
|
|
|
|
mPitchRange.AppendToString(buffer, eCSSProperty_pitch_range);
|
|
|
|
mPlayDuring.AppendToString(buffer, eCSSProperty_play_during);
|
|
|
|
mPlayDuringFlags.AppendToString(buffer, eCSSProperty_play_during_flags);
|
|
|
|
mRichness.AppendToString(buffer, eCSSProperty_richness);
|
|
|
|
mSpeak.AppendToString(buffer, eCSSProperty_speak);
|
|
|
|
mSpeakHeader.AppendToString(buffer, eCSSProperty_speak_header);
|
|
|
|
mSpeakNumeral.AppendToString(buffer, eCSSProperty_speak_numeral);
|
|
|
|
mSpeakPunctuation.AppendToString(buffer, eCSSProperty_speak_punctuation);
|
|
|
|
mSpeechRate.AppendToString(buffer, eCSSProperty_speech_rate);
|
|
|
|
mStress.AppendToString(buffer, eCSSProperty_stress);
|
|
|
|
mVoiceFamily.AppendToString(buffer, eCSSProperty_voice_family);
|
|
|
|
mVolume.AppendToString(buffer, eCSSProperty_volume);
|
1998-10-08 05:31:58 +04:00
|
|
|
|
2001-10-16 07:53:44 +04:00
|
|
|
fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out);
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
|
2001-03-06 05:30:30 +03:00
|
|
|
#ifdef INCLUDE_XUL
|
|
|
|
// --- nsCSSXUL -----------------
|
|
|
|
|
|
|
|
nsCSSXUL::nsCSSXUL(void)
|
|
|
|
{
|
|
|
|
MOZ_COUNT_CTOR(nsCSSXUL);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsCSSXUL::nsCSSXUL(const nsCSSXUL& aCopy)
|
2001-08-02 04:09:27 +04:00
|
|
|
: mBoxAlign(aCopy.mBoxAlign), mBoxDirection(aCopy.mBoxDirection),
|
|
|
|
mBoxFlex(aCopy.mBoxFlex), mBoxOrient(aCopy.mBoxOrient),
|
2001-09-26 02:17:00 +04:00
|
|
|
mBoxPack(aCopy.mBoxPack), mBoxOrdinal(aCopy.mBoxOrdinal)
|
2001-03-06 05:30:30 +03:00
|
|
|
{
|
|
|
|
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;
|
|
|
|
|
2001-08-02 04:09:27 +04:00
|
|
|
mBoxAlign.AppendToString(buffer, eCSSProperty_box_align);
|
|
|
|
mBoxDirection.AppendToString(buffer, eCSSProperty_box_direction);
|
|
|
|
mBoxFlex.AppendToString(buffer, eCSSProperty_box_flex);
|
2001-03-06 05:30:30 +03:00
|
|
|
mBoxOrient.AppendToString(buffer, eCSSProperty_box_orient);
|
2001-08-02 04:09:27 +04:00
|
|
|
mBoxPack.AppendToString(buffer, eCSSProperty_box_pack);
|
2001-09-26 02:17:00 +04:00
|
|
|
mBoxOrdinal.AppendToString(buffer, eCSSProperty_box_ordinal_group);
|
2001-10-16 07:53:44 +04:00
|
|
|
fputs(NS_LossyConvertUCS2toASCII(buffer).get(), out);
|
2001-03-06 05:30:30 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif // INCLUDE_XUL
|
1998-10-08 05:31:58 +04:00
|
|
|
|
|
|
|
|
|
|
|
// --- nsCSSDeclaration -----------------
|
1998-04-14 00:24:54 +04:00
|
|
|
|
|
|
|
|
|
|
|
class CSSDeclarationImpl : public nsICSSDeclaration {
|
|
|
|
public:
|
|
|
|
CSSDeclarationImpl(void);
|
1999-06-03 05:58:11 +04:00
|
|
|
CSSDeclarationImpl(const CSSDeclarationImpl& aCopy);
|
1999-02-12 20:45:58 +03:00
|
|
|
virtual ~CSSDeclarationImpl(void);
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1999-02-26 23:02:06 +03:00
|
|
|
NS_DECL_ZEROING_OPERATOR_NEW
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
1999-01-06 04:25:39 +03:00
|
|
|
NS_IMETHOD GetData(const nsID& aSID, nsCSSStruct** aData);
|
|
|
|
NS_IMETHOD EnsureData(const nsID& aSID, nsCSSStruct** aData);
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
NS_IMETHOD AppendValue(nsCSSProperty aProperty, const nsCSSValue& aValue);
|
|
|
|
NS_IMETHOD AppendStructValue(nsCSSProperty aProperty, void* aStruct);
|
|
|
|
NS_IMETHOD SetValueImportant(nsCSSProperty aProperty);
|
2000-08-23 21:27:06 +04:00
|
|
|
NS_IMETHOD AppendComment(const nsAReadableString& aComment);
|
2000-04-28 12:35:40 +04:00
|
|
|
NS_IMETHOD RemoveProperty(nsCSSProperty aProperty, nsCSSValue& aValue);
|
1998-07-17 09:50:35 +04:00
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
NS_IMETHOD GetValue(nsCSSProperty aProperty, nsCSSValue& aValue);
|
2000-08-23 21:27:06 +04:00
|
|
|
NS_IMETHOD GetValue(nsCSSProperty aProperty, nsAWritableString& aValue);
|
|
|
|
NS_IMETHOD GetValue(const nsAReadableString& aProperty, nsAWritableString& aValue);
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1999-01-06 04:25:39 +03:00
|
|
|
NS_IMETHOD GetImportantValues(nsICSSDeclaration*& aResult);
|
1999-07-18 04:25:28 +04:00
|
|
|
NS_IMETHOD GetValueIsImportant(nsCSSProperty aProperty, PRBool& aIsImportant);
|
2000-08-23 21:27:06 +04:00
|
|
|
NS_IMETHOD GetValueIsImportant(const nsAReadableString& aProperty, PRBool& aIsImportant);
|
1998-09-25 04:51:45 +04:00
|
|
|
|
2000-08-23 21:27:06 +04:00
|
|
|
PRBool AppendValueToString(nsCSSProperty aProperty, nsAWritableString& aResult);
|
|
|
|
PRBool AppendValueToString(nsCSSProperty aProperty, const nsCSSValue& aValue, nsAWritableString& aResult);
|
1998-10-08 05:31:58 +04:00
|
|
|
|
2000-08-23 21:27:06 +04:00
|
|
|
NS_IMETHOD ToString(nsAWritableString& aString);
|
1998-09-10 05:19:26 +04:00
|
|
|
|
1999-06-03 05:58:11 +04:00
|
|
|
NS_IMETHOD Clone(nsICSSDeclaration*& aClone) const;
|
|
|
|
|
2001-10-16 09:31:36 +04:00
|
|
|
#ifdef DEBUG
|
1998-04-14 00:24:54 +04:00
|
|
|
void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
2000-03-31 11:08:36 +04:00
|
|
|
|
|
|
|
virtual void SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize);
|
2001-10-16 09:31:36 +04:00
|
|
|
#endif
|
1998-09-25 04:51:45 +04:00
|
|
|
|
1999-01-06 04:25:39 +03:00
|
|
|
NS_IMETHOD Count(PRUint32* aCount);
|
2000-08-23 21:27:06 +04:00
|
|
|
NS_IMETHOD GetNthProperty(PRUint32 aIndex, nsAWritableString& aReturn);
|
1999-01-06 04:25:39 +03:00
|
|
|
|
|
|
|
NS_IMETHOD GetStyleImpact(PRInt32* aHint) const;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2000-04-28 12:35:40 +04:00
|
|
|
protected:
|
|
|
|
nsresult RemoveProperty(nsCSSProperty aProperty);
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
private:
|
|
|
|
CSSDeclarationImpl& operator=(const CSSDeclarationImpl& aCopy);
|
|
|
|
PRBool operator==(const CSSDeclarationImpl& aCopy) const;
|
|
|
|
|
2001-10-24 12:08:30 +04:00
|
|
|
void TryBorderShorthand(nsAWritableString & aString,
|
|
|
|
PRInt32 & aBorderTopWidth,
|
|
|
|
PRInt32 & aBorderTopStyle,
|
|
|
|
PRInt32 & aBorderTopColor,
|
|
|
|
PRInt32 & aBorderBottomWidth,
|
|
|
|
PRInt32 & aBorderBottomStyle,
|
|
|
|
PRInt32 & aBorderBottomColor,
|
|
|
|
PRInt32 & aBorderLeftWidth,
|
|
|
|
PRInt32 & aBorderLeftStyle,
|
|
|
|
PRInt32 & aBorderLeftColor,
|
|
|
|
PRInt32 & aBorderRightWidth,
|
|
|
|
PRInt32 & aBorderRightStyle,
|
|
|
|
PRInt32 & aBorderRightColor);
|
|
|
|
void TryBorderSideShorthand(nsAWritableString & aString,
|
|
|
|
nsCSSProperty aShorthand,
|
|
|
|
PRInt32 & aBorderWidth,
|
|
|
|
PRInt32 & aBorderStyle,
|
|
|
|
PRInt32 & aBorderColor);
|
|
|
|
void TryMarginOrPaddingShorthand(nsAWritableString & aString,
|
|
|
|
nsCSSProperty aShorthand,
|
|
|
|
PRInt32 & aTop, PRInt32 & aBottom,
|
|
|
|
PRInt32 & aLeft, PRInt32 & aRight);
|
|
|
|
void TryBackgroundShorthand(nsAWritableString & aString,
|
|
|
|
PRInt32 & aBgColor, PRInt32 & aBgImage,
|
|
|
|
PRInt32 & aBgRepeat, PRInt32 & aBgAttachment,
|
|
|
|
PRInt32 & aBgPositionX,
|
|
|
|
PRInt32 & aBgPositionY);
|
|
|
|
void TryBackgroundPosition(nsAWritableString & aString,
|
|
|
|
PRInt32 & aBgPositionX,
|
|
|
|
PRInt32 & aBgPositionY);
|
|
|
|
|
|
|
|
PRBool AllPropertiesSameValue(PRInt32 aFirst, PRInt32 aSecond,
|
|
|
|
PRInt32 aThird, PRInt32 aFourth);
|
|
|
|
void AppendPropertyAndValueToString(nsCSSProperty aProperty,
|
|
|
|
nsAWritableString& aResult);
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
protected:
|
|
|
|
nsCSSFont* mFont;
|
|
|
|
nsCSSColor* mColor;
|
|
|
|
nsCSSText* mText;
|
|
|
|
nsCSSMargin* mMargin;
|
|
|
|
nsCSSPosition* mPosition;
|
|
|
|
nsCSSList* mList;
|
1998-04-25 22:43:42 +04:00
|
|
|
nsCSSDisplay* mDisplay;
|
1998-10-08 05:31:58 +04:00
|
|
|
nsCSSTable* mTable;
|
|
|
|
nsCSSBreaks* mBreaks;
|
|
|
|
nsCSSPage* mPage;
|
|
|
|
nsCSSContent* mContent;
|
1999-07-24 23:04:42 +04:00
|
|
|
nsCSSUserInterface* mUserInterface;
|
1998-10-08 05:31:58 +04:00
|
|
|
nsCSSAural* mAural;
|
2001-03-06 05:30:30 +03:00
|
|
|
#ifdef INCLUDE_XUL
|
|
|
|
nsCSSXUL* mXUL;
|
|
|
|
#endif
|
1998-06-26 09:51:55 +04:00
|
|
|
|
|
|
|
CSSDeclarationImpl* mImportant;
|
1998-07-17 09:50:35 +04:00
|
|
|
|
|
|
|
nsVoidArray* mOrder;
|
1999-06-03 05:58:11 +04:00
|
|
|
nsStringArray* mComments;
|
1998-04-14 00:24:54 +04:00
|
|
|
};
|
|
|
|
|
1998-04-22 10:38:31 +04:00
|
|
|
#ifdef DEBUG_REFS
|
|
|
|
static PRInt32 gInstanceCount;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
1999-02-26 23:02:06 +03:00
|
|
|
NS_IMPL_ZEROING_OPERATOR_NEW(CSSDeclarationImpl)
|
1999-02-26 20:13:10 +03:00
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
CSSDeclarationImpl::CSSDeclarationImpl(void)
|
|
|
|
{
|
|
|
|
NS_INIT_REFCNT();
|
1998-04-22 10:38:31 +04:00
|
|
|
#ifdef DEBUG_REFS
|
|
|
|
++gInstanceCount;
|
2000-10-29 02:17:53 +04:00
|
|
|
fprintf(stdout, "CSSDeclaration Instances (ctor): %ld\n", (long)gInstanceCount);
|
1998-04-22 10:38:31 +04:00
|
|
|
#endif
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
|
1999-06-03 05:58:11 +04:00
|
|
|
#define DECL_IF_COPY(type) \
|
|
|
|
if (aCopy.m##type) m##type = new nsCSS##type(*(aCopy.m##type))
|
|
|
|
|
|
|
|
CSSDeclarationImpl::CSSDeclarationImpl(const CSSDeclarationImpl& aCopy)
|
|
|
|
{
|
|
|
|
NS_INIT_REFCNT();
|
|
|
|
DECL_IF_COPY(Font);
|
|
|
|
DECL_IF_COPY(Color);
|
|
|
|
DECL_IF_COPY(Text);
|
|
|
|
DECL_IF_COPY(Margin);
|
|
|
|
DECL_IF_COPY(Position);
|
|
|
|
DECL_IF_COPY(List);
|
|
|
|
DECL_IF_COPY(Display);
|
|
|
|
DECL_IF_COPY(Table);
|
|
|
|
DECL_IF_COPY(Breaks);
|
|
|
|
DECL_IF_COPY(Page);
|
|
|
|
DECL_IF_COPY(Content);
|
1999-07-24 23:04:42 +04:00
|
|
|
DECL_IF_COPY(UserInterface);
|
1999-06-03 05:58:11 +04:00
|
|
|
DECL_IF_COPY(Aural);
|
2001-03-06 05:30:30 +03:00
|
|
|
#ifdef INCLUDE_XUL
|
|
|
|
DECL_IF_COPY(XUL);
|
|
|
|
#endif
|
1999-06-03 05:58:11 +04:00
|
|
|
|
2000-03-31 11:08:36 +04:00
|
|
|
#ifdef DEBUG_REFS
|
|
|
|
++gInstanceCount;
|
2000-10-29 02:17:53 +04:00
|
|
|
fprintf(stdout, "CSSDeclaration Instances (cp-ctor): %ld\n", (long)gInstanceCount);
|
2000-03-31 11:08:36 +04:00
|
|
|
#endif
|
|
|
|
|
1999-06-03 05:58:11 +04:00
|
|
|
if (aCopy.mImportant) {
|
|
|
|
mImportant = new CSSDeclarationImpl(*(aCopy.mImportant));
|
|
|
|
NS_IF_ADDREF(mImportant);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (aCopy.mOrder) {
|
2001-08-27 10:15:54 +04:00
|
|
|
mOrder = new nsAutoVoidArray();
|
1999-06-03 05:58:11 +04:00
|
|
|
if (mOrder) {
|
|
|
|
(*mOrder) = *(aCopy.mOrder);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (aCopy.mComments) {
|
|
|
|
mComments = new nsStringArray();
|
|
|
|
if (mComments) {
|
|
|
|
(*mComments) = *(aCopy.mComments);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
CSSDeclarationImpl::~CSSDeclarationImpl(void)
|
|
|
|
{
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_IF_DELETE(mFont);
|
|
|
|
CSS_IF_DELETE(mColor);
|
|
|
|
CSS_IF_DELETE(mText);
|
|
|
|
CSS_IF_DELETE(mMargin);
|
|
|
|
CSS_IF_DELETE(mPosition);
|
|
|
|
CSS_IF_DELETE(mList);
|
|
|
|
CSS_IF_DELETE(mDisplay);
|
|
|
|
CSS_IF_DELETE(mTable);
|
|
|
|
CSS_IF_DELETE(mBreaks);
|
|
|
|
CSS_IF_DELETE(mPage);
|
|
|
|
CSS_IF_DELETE(mContent);
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_IF_DELETE(mUserInterface);
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_IF_DELETE(mAural);
|
2001-03-06 05:30:30 +03:00
|
|
|
#ifdef INCLUDE_XUL
|
|
|
|
CSS_IF_DELETE(mXUL);
|
|
|
|
#endif
|
1998-10-08 05:31:58 +04:00
|
|
|
|
1998-06-26 09:51:55 +04:00
|
|
|
NS_IF_RELEASE(mImportant);
|
1998-10-27 02:22:40 +03:00
|
|
|
CSS_IF_DELETE(mOrder);
|
1999-06-03 05:58:11 +04:00
|
|
|
CSS_IF_DELETE(mComments);
|
1998-06-26 09:51:55 +04:00
|
|
|
|
1998-04-22 10:38:31 +04:00
|
|
|
#ifdef DEBUG_REFS
|
|
|
|
--gInstanceCount;
|
2000-10-29 02:17:53 +04:00
|
|
|
fprintf(stdout, "CSSDeclaration Instances (dtor): %ld\n", (long)gInstanceCount);
|
1998-04-22 10:38:31 +04:00
|
|
|
#endif
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
|
2001-08-21 05:48:11 +04:00
|
|
|
NS_IMPL_ISUPPORTS1(CSSDeclarationImpl, nsICSSDeclaration)
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
#define CSS_IF_GET_ELSE(sid,ptr,result) \
|
|
|
|
if (sid.Equals(kCSS##ptr##SID)) { *result = m##ptr; } else
|
|
|
|
|
1999-01-06 04:25:39 +03:00
|
|
|
NS_IMETHODIMP
|
|
|
|
CSSDeclarationImpl::GetData(const nsID& aSID, nsCSSStruct** aDataPtr)
|
1998-04-14 00:24:54 +04:00
|
|
|
{
|
|
|
|
if (nsnull == aDataPtr) {
|
|
|
|
return NS_ERROR_NULL_POINTER;
|
|
|
|
}
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_IF_GET_ELSE(aSID, Font, aDataPtr)
|
|
|
|
CSS_IF_GET_ELSE(aSID, Color, aDataPtr)
|
|
|
|
CSS_IF_GET_ELSE(aSID, Display, aDataPtr)
|
|
|
|
CSS_IF_GET_ELSE(aSID, Text, aDataPtr)
|
|
|
|
CSS_IF_GET_ELSE(aSID, Margin, aDataPtr)
|
|
|
|
CSS_IF_GET_ELSE(aSID, Position, aDataPtr)
|
|
|
|
CSS_IF_GET_ELSE(aSID, List, aDataPtr)
|
|
|
|
CSS_IF_GET_ELSE(aSID, Table, aDataPtr)
|
|
|
|
CSS_IF_GET_ELSE(aSID, Breaks, aDataPtr)
|
|
|
|
CSS_IF_GET_ELSE(aSID, Page, aDataPtr)
|
|
|
|
CSS_IF_GET_ELSE(aSID, Content, aDataPtr)
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_IF_GET_ELSE(aSID, UserInterface, aDataPtr)
|
2001-03-06 05:30:30 +03:00
|
|
|
CSS_IF_GET_ELSE(aSID, Aural, aDataPtr)
|
|
|
|
#ifdef INCLUDE_XUL
|
|
|
|
CSS_IF_GET_ELSE(aSID, XUL, aDataPtr)
|
|
|
|
#endif
|
|
|
|
{
|
1998-04-14 00:24:54 +04:00
|
|
|
return NS_NOINTERFACE;
|
|
|
|
}
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
#define CSS_IF_ENSURE_ELSE(sid,ptr,result) \
|
|
|
|
if (sid.Equals(kCSS##ptr##SID)) { \
|
|
|
|
if (nsnull == m##ptr) { m##ptr = new nsCSS##ptr(); } \
|
|
|
|
*result = m##ptr; \
|
|
|
|
} else
|
|
|
|
|
1999-01-06 04:25:39 +03:00
|
|
|
NS_IMETHODIMP
|
|
|
|
CSSDeclarationImpl::EnsureData(const nsID& aSID, nsCSSStruct** aDataPtr)
|
1998-04-14 00:24:54 +04:00
|
|
|
{
|
|
|
|
if (nsnull == aDataPtr) {
|
|
|
|
return NS_ERROR_NULL_POINTER;
|
|
|
|
}
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_IF_ENSURE_ELSE(aSID, Font, aDataPtr)
|
|
|
|
CSS_IF_ENSURE_ELSE(aSID, Color, aDataPtr)
|
|
|
|
CSS_IF_ENSURE_ELSE(aSID, Display, aDataPtr)
|
|
|
|
CSS_IF_ENSURE_ELSE(aSID, Text, aDataPtr)
|
|
|
|
CSS_IF_ENSURE_ELSE(aSID, Margin, aDataPtr)
|
|
|
|
CSS_IF_ENSURE_ELSE(aSID, Position, aDataPtr)
|
|
|
|
CSS_IF_ENSURE_ELSE(aSID, List, aDataPtr)
|
|
|
|
CSS_IF_ENSURE_ELSE(aSID, Table, aDataPtr)
|
|
|
|
CSS_IF_ENSURE_ELSE(aSID, Breaks, aDataPtr)
|
|
|
|
CSS_IF_ENSURE_ELSE(aSID, Page, aDataPtr)
|
|
|
|
CSS_IF_ENSURE_ELSE(aSID, Content, aDataPtr)
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_IF_ENSURE_ELSE(aSID, UserInterface, aDataPtr)
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_IF_ENSURE_ELSE(aSID, Aural, aDataPtr) {
|
1998-04-14 00:24:54 +04:00
|
|
|
return NS_NOINTERFACE;
|
|
|
|
}
|
|
|
|
if (nsnull == *aDataPtr) {
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
}
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
#define CSS_ENSURE(data) \
|
|
|
|
if (nsnull == m##data) { \
|
|
|
|
m##data = new nsCSS##data(); \
|
|
|
|
} \
|
|
|
|
if (nsnull == m##data) { \
|
|
|
|
result = NS_ERROR_OUT_OF_MEMORY; \
|
|
|
|
} \
|
|
|
|
else
|
|
|
|
|
|
|
|
#define CSS_ENSURE_RECT(data) \
|
|
|
|
if (nsnull == data) { \
|
|
|
|
data = new nsCSSRect(); \
|
|
|
|
} \
|
|
|
|
if (nsnull == data) { \
|
|
|
|
result = NS_ERROR_OUT_OF_MEMORY; \
|
|
|
|
} \
|
|
|
|
else
|
|
|
|
|
1998-10-27 02:22:40 +03:00
|
|
|
#define CSS_ENSURE_DATA(data,type) \
|
|
|
|
if (nsnull == data) { \
|
|
|
|
data = new type(); \
|
|
|
|
} \
|
|
|
|
if (nsnull == data) { \
|
|
|
|
result = NS_ERROR_OUT_OF_MEMORY; \
|
|
|
|
} \
|
|
|
|
else
|
|
|
|
|
1999-07-24 23:04:42 +04:00
|
|
|
#define CSS_BOGUS_DEFAULT default: NS_ERROR("should never happen"); break;
|
|
|
|
|
1999-01-06 04:25:39 +03:00
|
|
|
NS_IMETHODIMP
|
1999-07-18 04:25:28 +04:00
|
|
|
CSSDeclarationImpl::AppendValue(nsCSSProperty aProperty, const nsCSSValue& aValue)
|
1998-04-14 00:24:54 +04:00
|
|
|
{
|
|
|
|
nsresult result = NS_OK;
|
|
|
|
|
|
|
|
switch (aProperty) {
|
|
|
|
// nsCSSFont
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_font_family:
|
|
|
|
case eCSSProperty_font_style:
|
|
|
|
case eCSSProperty_font_variant:
|
|
|
|
case eCSSProperty_font_weight:
|
|
|
|
case eCSSProperty_font_size:
|
|
|
|
case eCSSProperty_font_size_adjust:
|
|
|
|
case eCSSProperty_font_stretch:
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_ENSURE(Font) {
|
1998-04-14 00:24:54 +04:00
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_font_family: mFont->mFamily = aValue; break;
|
|
|
|
case eCSSProperty_font_style: mFont->mStyle = aValue; break;
|
|
|
|
case eCSSProperty_font_variant: mFont->mVariant = aValue; break;
|
|
|
|
case eCSSProperty_font_weight: mFont->mWeight = aValue; break;
|
|
|
|
case eCSSProperty_font_size: mFont->mSize = aValue; break;
|
|
|
|
case eCSSProperty_font_size_adjust: mFont->mSizeAdjust = aValue; break;
|
|
|
|
case eCSSProperty_font_stretch: mFont->mStretch = aValue; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSColor
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_color:
|
|
|
|
case eCSSProperty_background_color:
|
|
|
|
case eCSSProperty_background_image:
|
|
|
|
case eCSSProperty_background_repeat:
|
|
|
|
case eCSSProperty_background_attachment:
|
|
|
|
case eCSSProperty_background_x_position:
|
|
|
|
case eCSSProperty_background_y_position:
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_ENSURE(Color) {
|
1998-04-14 00:24:54 +04:00
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_color: mColor->mColor = aValue; break;
|
|
|
|
case eCSSProperty_background_color: mColor->mBackColor = aValue; break;
|
|
|
|
case eCSSProperty_background_image: mColor->mBackImage = aValue; break;
|
|
|
|
case eCSSProperty_background_repeat: mColor->mBackRepeat = aValue; break;
|
|
|
|
case eCSSProperty_background_attachment: mColor->mBackAttachment = aValue; break;
|
|
|
|
case eCSSProperty_background_x_position: mColor->mBackPositionX = aValue; break;
|
|
|
|
case eCSSProperty_background_y_position: mColor->mBackPositionY = aValue; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSText
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_word_spacing:
|
|
|
|
case eCSSProperty_letter_spacing:
|
|
|
|
case eCSSProperty_text_decoration:
|
|
|
|
case eCSSProperty_vertical_align:
|
|
|
|
case eCSSProperty_text_transform:
|
|
|
|
case eCSSProperty_text_align:
|
|
|
|
case eCSSProperty_text_indent:
|
|
|
|
case eCSSProperty_unicode_bidi:
|
|
|
|
case eCSSProperty_line_height:
|
|
|
|
case eCSSProperty_white_space:
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_ENSURE(Text) {
|
1998-04-14 00:24:54 +04:00
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_word_spacing: mText->mWordSpacing = aValue; break;
|
|
|
|
case eCSSProperty_letter_spacing: mText->mLetterSpacing = aValue; break;
|
|
|
|
case eCSSProperty_text_decoration: mText->mDecoration = aValue; break;
|
|
|
|
case eCSSProperty_vertical_align: mText->mVerticalAlign = aValue; break;
|
|
|
|
case eCSSProperty_text_transform: mText->mTextTransform = aValue; break;
|
|
|
|
case eCSSProperty_text_align: mText->mTextAlign = aValue; break;
|
|
|
|
case eCSSProperty_text_indent: mText->mTextIndent = aValue; break;
|
|
|
|
case eCSSProperty_unicode_bidi: mText->mUnicodeBidi = aValue; break;
|
|
|
|
case eCSSProperty_line_height: mText->mLineHeight = aValue; break;
|
|
|
|
case eCSSProperty_white_space: mText->mWhiteSpace = aValue; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
}
|
1998-10-08 05:31:58 +04:00
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_text_shadow_color:
|
|
|
|
case eCSSProperty_text_shadow_radius:
|
|
|
|
case eCSSProperty_text_shadow_x:
|
|
|
|
case eCSSProperty_text_shadow_y:
|
1998-10-27 02:22:40 +03:00
|
|
|
CSS_ENSURE(Text) {
|
|
|
|
CSS_ENSURE_DATA(mText->mTextShadow, nsCSSShadow) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_text_shadow_color: mText->mTextShadow->mColor = aValue; break;
|
|
|
|
case eCSSProperty_text_shadow_radius: mText->mTextShadow->mRadius = aValue; break;
|
|
|
|
case eCSSProperty_text_shadow_x: mText->mTextShadow->mXOffset = aValue; break;
|
|
|
|
case eCSSProperty_text_shadow_y: mText->mTextShadow->mYOffset = aValue; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-10-27 02:22:40 +03:00
|
|
|
}
|
|
|
|
CSS_IF_DELETE(mText->mTextShadow->mNext);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
// nsCSSDisplay
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_float:
|
|
|
|
case eCSSProperty_clear:
|
|
|
|
case eCSSProperty_display:
|
2001-06-01 02:19:43 +04:00
|
|
|
case eCSSProperty_binding:
|
|
|
|
case eCSSProperty_position:
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_direction:
|
|
|
|
case eCSSProperty_visibility:
|
2001-06-01 02:19:43 +04:00
|
|
|
case eCSSProperty_opacity:
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_overflow:
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_ENSURE(Display) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_float: mDisplay->mFloat = aValue; break;
|
|
|
|
case eCSSProperty_clear: mDisplay->mClear = aValue; break;
|
|
|
|
case eCSSProperty_display: mDisplay->mDisplay = aValue; break;
|
2001-06-01 02:19:43 +04:00
|
|
|
case eCSSProperty_position: mDisplay->mPosition = aValue; break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_direction: mDisplay->mDirection = aValue; break;
|
|
|
|
case eCSSProperty_visibility: mDisplay->mVisibility = aValue; break;
|
2001-06-01 02:19:43 +04:00
|
|
|
case eCSSProperty_opacity: mDisplay->mOpacity = aValue; break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_overflow: mDisplay->mOverflow = aValue; break;
|
2001-06-01 02:19:43 +04:00
|
|
|
case eCSSProperty_binding:
|
|
|
|
mDisplay->mBinding = aValue;
|
|
|
|
break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_clip_top:
|
|
|
|
case eCSSProperty_clip_right:
|
|
|
|
case eCSSProperty_clip_bottom:
|
|
|
|
case eCSSProperty_clip_left:
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_ENSURE(Display) {
|
|
|
|
CSS_ENSURE_RECT(mDisplay->mClip) {
|
|
|
|
switch(aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_clip_top: mDisplay->mClip->mTop = aValue; break;
|
|
|
|
case eCSSProperty_clip_right: mDisplay->mClip->mRight = aValue; break;
|
|
|
|
case eCSSProperty_clip_bottom: mDisplay->mClip->mBottom = aValue; break;
|
|
|
|
case eCSSProperty_clip_left: mDisplay->mClip->mLeft = aValue; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
}
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSMargin
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_margin_top:
|
|
|
|
case eCSSProperty_margin_right:
|
|
|
|
case eCSSProperty_margin_bottom:
|
|
|
|
case eCSSProperty_margin_left:
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_ENSURE(Margin) {
|
|
|
|
CSS_ENSURE_RECT(mMargin->mMargin) {
|
1998-04-14 00:24:54 +04:00
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_margin_top: mMargin->mMargin->mTop = aValue; break;
|
|
|
|
case eCSSProperty_margin_right: mMargin->mMargin->mRight = aValue; break;
|
|
|
|
case eCSSProperty_margin_bottom: mMargin->mMargin->mBottom = aValue; break;
|
|
|
|
case eCSSProperty_margin_left: mMargin->mMargin->mLeft = aValue; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_padding_top:
|
|
|
|
case eCSSProperty_padding_right:
|
|
|
|
case eCSSProperty_padding_bottom:
|
|
|
|
case eCSSProperty_padding_left:
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_ENSURE(Margin) {
|
|
|
|
CSS_ENSURE_RECT(mMargin->mPadding) {
|
1998-04-14 00:24:54 +04:00
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_padding_top: mMargin->mPadding->mTop = aValue; break;
|
|
|
|
case eCSSProperty_padding_right: mMargin->mPadding->mRight = aValue; break;
|
|
|
|
case eCSSProperty_padding_bottom: mMargin->mPadding->mBottom = aValue; break;
|
|
|
|
case eCSSProperty_padding_left: mMargin->mPadding->mLeft = aValue; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_top_width:
|
|
|
|
case eCSSProperty_border_right_width:
|
|
|
|
case eCSSProperty_border_bottom_width:
|
|
|
|
case eCSSProperty_border_left_width:
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_ENSURE(Margin) {
|
|
|
|
CSS_ENSURE_RECT(mMargin->mBorderWidth) {
|
1998-04-14 00:24:54 +04:00
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_top_width: mMargin->mBorderWidth->mTop = aValue; break;
|
|
|
|
case eCSSProperty_border_right_width: mMargin->mBorderWidth->mRight = aValue; break;
|
|
|
|
case eCSSProperty_border_bottom_width: mMargin->mBorderWidth->mBottom = aValue; break;
|
|
|
|
case eCSSProperty_border_left_width: mMargin->mBorderWidth->mLeft = aValue; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_top_color:
|
|
|
|
case eCSSProperty_border_right_color:
|
|
|
|
case eCSSProperty_border_bottom_color:
|
|
|
|
case eCSSProperty_border_left_color:
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_ENSURE(Margin) {
|
|
|
|
CSS_ENSURE_RECT(mMargin->mBorderColor) {
|
1998-04-14 00:24:54 +04:00
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_top_color: mMargin->mBorderColor->mTop = aValue; break;
|
|
|
|
case eCSSProperty_border_right_color: mMargin->mBorderColor->mRight = aValue; break;
|
|
|
|
case eCSSProperty_border_bottom_color: mMargin->mBorderColor->mBottom = aValue; break;
|
|
|
|
case eCSSProperty_border_left_color: mMargin->mBorderColor->mLeft = aValue; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_top_style:
|
|
|
|
case eCSSProperty_border_right_style:
|
|
|
|
case eCSSProperty_border_bottom_style:
|
|
|
|
case eCSSProperty_border_left_style:
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_ENSURE(Margin) {
|
|
|
|
CSS_ENSURE_RECT(mMargin->mBorderStyle) {
|
1998-04-14 00:24:54 +04:00
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_top_style: mMargin->mBorderStyle->mTop = aValue; break;
|
|
|
|
case eCSSProperty_border_right_style: mMargin->mBorderStyle->mRight = aValue; break;
|
|
|
|
case eCSSProperty_border_bottom_style: mMargin->mBorderStyle->mBottom = aValue; break;
|
|
|
|
case eCSSProperty_border_left_style: mMargin->mBorderStyle->mLeft = aValue; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1998-10-08 05:31:58 +04:00
|
|
|
break;
|
|
|
|
|
1999-12-22 14:27:10 +03:00
|
|
|
case eCSSProperty__moz_border_radius_topLeft:
|
|
|
|
case eCSSProperty__moz_border_radius_topRight:
|
|
|
|
case eCSSProperty__moz_border_radius_bottomRight:
|
|
|
|
case eCSSProperty__moz_border_radius_bottomLeft:
|
|
|
|
CSS_ENSURE(Margin) {
|
|
|
|
CSS_ENSURE_RECT(mMargin->mBorderRadius) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty__moz_border_radius_topLeft: mMargin->mBorderRadius->mTop = aValue; break;
|
|
|
|
case eCSSProperty__moz_border_radius_topRight: mMargin->mBorderRadius->mRight = aValue; break;
|
|
|
|
case eCSSProperty__moz_border_radius_bottomRight: mMargin->mBorderRadius->mBottom = aValue; break;
|
|
|
|
case eCSSProperty__moz_border_radius_bottomLeft: mMargin->mBorderRadius->mLeft = aValue; break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2000-01-24 14:19:55 +03:00
|
|
|
case eCSSProperty__moz_outline_radius_topLeft:
|
|
|
|
case eCSSProperty__moz_outline_radius_topRight:
|
|
|
|
case eCSSProperty__moz_outline_radius_bottomRight:
|
|
|
|
case eCSSProperty__moz_outline_radius_bottomLeft:
|
|
|
|
CSS_ENSURE(Margin) {
|
|
|
|
CSS_ENSURE_RECT(mMargin->mOutlineRadius) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty__moz_outline_radius_topLeft: mMargin->mOutlineRadius->mTop = aValue; break;
|
|
|
|
case eCSSProperty__moz_outline_radius_topRight: mMargin->mOutlineRadius->mRight = aValue; break;
|
|
|
|
case eCSSProperty__moz_outline_radius_bottomRight: mMargin->mOutlineRadius->mBottom = aValue; break;
|
|
|
|
case eCSSProperty__moz_outline_radius_bottomLeft: mMargin->mOutlineRadius->mLeft = aValue; break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_outline_width:
|
|
|
|
case eCSSProperty_outline_color:
|
|
|
|
case eCSSProperty_outline_style:
|
1999-07-24 23:04:42 +04:00
|
|
|
case eCSSProperty_float_edge:
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_ENSURE(Margin) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_outline_width: mMargin->mOutlineWidth = aValue; break;
|
|
|
|
case eCSSProperty_outline_color: mMargin->mOutlineColor = aValue; break;
|
|
|
|
case eCSSProperty_outline_style: mMargin->mOutlineStyle = aValue; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
case eCSSProperty_float_edge: mMargin->mFloatEdge = aValue; break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSPosition
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_width:
|
|
|
|
case eCSSProperty_min_width:
|
|
|
|
case eCSSProperty_max_width:
|
|
|
|
case eCSSProperty_height:
|
|
|
|
case eCSSProperty_min_height:
|
|
|
|
case eCSSProperty_max_height:
|
1999-07-24 23:04:42 +04:00
|
|
|
case eCSSProperty_box_sizing:
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_z_index:
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_ENSURE(Position) {
|
1998-04-14 00:24:54 +04:00
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_width: mPosition->mWidth = aValue; break;
|
|
|
|
case eCSSProperty_min_width: mPosition->mMinWidth = aValue; break;
|
|
|
|
case eCSSProperty_max_width: mPosition->mMaxWidth = aValue; break;
|
|
|
|
case eCSSProperty_height: mPosition->mHeight = aValue; break;
|
|
|
|
case eCSSProperty_min_height: mPosition->mMinHeight = aValue; break;
|
|
|
|
case eCSSProperty_max_height: mPosition->mMaxHeight = aValue; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
case eCSSProperty_box_sizing: mPosition->mBoxSizing = aValue; break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_z_index: mPosition->mZIndex = aValue; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
}
|
1998-10-08 05:31:58 +04:00
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_top:
|
|
|
|
case eCSSProperty_right:
|
|
|
|
case eCSSProperty_bottom:
|
|
|
|
case eCSSProperty_left:
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_ENSURE(Position) {
|
|
|
|
CSS_ENSURE_RECT(mPosition->mOffset) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_top: mPosition->mOffset->mTop = aValue; break;
|
|
|
|
case eCSSProperty_right: mPosition->mOffset->mRight= aValue; break;
|
|
|
|
case eCSSProperty_bottom: mPosition->mOffset->mBottom = aValue; break;
|
|
|
|
case eCSSProperty_left: mPosition->mOffset->mLeft = aValue; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
}
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSList
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_list_style_type:
|
|
|
|
case eCSSProperty_list_style_image:
|
|
|
|
case eCSSProperty_list_style_position:
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_ENSURE(List) {
|
1998-04-14 00:24:54 +04:00
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_list_style_type: mList->mType = aValue; break;
|
|
|
|
case eCSSProperty_list_style_image: mList->mImage = aValue; break;
|
|
|
|
case eCSSProperty_list_style_position: mList->mPosition = aValue; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2001-12-05 11:35:05 +03:00
|
|
|
case eCSSProperty_image_region_top:
|
|
|
|
case eCSSProperty_image_region_right:
|
|
|
|
case eCSSProperty_image_region_bottom:
|
|
|
|
case eCSSProperty_image_region_left:
|
|
|
|
CSS_ENSURE(List) {
|
|
|
|
CSS_ENSURE_RECT(mList->mImageRegion) {
|
|
|
|
switch(aProperty) {
|
|
|
|
case eCSSProperty_image_region_top: mList->mImageRegion->mTop = aValue; break;
|
|
|
|
case eCSSProperty_image_region_right: mList->mImageRegion->mRight = aValue; break;
|
|
|
|
case eCSSProperty_image_region_bottom: mList->mImageRegion->mBottom = aValue; break;
|
|
|
|
case eCSSProperty_image_region_left: mList->mImageRegion->mLeft = aValue; break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
// nsCSSTable
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_collapse:
|
|
|
|
case eCSSProperty_border_x_spacing:
|
|
|
|
case eCSSProperty_border_y_spacing:
|
|
|
|
case eCSSProperty_caption_side:
|
|
|
|
case eCSSProperty_empty_cells:
|
|
|
|
case eCSSProperty_table_layout:
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_ENSURE(Table) {
|
1998-04-25 22:43:42 +04:00
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_collapse: mTable->mBorderCollapse = aValue; break;
|
|
|
|
case eCSSProperty_border_x_spacing: mTable->mBorderSpacingX = aValue; break;
|
|
|
|
case eCSSProperty_border_y_spacing: mTable->mBorderSpacingY = aValue; break;
|
|
|
|
case eCSSProperty_caption_side: mTable->mCaptionSide = aValue; break;
|
|
|
|
case eCSSProperty_empty_cells: mTable->mEmptyCells = aValue; break;
|
|
|
|
case eCSSProperty_table_layout: mTable->mLayout = aValue; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-05-27 03:16:55 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
// nsCSSBreaks
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_orphans:
|
|
|
|
case eCSSProperty_widows:
|
|
|
|
case eCSSProperty_page:
|
|
|
|
case eCSSProperty_page_break_after:
|
|
|
|
case eCSSProperty_page_break_before:
|
|
|
|
case eCSSProperty_page_break_inside:
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_ENSURE(Breaks) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_orphans: mBreaks->mOrphans = aValue; break;
|
|
|
|
case eCSSProperty_widows: mBreaks->mWidows = aValue; break;
|
|
|
|
case eCSSProperty_page: mBreaks->mPage = aValue; break;
|
|
|
|
case eCSSProperty_page_break_after: mBreaks->mPageBreakAfter = aValue; break;
|
|
|
|
case eCSSProperty_page_break_before: mBreaks->mPageBreakBefore = aValue; break;
|
|
|
|
case eCSSProperty_page_break_inside: mBreaks->mPageBreakInside = aValue; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-05-27 03:16:55 +04:00
|
|
|
}
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSPage
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_marks:
|
|
|
|
case eCSSProperty_size_width:
|
|
|
|
case eCSSProperty_size_height:
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_ENSURE(Page) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_marks: mPage->mMarks = aValue; break;
|
|
|
|
case eCSSProperty_size_width: mPage->mSizeWidth = aValue; break;
|
|
|
|
case eCSSProperty_size_height: mPage->mSizeHeight = aValue; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-05-27 03:16:55 +04:00
|
|
|
}
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSContent
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_content:
|
|
|
|
case eCSSProperty_counter_increment:
|
|
|
|
case eCSSProperty_counter_reset:
|
|
|
|
case eCSSProperty_marker_offset:
|
|
|
|
case eCSSProperty_quotes_open:
|
|
|
|
case eCSSProperty_quotes_close:
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_ENSURE(Content) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_content:
|
1998-10-27 02:22:40 +03:00
|
|
|
CSS_ENSURE_DATA(mContent->mContent, nsCSSValueList) {
|
|
|
|
mContent->mContent->mValue = aValue;
|
|
|
|
CSS_IF_DELETE(mContent->mContent->mNext);
|
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_counter_increment:
|
1998-10-27 02:22:40 +03:00
|
|
|
CSS_ENSURE_DATA(mContent->mCounterIncrement, nsCSSCounterData) {
|
|
|
|
mContent->mCounterIncrement->mCounter = aValue;
|
|
|
|
CSS_IF_DELETE(mContent->mCounterIncrement->mNext);
|
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_counter_reset:
|
1998-10-27 02:22:40 +03:00
|
|
|
CSS_ENSURE_DATA(mContent->mCounterReset, nsCSSCounterData) {
|
|
|
|
mContent->mCounterReset->mCounter = aValue;
|
|
|
|
CSS_IF_DELETE(mContent->mCounterReset->mNext);
|
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_marker_offset: mContent->mMarkerOffset = aValue; break;
|
|
|
|
case eCSSProperty_quotes_open:
|
1998-10-27 02:22:40 +03:00
|
|
|
CSS_ENSURE_DATA(mContent->mQuotes, nsCSSQuotes) {
|
|
|
|
mContent->mQuotes->mOpen = aValue;
|
|
|
|
CSS_IF_DELETE(mContent->mQuotes->mNext);
|
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_quotes_close:
|
1998-10-27 02:22:40 +03:00
|
|
|
CSS_ENSURE_DATA(mContent->mQuotes, nsCSSQuotes) {
|
|
|
|
mContent->mQuotes->mClose = aValue;
|
|
|
|
CSS_IF_DELETE(mContent->mQuotes->mNext);
|
|
|
|
}
|
|
|
|
break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSUserInterface
|
|
|
|
case eCSSProperty_user_input:
|
1999-09-04 03:40:35 +04:00
|
|
|
case eCSSProperty_user_modify:
|
|
|
|
case eCSSProperty_user_select:
|
1999-07-24 23:04:42 +04:00
|
|
|
case eCSSProperty_key_equivalent:
|
1999-09-04 03:40:35 +04:00
|
|
|
case eCSSProperty_user_focus:
|
1999-07-24 23:04:42 +04:00
|
|
|
case eCSSProperty_resizer:
|
2001-06-01 02:19:43 +04:00
|
|
|
case eCSSProperty_cursor:
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_ENSURE(UserInterface) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty_user_input: mUserInterface->mUserInput = aValue; break;
|
1999-09-04 03:40:35 +04:00
|
|
|
case eCSSProperty_user_modify: mUserInterface->mUserModify = aValue; break;
|
|
|
|
case eCSSProperty_user_select: mUserInterface->mUserSelect = aValue; break;
|
|
|
|
case eCSSProperty_key_equivalent:
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_ENSURE_DATA(mUserInterface->mKeyEquivalent, nsCSSValueList) {
|
|
|
|
mUserInterface->mKeyEquivalent->mValue = aValue;
|
|
|
|
CSS_IF_DELETE(mUserInterface->mKeyEquivalent->mNext);
|
|
|
|
}
|
1999-07-20 14:10:12 +04:00
|
|
|
break;
|
1999-09-04 03:40:35 +04:00
|
|
|
case eCSSProperty_user_focus: mUserInterface->mUserFocus = aValue; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
case eCSSProperty_resizer: mUserInterface->mResizer = aValue; break;
|
2001-06-01 02:19:43 +04:00
|
|
|
case eCSSProperty_cursor:
|
|
|
|
CSS_ENSURE_DATA(mUserInterface->mCursor, nsCSSValueList) {
|
|
|
|
mUserInterface->mCursor->mValue = aValue;
|
|
|
|
CSS_IF_DELETE(mUserInterface->mCursor->mNext);
|
|
|
|
}
|
2000-02-01 03:20:26 +03:00
|
|
|
break;
|
2001-06-01 02:19:43 +04:00
|
|
|
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-04-25 22:43:42 +04:00
|
|
|
}
|
|
|
|
}
|
1998-10-08 05:31:58 +04:00
|
|
|
break;
|
|
|
|
|
2001-03-06 05:30:30 +03:00
|
|
|
#ifdef INCLUDE_XUL
|
|
|
|
// nsCSSXUL
|
2001-08-02 04:09:27 +04:00
|
|
|
case eCSSProperty_box_align:
|
|
|
|
case eCSSProperty_box_direction:
|
|
|
|
case eCSSProperty_box_flex:
|
2001-03-06 05:30:30 +03:00
|
|
|
case eCSSProperty_box_orient:
|
2001-08-02 04:09:27 +04:00
|
|
|
case eCSSProperty_box_pack:
|
2001-09-26 02:17:00 +04:00
|
|
|
case eCSSProperty_box_ordinal_group:
|
2001-03-06 05:30:30 +03:00
|
|
|
CSS_ENSURE(XUL) {
|
|
|
|
switch (aProperty) {
|
2001-09-26 02:17:00 +04:00
|
|
|
case eCSSProperty_box_align: mXUL->mBoxAlign = aValue; break;
|
|
|
|
case eCSSProperty_box_direction: mXUL->mBoxDirection = aValue; break;
|
|
|
|
case eCSSProperty_box_flex: mXUL->mBoxFlex = aValue; break;
|
|
|
|
case eCSSProperty_box_orient: mXUL->mBoxOrient = aValue; break;
|
|
|
|
case eCSSProperty_box_pack: mXUL->mBoxPack = aValue; break;
|
|
|
|
case eCSSProperty_box_ordinal_group: mXUL->mBoxOrdinal = aValue; break;
|
2001-03-06 05:30:30 +03:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
// nsCSSAural
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_azimuth:
|
|
|
|
case eCSSProperty_elevation:
|
|
|
|
case eCSSProperty_cue_after:
|
|
|
|
case eCSSProperty_cue_before:
|
|
|
|
case eCSSProperty_pause_after:
|
|
|
|
case eCSSProperty_pause_before:
|
|
|
|
case eCSSProperty_pitch:
|
|
|
|
case eCSSProperty_pitch_range:
|
|
|
|
case eCSSProperty_play_during:
|
|
|
|
case eCSSProperty_play_during_flags:
|
|
|
|
case eCSSProperty_richness:
|
|
|
|
case eCSSProperty_speak:
|
|
|
|
case eCSSProperty_speak_header:
|
|
|
|
case eCSSProperty_speak_numeral:
|
|
|
|
case eCSSProperty_speak_punctuation:
|
|
|
|
case eCSSProperty_speech_rate:
|
|
|
|
case eCSSProperty_stress:
|
|
|
|
case eCSSProperty_voice_family:
|
|
|
|
case eCSSProperty_volume:
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_ENSURE(Aural) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_azimuth: mAural->mAzimuth = aValue; break;
|
|
|
|
case eCSSProperty_elevation: mAural->mElevation = aValue; break;
|
|
|
|
case eCSSProperty_cue_after: mAural->mCueAfter = aValue; break;
|
|
|
|
case eCSSProperty_cue_before: mAural->mCueBefore = aValue; break;
|
|
|
|
case eCSSProperty_pause_after: mAural->mPauseAfter = aValue; break;
|
|
|
|
case eCSSProperty_pause_before: mAural->mPauseBefore = aValue; break;
|
|
|
|
case eCSSProperty_pitch: mAural->mPitch = aValue; break;
|
|
|
|
case eCSSProperty_pitch_range: mAural->mPitchRange = aValue; break;
|
|
|
|
case eCSSProperty_play_during: mAural->mPlayDuring = aValue; break;
|
|
|
|
case eCSSProperty_play_during_flags: mAural->mPlayDuringFlags = aValue; break;
|
|
|
|
case eCSSProperty_richness: mAural->mRichness = aValue; break;
|
|
|
|
case eCSSProperty_speak: mAural->mSpeak = aValue; break;
|
|
|
|
case eCSSProperty_speak_header: mAural->mSpeakHeader = aValue; break;
|
|
|
|
case eCSSProperty_speak_numeral: mAural->mSpeakNumeral = aValue; break;
|
|
|
|
case eCSSProperty_speak_punctuation: mAural->mSpeakPunctuation = aValue; break;
|
|
|
|
case eCSSProperty_speech_rate: mAural->mSpeechRate = aValue; break;
|
|
|
|
case eCSSProperty_stress: mAural->mStress = aValue; break;
|
|
|
|
case eCSSProperty_voice_family: mAural->mVoiceFamily = aValue; break;
|
|
|
|
case eCSSProperty_volume: mAural->mVolume = aValue; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
1998-04-25 22:43:42 +04:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
// Shorthands
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_background:
|
|
|
|
case eCSSProperty_border:
|
|
|
|
case eCSSProperty_border_spacing:
|
|
|
|
case eCSSProperty_clip:
|
|
|
|
case eCSSProperty_cue:
|
|
|
|
case eCSSProperty_font:
|
2001-12-05 11:35:05 +03:00
|
|
|
case eCSSProperty_image_region:
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_list_style:
|
|
|
|
case eCSSProperty_margin:
|
|
|
|
case eCSSProperty_outline:
|
|
|
|
case eCSSProperty_padding:
|
|
|
|
case eCSSProperty_pause:
|
|
|
|
case eCSSProperty_quotes:
|
|
|
|
case eCSSProperty_size:
|
|
|
|
case eCSSProperty_text_shadow:
|
|
|
|
case eCSSProperty_background_position:
|
|
|
|
case eCSSProperty_border_top:
|
|
|
|
case eCSSProperty_border_right:
|
|
|
|
case eCSSProperty_border_bottom:
|
|
|
|
case eCSSProperty_border_left:
|
|
|
|
case eCSSProperty_border_color:
|
|
|
|
case eCSSProperty_border_style:
|
|
|
|
case eCSSProperty_border_width:
|
1999-12-22 14:27:10 +03:00
|
|
|
case eCSSProperty__moz_border_radius:
|
2000-04-28 12:35:40 +04:00
|
|
|
case eCSSProperty__moz_outline_radius:
|
1999-02-10 11:37:28 +03:00
|
|
|
NS_ERROR("can't append shorthand properties");
|
1999-07-24 23:04:42 +04:00
|
|
|
// default: // XXX explicitly removing default case so compiler will help find missed props
|
|
|
|
case eCSSProperty_UNKNOWN:
|
|
|
|
case eCSSProperty_COUNT:
|
1998-04-14 00:24:54 +04:00
|
|
|
result = NS_ERROR_ILLEGAL_VALUE;
|
|
|
|
break;
|
|
|
|
}
|
1998-07-17 09:50:35 +04:00
|
|
|
|
|
|
|
if (NS_OK == result) {
|
|
|
|
if (nsnull == mOrder) {
|
2001-08-27 10:15:54 +04:00
|
|
|
mOrder = new nsAutoVoidArray();
|
1998-07-17 09:50:35 +04:00
|
|
|
}
|
2001-08-27 10:15:54 +04:00
|
|
|
else {
|
|
|
|
// order IS important for CSS, so remove and add to the end
|
1998-07-17 09:50:35 +04:00
|
|
|
PRInt32 index = mOrder->IndexOf((void*)aProperty);
|
|
|
|
if (-1 != index) {
|
|
|
|
mOrder->RemoveElementAt(index);
|
|
|
|
}
|
2001-08-27 10:15:54 +04:00
|
|
|
}
|
|
|
|
if (nsnull != mOrder) {
|
1998-07-17 09:50:35 +04:00
|
|
|
if (eCSSUnit_Null != aValue.GetUnit()) {
|
1999-07-18 04:25:28 +04:00
|
|
|
mOrder->AppendElement((void*)(PRInt32)aProperty);
|
1998-07-17 09:50:35 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1998-04-14 00:24:54 +04:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
1999-02-10 11:37:28 +03:00
|
|
|
NS_IMETHODIMP
|
1999-07-18 04:25:28 +04:00
|
|
|
CSSDeclarationImpl::AppendStructValue(nsCSSProperty aProperty, void* aStruct)
|
1999-02-10 11:37:28 +03:00
|
|
|
{
|
|
|
|
NS_ASSERTION(nsnull != aStruct, "must have struct");
|
|
|
|
if (nsnull == aStruct) {
|
|
|
|
return NS_ERROR_NULL_POINTER;
|
|
|
|
}
|
|
|
|
nsresult result = NS_OK;
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_cursor:
|
2001-06-01 02:19:43 +04:00
|
|
|
CSS_ENSURE(UserInterface) {
|
|
|
|
CSS_IF_DELETE(mUserInterface->mCursor);
|
|
|
|
mUserInterface->mCursor = (nsCSSValueList*)aStruct;
|
1999-02-10 11:37:28 +03:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_text_shadow:
|
1999-02-10 11:37:28 +03:00
|
|
|
CSS_ENSURE(Text) {
|
|
|
|
CSS_IF_DELETE(mText->mTextShadow);
|
|
|
|
mText->mTextShadow = (nsCSSShadow*)aStruct;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_content:
|
1999-02-10 11:37:28 +03:00
|
|
|
CSS_ENSURE(Content) {
|
|
|
|
CSS_IF_DELETE(mContent->mContent);
|
|
|
|
mContent->mContent = (nsCSSValueList*)aStruct;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_counter_increment:
|
1999-02-10 11:37:28 +03:00
|
|
|
CSS_ENSURE(Content) {
|
|
|
|
CSS_IF_DELETE(mContent->mCounterIncrement);
|
|
|
|
mContent->mCounterIncrement = (nsCSSCounterData*)aStruct;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_counter_reset:
|
1999-02-10 11:37:28 +03:00
|
|
|
CSS_ENSURE(Content) {
|
|
|
|
CSS_IF_DELETE(mContent->mCounterReset);
|
|
|
|
mContent->mCounterReset = (nsCSSCounterData*)aStruct;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_quotes:
|
1999-02-10 11:37:28 +03:00
|
|
|
CSS_ENSURE(Content) {
|
|
|
|
CSS_IF_DELETE(mContent->mQuotes);
|
|
|
|
mContent->mQuotes = (nsCSSQuotes*)aStruct;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-24 23:04:42 +04:00
|
|
|
case eCSSProperty_key_equivalent:
|
|
|
|
CSS_ENSURE(UserInterface) {
|
|
|
|
CSS_IF_DELETE(mUserInterface->mKeyEquivalent);
|
|
|
|
mUserInterface->mKeyEquivalent = (nsCSSValueList*)aStruct;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2001-12-05 11:35:05 +03:00
|
|
|
case eCSSProperty_border_top_colors:
|
|
|
|
CSS_ENSURE(Margin) {
|
|
|
|
mMargin->EnsureBorderColors();
|
|
|
|
CSS_IF_DELETE(mMargin->mBorderColors[0]);
|
|
|
|
mMargin->mBorderColors[0] = (nsCSSValueList*)aStruct;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case eCSSProperty_border_right_colors:
|
|
|
|
CSS_ENSURE(Margin) {
|
|
|
|
mMargin->EnsureBorderColors();
|
|
|
|
CSS_IF_DELETE(mMargin->mBorderColors[1]);
|
|
|
|
mMargin->mBorderColors[1] = (nsCSSValueList*)aStruct;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case eCSSProperty_border_bottom_colors:
|
|
|
|
CSS_ENSURE(Margin) {
|
|
|
|
mMargin->EnsureBorderColors();
|
|
|
|
CSS_IF_DELETE(mMargin->mBorderColors[2]);
|
|
|
|
mMargin->mBorderColors[2] = (nsCSSValueList*)aStruct;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case eCSSProperty_border_left_colors:
|
|
|
|
CSS_ENSURE(Margin) {
|
|
|
|
mMargin->EnsureBorderColors();
|
|
|
|
CSS_IF_DELETE(mMargin->mBorderColors[3]);
|
|
|
|
mMargin->mBorderColors[3] = (nsCSSValueList*)aStruct;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-02-10 11:37:28 +03:00
|
|
|
default:
|
|
|
|
NS_ERROR("not a struct property");
|
|
|
|
result = NS_ERROR_ILLEGAL_VALUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (NS_OK == result) {
|
|
|
|
if (nsnull == mOrder) {
|
2001-08-27 10:15:54 +04:00
|
|
|
mOrder = new nsAutoVoidArray();
|
1999-02-10 11:37:28 +03:00
|
|
|
}
|
2001-08-27 10:15:54 +04:00
|
|
|
else {
|
|
|
|
// order IS important for CSS, so remove and add to the end
|
1999-07-18 04:25:28 +04:00
|
|
|
PRInt32 index = mOrder->IndexOf((void*)(PRInt32)aProperty);
|
1999-02-10 11:37:28 +03:00
|
|
|
if (-1 != index) {
|
|
|
|
mOrder->RemoveElementAt(index);
|
|
|
|
}
|
2001-08-27 10:15:54 +04:00
|
|
|
}
|
|
|
|
if (nsnull != mOrder) {
|
1999-07-18 04:25:28 +04:00
|
|
|
mOrder->AppendElement((void*)(PRInt32)aProperty);
|
1999-02-10 11:37:28 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
#define CSS_ENSURE_IMPORTANT(data) \
|
|
|
|
if (nsnull == mImportant->m##data) { \
|
|
|
|
mImportant->m##data = new nsCSS##data(); \
|
|
|
|
} \
|
|
|
|
if (nsnull == mImportant->m##data) { \
|
|
|
|
result = NS_ERROR_OUT_OF_MEMORY; \
|
|
|
|
} \
|
|
|
|
else
|
|
|
|
|
|
|
|
#define CSS_CASE_IMPORTANT(prop,data) \
|
|
|
|
case prop: mImportant->data = data; data.Reset(); break
|
|
|
|
|
1999-01-06 04:25:39 +03:00
|
|
|
NS_IMETHODIMP
|
1999-07-18 04:25:28 +04:00
|
|
|
CSSDeclarationImpl::SetValueImportant(nsCSSProperty aProperty)
|
1998-06-26 09:51:55 +04:00
|
|
|
{
|
|
|
|
nsresult result = NS_OK;
|
|
|
|
|
|
|
|
if (nsnull == mImportant) {
|
|
|
|
mImportant = new CSSDeclarationImpl();
|
|
|
|
if (nsnull != mImportant) {
|
|
|
|
NS_ADDREF(mImportant);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
result = NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (NS_OK == result) {
|
|
|
|
switch (aProperty) {
|
|
|
|
// nsCSSFont
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_font_family:
|
|
|
|
case eCSSProperty_font_style:
|
|
|
|
case eCSSProperty_font_variant:
|
|
|
|
case eCSSProperty_font_weight:
|
|
|
|
case eCSSProperty_font_size:
|
|
|
|
case eCSSProperty_font_size_adjust:
|
|
|
|
case eCSSProperty_font_stretch:
|
1998-06-26 09:51:55 +04:00
|
|
|
if (nsnull != mFont) {
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_ENSURE_IMPORTANT(Font) {
|
1998-06-26 09:51:55 +04:00
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_font_family, mFont->mFamily);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_font_style, mFont->mStyle);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_font_variant, mFont->mVariant);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_font_weight, mFont->mWeight);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_font_size, mFont->mSize);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_font_size_adjust, mFont->mSizeAdjust);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_font_stretch, mFont->mStretch);
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-06-26 09:51:55 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSColor
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_color:
|
|
|
|
case eCSSProperty_background_color:
|
|
|
|
case eCSSProperty_background_image:
|
|
|
|
case eCSSProperty_background_repeat:
|
|
|
|
case eCSSProperty_background_attachment:
|
|
|
|
case eCSSProperty_background_x_position:
|
|
|
|
case eCSSProperty_background_y_position:
|
1998-06-26 09:51:55 +04:00
|
|
|
if (nsnull != mColor) {
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_ENSURE_IMPORTANT(Color) {
|
1998-06-26 09:51:55 +04:00
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_color, mColor->mColor);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_background_color, mColor->mBackColor);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_background_image, mColor->mBackImage);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_background_repeat, mColor->mBackRepeat);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_background_attachment, mColor->mBackAttachment);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_background_x_position, mColor->mBackPositionX);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_background_y_position, mColor->mBackPositionY);
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-06-26 09:51:55 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSText
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_word_spacing:
|
|
|
|
case eCSSProperty_letter_spacing:
|
|
|
|
case eCSSProperty_text_decoration:
|
|
|
|
case eCSSProperty_vertical_align:
|
|
|
|
case eCSSProperty_text_transform:
|
|
|
|
case eCSSProperty_text_align:
|
|
|
|
case eCSSProperty_text_indent:
|
|
|
|
case eCSSProperty_unicode_bidi:
|
|
|
|
case eCSSProperty_line_height:
|
|
|
|
case eCSSProperty_white_space:
|
1998-06-26 09:51:55 +04:00
|
|
|
if (nsnull != mText) {
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_ENSURE_IMPORTANT(Text) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_word_spacing, mText->mWordSpacing);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_letter_spacing, mText->mLetterSpacing);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_text_decoration, mText->mDecoration);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_vertical_align, mText->mVerticalAlign);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_text_transform, mText->mTextTransform);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_text_align, mText->mTextAlign);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_text_indent, mText->mTextIndent);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_unicode_bidi, mText->mUnicodeBidi);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_line_height, mText->mLineHeight);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_white_space, mText->mWhiteSpace);
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
1998-06-26 09:51:55 +04:00
|
|
|
}
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_text_shadow:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mText) {
|
|
|
|
if (nsnull != mText->mTextShadow) {
|
|
|
|
CSS_ENSURE_IMPORTANT(Text) {
|
1998-10-27 02:22:40 +03:00
|
|
|
CSS_IF_DELETE(mImportant->mText->mTextShadow);
|
1998-10-08 05:31:58 +04:00
|
|
|
mImportant->mText->mTextShadow = mText->mTextShadow;
|
|
|
|
mText->mTextShadow = nsnull;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSDisplay
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_direction:
|
|
|
|
case eCSSProperty_display:
|
2001-06-01 02:19:43 +04:00
|
|
|
case eCSSProperty_binding:
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_float:
|
|
|
|
case eCSSProperty_clear:
|
|
|
|
case eCSSProperty_overflow:
|
|
|
|
case eCSSProperty_visibility:
|
2001-06-01 02:19:43 +04:00
|
|
|
case eCSSProperty_opacity:
|
|
|
|
case eCSSProperty_position:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mDisplay) {
|
|
|
|
CSS_ENSURE_IMPORTANT(Display) {
|
1998-06-26 09:51:55 +04:00
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_direction, mDisplay->mDirection);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_display, mDisplay->mDisplay);
|
2001-06-01 02:19:43 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_binding, mDisplay->mBinding);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_position, mDisplay->mPosition);
|
1999-07-18 04:25:28 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_float, mDisplay->mFloat);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_clear, mDisplay->mClear);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_overflow, mDisplay->mOverflow);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_visibility, mDisplay->mVisibility);
|
2001-06-01 02:19:43 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_opacity, mDisplay->mOpacity);
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-06-26 09:51:55 +04:00
|
|
|
}
|
|
|
|
}
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_clip_top:
|
|
|
|
case eCSSProperty_clip_right:
|
|
|
|
case eCSSProperty_clip_bottom:
|
|
|
|
case eCSSProperty_clip_left:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mDisplay) {
|
|
|
|
if (nsnull != mDisplay->mClip) {
|
|
|
|
CSS_ENSURE_IMPORTANT(Display) {
|
|
|
|
CSS_ENSURE_RECT(mImportant->mDisplay->mClip) {
|
|
|
|
switch(aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_clip_top, mDisplay->mClip->mTop);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_clip_right, mDisplay->mClip->mRight);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_clip_bottom, mDisplay->mClip->mBottom);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_clip_left, mDisplay->mClip->mLeft);
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1998-06-26 09:51:55 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSMargin
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_margin_top:
|
|
|
|
case eCSSProperty_margin_right:
|
|
|
|
case eCSSProperty_margin_bottom:
|
|
|
|
case eCSSProperty_margin_left:
|
1998-06-26 09:51:55 +04:00
|
|
|
if (nsnull != mMargin) {
|
|
|
|
if (nsnull != mMargin->mMargin) {
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_ENSURE_IMPORTANT(Margin) {
|
|
|
|
CSS_ENSURE_RECT(mImportant->mMargin->mMargin) {
|
1998-06-26 09:51:55 +04:00
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_margin_top, mMargin->mMargin->mTop);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_margin_right, mMargin->mMargin->mRight);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_margin_bottom, mMargin->mMargin->mBottom);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_margin_left, mMargin->mMargin->mLeft);
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-06-26 09:51:55 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_padding_top:
|
|
|
|
case eCSSProperty_padding_right:
|
|
|
|
case eCSSProperty_padding_bottom:
|
|
|
|
case eCSSProperty_padding_left:
|
1998-06-26 09:51:55 +04:00
|
|
|
if (nsnull != mMargin) {
|
|
|
|
if (nsnull != mMargin->mPadding) {
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_ENSURE_IMPORTANT(Margin) {
|
|
|
|
CSS_ENSURE_RECT(mImportant->mMargin->mPadding) {
|
1998-06-26 09:51:55 +04:00
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_padding_top, mMargin->mPadding->mTop);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_padding_right, mMargin->mPadding->mRight);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_padding_bottom, mMargin->mPadding->mBottom);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_padding_left, mMargin->mPadding->mLeft);
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-06-26 09:51:55 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_top_width:
|
|
|
|
case eCSSProperty_border_right_width:
|
|
|
|
case eCSSProperty_border_bottom_width:
|
|
|
|
case eCSSProperty_border_left_width:
|
1998-06-26 09:51:55 +04:00
|
|
|
if (nsnull != mMargin) {
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mMargin->mBorderWidth) {
|
|
|
|
CSS_ENSURE_IMPORTANT(Margin) {
|
|
|
|
CSS_ENSURE_RECT(mImportant->mMargin->mBorderWidth) {
|
1998-06-26 09:51:55 +04:00
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_border_top_width, mMargin->mBorderWidth->mTop);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_border_right_width, mMargin->mBorderWidth->mRight);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_border_bottom_width, mMargin->mBorderWidth->mBottom);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_border_left_width, mMargin->mBorderWidth->mLeft);
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-06-26 09:51:55 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_top_color:
|
|
|
|
case eCSSProperty_border_right_color:
|
|
|
|
case eCSSProperty_border_bottom_color:
|
|
|
|
case eCSSProperty_border_left_color:
|
1998-06-26 09:51:55 +04:00
|
|
|
if (nsnull != mMargin) {
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mMargin->mBorderColor) {
|
|
|
|
CSS_ENSURE_IMPORTANT(Margin) {
|
|
|
|
CSS_ENSURE_RECT(mImportant->mMargin->mBorderColor) {
|
1998-06-26 09:51:55 +04:00
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_border_top_color, mMargin->mBorderColor->mTop);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_border_right_color, mMargin->mBorderColor->mRight);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_border_bottom_color, mMargin->mBorderColor->mBottom);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_border_left_color, mMargin->mBorderColor->mLeft);
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-06-26 09:51:55 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2001-12-05 11:35:05 +03:00
|
|
|
case eCSSProperty_border_top_colors:
|
|
|
|
if (mMargin && mMargin->mBorderColors) {
|
|
|
|
CSS_ENSURE_IMPORTANT(Margin) {
|
|
|
|
mImportant->mMargin->EnsureBorderColors();
|
|
|
|
CSS_IF_DELETE(mImportant->mMargin->mBorderColors[0]);
|
|
|
|
mImportant->mMargin->mBorderColors[0] = mMargin->mBorderColors[0];
|
|
|
|
mMargin->mBorderColors[0] = nsnull;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case eCSSProperty_border_right_colors:
|
|
|
|
if (mMargin && mMargin->mBorderColors) {
|
|
|
|
CSS_ENSURE_IMPORTANT(Margin) {
|
|
|
|
mImportant->mMargin->EnsureBorderColors();
|
|
|
|
CSS_IF_DELETE(mImportant->mMargin->mBorderColors[1]);
|
|
|
|
mImportant->mMargin->mBorderColors[1] = mMargin->mBorderColors[1];
|
|
|
|
mMargin->mBorderColors[1] = nsnull;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case eCSSProperty_border_bottom_colors:
|
|
|
|
if (mMargin && mMargin->mBorderColors) {
|
|
|
|
CSS_ENSURE_IMPORTANT(Margin) {
|
|
|
|
mImportant->mMargin->EnsureBorderColors();
|
|
|
|
CSS_IF_DELETE(mImportant->mMargin->mBorderColors[2]);
|
|
|
|
mImportant->mMargin->mBorderColors[0] = mMargin->mBorderColors[2];
|
|
|
|
mMargin->mBorderColors[2] = nsnull;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case eCSSProperty_border_left_colors:
|
|
|
|
if (mMargin && mMargin->mBorderColors) {
|
|
|
|
CSS_ENSURE_IMPORTANT(Margin) {
|
|
|
|
mImportant->mMargin->EnsureBorderColors();
|
|
|
|
CSS_IF_DELETE(mImportant->mMargin->mBorderColors[3]);
|
|
|
|
mImportant->mMargin->mBorderColors[0] = mMargin->mBorderColors[3];
|
|
|
|
mMargin->mBorderColors[3] = nsnull;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_top_style:
|
|
|
|
case eCSSProperty_border_right_style:
|
|
|
|
case eCSSProperty_border_bottom_style:
|
|
|
|
case eCSSProperty_border_left_style:
|
1998-06-26 09:51:55 +04:00
|
|
|
if (nsnull != mMargin) {
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mMargin->mBorderStyle) {
|
|
|
|
CSS_ENSURE_IMPORTANT(Margin) {
|
|
|
|
CSS_ENSURE_RECT(mImportant->mMargin->mBorderStyle) {
|
1998-06-26 09:51:55 +04:00
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_border_top_style, mMargin->mBorderStyle->mTop);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_border_right_style, mMargin->mBorderStyle->mRight);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_border_bottom_style, mMargin->mBorderStyle->mBottom);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_border_left_style, mMargin->mBorderStyle->mLeft);
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-06-26 09:51:55 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-12-22 14:27:10 +03:00
|
|
|
case eCSSProperty__moz_border_radius_topLeft:
|
|
|
|
case eCSSProperty__moz_border_radius_topRight:
|
|
|
|
case eCSSProperty__moz_border_radius_bottomRight:
|
|
|
|
case eCSSProperty__moz_border_radius_bottomLeft:
|
|
|
|
if (nsnull != mMargin) {
|
|
|
|
if (nsnull != mMargin->mBorderRadius) {
|
|
|
|
CSS_ENSURE_IMPORTANT(Margin) {
|
|
|
|
CSS_ENSURE_RECT(mImportant->mMargin->mBorderRadius) {
|
|
|
|
switch (aProperty) {
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty__moz_border_radius_topLeft, mMargin->mBorderRadius->mTop);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty__moz_border_radius_topRight, mMargin->mBorderRadius->mRight);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty__moz_border_radius_bottomRight, mMargin->mBorderRadius->mBottom);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty__moz_border_radius_bottomLeft, mMargin->mBorderRadius->mLeft);
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2000-01-24 14:19:55 +03:00
|
|
|
case eCSSProperty__moz_outline_radius_topLeft:
|
|
|
|
case eCSSProperty__moz_outline_radius_topRight:
|
|
|
|
case eCSSProperty__moz_outline_radius_bottomRight:
|
|
|
|
case eCSSProperty__moz_outline_radius_bottomLeft:
|
|
|
|
if (nsnull != mMargin) {
|
|
|
|
if (nsnull != mMargin->mOutlineRadius) {
|
|
|
|
CSS_ENSURE_IMPORTANT(Margin) {
|
|
|
|
CSS_ENSURE_RECT(mImportant->mMargin->mOutlineRadius) {
|
|
|
|
switch (aProperty) {
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty__moz_outline_radius_topLeft, mMargin->mOutlineRadius->mTop);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty__moz_outline_radius_topRight, mMargin->mOutlineRadius->mRight);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty__moz_outline_radius_bottomRight, mMargin->mOutlineRadius->mBottom);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty__moz_outline_radius_bottomLeft, mMargin->mOutlineRadius->mLeft);
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_outline_width:
|
|
|
|
case eCSSProperty_outline_color:
|
|
|
|
case eCSSProperty_outline_style:
|
1999-07-24 23:04:42 +04:00
|
|
|
case eCSSProperty_float_edge:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mMargin) {
|
|
|
|
CSS_ENSURE_IMPORTANT(Margin) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_outline_width, mMargin->mOutlineWidth);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_outline_color, mMargin->mOutlineColor);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_outline_style, mMargin->mOutlineStyle);
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_float_edge, mMargin->mFloatEdge);
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-06-26 09:51:55 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSPosition
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_width:
|
|
|
|
case eCSSProperty_min_width:
|
|
|
|
case eCSSProperty_max_width:
|
|
|
|
case eCSSProperty_height:
|
|
|
|
case eCSSProperty_min_height:
|
|
|
|
case eCSSProperty_max_height:
|
1999-07-24 23:04:42 +04:00
|
|
|
case eCSSProperty_box_sizing:
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_z_index:
|
1998-06-26 09:51:55 +04:00
|
|
|
if (nsnull != mPosition) {
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_ENSURE_IMPORTANT(Position) {
|
1998-06-26 09:51:55 +04:00
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_width, mPosition->mWidth);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_min_width, mPosition->mMinWidth);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_max_width, mPosition->mMaxWidth);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_height, mPosition->mHeight);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_min_height, mPosition->mMinHeight);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_max_height, mPosition->mMaxHeight);
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_box_sizing, mPosition->mBoxSizing);
|
1999-07-18 04:25:28 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_z_index, mPosition->mZIndex);
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-06-26 09:51:55 +04:00
|
|
|
}
|
|
|
|
}
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_top:
|
|
|
|
case eCSSProperty_right:
|
|
|
|
case eCSSProperty_bottom:
|
|
|
|
case eCSSProperty_left:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mPosition) {
|
|
|
|
if (nsnull != mPosition->mOffset) {
|
|
|
|
CSS_ENSURE_IMPORTANT(Position) {
|
|
|
|
CSS_ENSURE_RECT(mImportant->mPosition->mOffset) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_top, mPosition->mOffset->mTop);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_right, mPosition->mOffset->mRight);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_bottom, mPosition->mOffset->mBottom);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_left, mPosition->mOffset->mLeft);
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1998-06-26 09:51:55 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSList
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_list_style_type:
|
|
|
|
case eCSSProperty_list_style_image:
|
|
|
|
case eCSSProperty_list_style_position:
|
1998-06-26 09:51:55 +04:00
|
|
|
if (nsnull != mList) {
|
1998-10-08 05:31:58 +04:00
|
|
|
CSS_ENSURE_IMPORTANT(List) {
|
1998-06-26 09:51:55 +04:00
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_list_style_type, mList->mType);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_list_style_image, mList->mImage);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_list_style_position, mList->mPosition);
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-06-26 09:51:55 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2001-12-05 11:35:05 +03:00
|
|
|
case eCSSProperty_image_region_top:
|
|
|
|
case eCSSProperty_image_region_right:
|
|
|
|
case eCSSProperty_image_region_bottom:
|
|
|
|
case eCSSProperty_image_region_left:
|
|
|
|
if (mList) {
|
|
|
|
if (mList->mImageRegion) {
|
|
|
|
CSS_ENSURE_IMPORTANT(Position) {
|
|
|
|
CSS_ENSURE_RECT(mImportant->mList->mImageRegion) {
|
|
|
|
switch (aProperty) {
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_image_region_top, mList->mImageRegion->mTop);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_image_region_right, mList->mImageRegion->mRight);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_image_region_bottom, mList->mImageRegion->mBottom);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_image_region_left, mList->mImageRegion->mLeft);
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
// nsCSSTable
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_collapse:
|
|
|
|
case eCSSProperty_border_x_spacing:
|
|
|
|
case eCSSProperty_border_y_spacing:
|
|
|
|
case eCSSProperty_caption_side:
|
|
|
|
case eCSSProperty_empty_cells:
|
|
|
|
case eCSSProperty_table_layout:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mTable) {
|
|
|
|
CSS_ENSURE_IMPORTANT(Table) {
|
1998-06-26 09:51:55 +04:00
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_border_collapse, mTable->mBorderCollapse);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_border_x_spacing, mTable->mBorderSpacingX);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_border_y_spacing, mTable->mBorderSpacingY);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_caption_side, mTable->mCaptionSide);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_empty_cells, mTable->mEmptyCells);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_table_layout, mTable->mLayout);
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-06-26 09:51:55 +04:00
|
|
|
}
|
|
|
|
}
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSBreaks
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_orphans:
|
|
|
|
case eCSSProperty_widows:
|
|
|
|
case eCSSProperty_page:
|
|
|
|
case eCSSProperty_page_break_after:
|
|
|
|
case eCSSProperty_page_break_before:
|
|
|
|
case eCSSProperty_page_break_inside:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mBreaks) {
|
|
|
|
CSS_ENSURE_IMPORTANT(Breaks) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_orphans, mBreaks->mOrphans);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_widows, mBreaks->mWidows);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_page, mBreaks->mPage);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_page_break_after, mBreaks->mPageBreakAfter);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_page_break_before, mBreaks->mPageBreakBefore);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_page_break_inside, mBreaks->mPageBreakInside);
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
1998-06-26 09:51:55 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
// nsCSSPage
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_marks:
|
|
|
|
case eCSSProperty_size_width:
|
|
|
|
case eCSSProperty_size_height:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mPage) {
|
|
|
|
CSS_ENSURE_IMPORTANT(Page) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_marks, mPage->mMarks);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_size_width, mPage->mSizeWidth);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_size_height, mPage->mSizeHeight);
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-06-26 09:51:55 +04:00
|
|
|
}
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSContent
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_content:
|
1998-10-27 02:22:40 +03:00
|
|
|
if (nsnull != mContent) {
|
|
|
|
if (nsnull != mContent->mContent) {
|
|
|
|
CSS_ENSURE_IMPORTANT(Content) {
|
|
|
|
CSS_IF_DELETE(mImportant->mContent->mContent);
|
|
|
|
mImportant->mContent->mContent = mContent->mContent;
|
|
|
|
mContent->mContent = nsnull;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_counter_increment:
|
1998-10-27 02:22:40 +03:00
|
|
|
if (nsnull != mContent) {
|
|
|
|
if (nsnull != mContent->mCounterIncrement) {
|
|
|
|
CSS_ENSURE_IMPORTANT(Content) {
|
|
|
|
CSS_IF_DELETE(mImportant->mContent->mCounterIncrement);
|
|
|
|
mImportant->mContent->mCounterIncrement = mContent->mCounterIncrement;
|
|
|
|
mContent->mCounterIncrement = nsnull;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_counter_reset:
|
1998-10-27 02:22:40 +03:00
|
|
|
if (nsnull != mContent) {
|
|
|
|
if (nsnull != mContent->mCounterReset) {
|
|
|
|
CSS_ENSURE_IMPORTANT(Content) {
|
|
|
|
CSS_IF_DELETE(mImportant->mContent->mCounterReset);
|
|
|
|
mImportant->mContent->mCounterReset = mContent->mCounterReset;
|
|
|
|
mContent->mCounterReset = nsnull;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_marker_offset:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mContent) {
|
|
|
|
CSS_ENSURE_IMPORTANT(Content) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_marker_offset, mContent->mMarkerOffset);
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-10-27 02:22:40 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_quotes:
|
1998-10-27 02:22:40 +03:00
|
|
|
if (nsnull != mContent) {
|
|
|
|
if (nsnull != mContent->mQuotes) {
|
|
|
|
CSS_ENSURE_IMPORTANT(Content) {
|
|
|
|
CSS_IF_DELETE(mImportant->mContent->mQuotes);
|
|
|
|
mImportant->mContent->mQuotes = mContent->mQuotes;
|
|
|
|
mContent->mQuotes = nsnull;
|
1998-06-26 09:51:55 +04:00
|
|
|
}
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-24 23:04:42 +04:00
|
|
|
// nsCSSUserInterface
|
|
|
|
case eCSSProperty_user_input:
|
1999-09-04 03:40:35 +04:00
|
|
|
case eCSSProperty_user_modify:
|
|
|
|
case eCSSProperty_user_select:
|
|
|
|
case eCSSProperty_user_focus:
|
1999-07-24 23:04:42 +04:00
|
|
|
case eCSSProperty_resizer:
|
|
|
|
if (nsnull != mUserInterface) {
|
|
|
|
CSS_ENSURE_IMPORTANT(UserInterface) {
|
|
|
|
switch (aProperty) {
|
1999-09-04 03:40:35 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_user_input, mUserInterface->mUserInput);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_user_modify, mUserInterface->mUserModify);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_user_select, mUserInterface->mUserSelect);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_user_focus, mUserInterface->mUserFocus);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_resizer, mUserInterface->mResizer);
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case eCSSProperty_key_equivalent:
|
|
|
|
if (nsnull != mUserInterface) {
|
|
|
|
if (nsnull != mUserInterface->mKeyEquivalent) {
|
|
|
|
CSS_ENSURE_IMPORTANT(UserInterface) {
|
|
|
|
CSS_IF_DELETE(mImportant->mUserInterface->mKeyEquivalent);
|
|
|
|
mImportant->mUserInterface->mKeyEquivalent = mUserInterface->mKeyEquivalent;
|
|
|
|
mUserInterface->mKeyEquivalent = nsnull;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2001-06-01 02:19:43 +04:00
|
|
|
case eCSSProperty_cursor:
|
|
|
|
if (nsnull != mUserInterface) {
|
|
|
|
if (nsnull != mUserInterface->mCursor) {
|
|
|
|
CSS_ENSURE_IMPORTANT(UserInterface) {
|
|
|
|
CSS_IF_DELETE(mImportant->mUserInterface->mCursor);
|
|
|
|
mImportant->mUserInterface->mCursor = mUserInterface->mCursor;
|
|
|
|
mUserInterface->mCursor = nsnull;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2001-03-06 05:30:30 +03:00
|
|
|
#ifdef INCLUDE_XUL
|
|
|
|
// nsCSSXUL
|
2001-08-02 04:09:27 +04:00
|
|
|
case eCSSProperty_box_align:
|
|
|
|
case eCSSProperty_box_direction:
|
|
|
|
case eCSSProperty_box_flex:
|
2001-03-06 05:30:30 +03:00
|
|
|
case eCSSProperty_box_orient:
|
2001-08-02 04:09:27 +04:00
|
|
|
case eCSSProperty_box_pack:
|
2001-09-26 02:17:00 +04:00
|
|
|
case eCSSProperty_box_ordinal_group:
|
2001-03-06 05:30:30 +03:00
|
|
|
if (nsnull != mXUL) {
|
|
|
|
CSS_ENSURE_IMPORTANT(XUL) {
|
|
|
|
switch (aProperty) {
|
2001-09-26 02:17:00 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_box_align, mXUL->mBoxAlign);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_box_direction, mXUL->mBoxDirection);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_box_flex, mXUL->mBoxFlex);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_box_orient, mXUL->mBoxOrient);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_box_pack, mXUL->mBoxPack);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_box_ordinal_group, mXUL->mBoxOrdinal);
|
2001-03-06 05:30:30 +03:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
// nsCSSAural
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_azimuth:
|
|
|
|
case eCSSProperty_elevation:
|
|
|
|
case eCSSProperty_cue_after:
|
|
|
|
case eCSSProperty_cue_before:
|
|
|
|
case eCSSProperty_pause_after:
|
|
|
|
case eCSSProperty_pause_before:
|
|
|
|
case eCSSProperty_pitch:
|
|
|
|
case eCSSProperty_pitch_range:
|
|
|
|
case eCSSProperty_richness:
|
|
|
|
case eCSSProperty_speak:
|
|
|
|
case eCSSProperty_speak_header:
|
|
|
|
case eCSSProperty_speak_numeral:
|
|
|
|
case eCSSProperty_speak_punctuation:
|
|
|
|
case eCSSProperty_speech_rate:
|
|
|
|
case eCSSProperty_stress:
|
|
|
|
case eCSSProperty_voice_family:
|
|
|
|
case eCSSProperty_volume:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mAural) {
|
|
|
|
CSS_ENSURE_IMPORTANT(Aural) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_azimuth, mAural->mAzimuth);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_elevation, mAural->mElevation);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_cue_after, mAural->mCueAfter);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_cue_before, mAural->mCueBefore);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_pause_after, mAural->mPauseAfter);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_pause_before, mAural->mPauseBefore);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_pitch, mAural->mPitch);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_pitch_range, mAural->mPitchRange);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_richness, mAural->mRichness);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_speak, mAural->mSpeak);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_speak_header, mAural->mSpeakHeader);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_speak_numeral, mAural->mSpeakNumeral);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_speak_punctuation, mAural->mSpeakPunctuation);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_speech_rate, mAural->mSpeechRate);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_stress, mAural->mStress);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_voice_family, mAural->mVoiceFamily);
|
|
|
|
CSS_CASE_IMPORTANT(eCSSProperty_volume, mAural->mVolume);
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-06-26 09:51:55 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_play_during:
|
1998-10-27 02:22:40 +03:00
|
|
|
if (nsnull != mAural) {
|
|
|
|
CSS_ENSURE_IMPORTANT(Aural) {
|
|
|
|
mImportant->mAural->mPlayDuring = mAural->mPlayDuring;
|
|
|
|
mAural->mPlayDuring.Reset();
|
|
|
|
mImportant->mAural->mPlayDuringFlags = mAural->mPlayDuringFlags;
|
|
|
|
mAural->mPlayDuringFlags.Reset();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
// Shorthands
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_background:
|
|
|
|
SetValueImportant(eCSSProperty_background_color);
|
|
|
|
SetValueImportant(eCSSProperty_background_image);
|
|
|
|
SetValueImportant(eCSSProperty_background_repeat);
|
|
|
|
SetValueImportant(eCSSProperty_background_attachment);
|
|
|
|
SetValueImportant(eCSSProperty_background_x_position);
|
|
|
|
SetValueImportant(eCSSProperty_background_y_position);
|
1998-06-26 09:51:55 +04:00
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border:
|
|
|
|
SetValueImportant(eCSSProperty_border_top_width);
|
|
|
|
SetValueImportant(eCSSProperty_border_right_width);
|
|
|
|
SetValueImportant(eCSSProperty_border_bottom_width);
|
|
|
|
SetValueImportant(eCSSProperty_border_left_width);
|
|
|
|
SetValueImportant(eCSSProperty_border_top_style);
|
|
|
|
SetValueImportant(eCSSProperty_border_right_style);
|
|
|
|
SetValueImportant(eCSSProperty_border_bottom_style);
|
|
|
|
SetValueImportant(eCSSProperty_border_left_style);
|
|
|
|
SetValueImportant(eCSSProperty_border_top_color);
|
|
|
|
SetValueImportant(eCSSProperty_border_right_color);
|
|
|
|
SetValueImportant(eCSSProperty_border_bottom_color);
|
|
|
|
SetValueImportant(eCSSProperty_border_left_color);
|
1998-06-26 09:51:55 +04:00
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_spacing:
|
|
|
|
SetValueImportant(eCSSProperty_border_x_spacing);
|
|
|
|
SetValueImportant(eCSSProperty_border_y_spacing);
|
2000-04-28 12:35:40 +04:00
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_clip:
|
|
|
|
SetValueImportant(eCSSProperty_clip_top);
|
|
|
|
SetValueImportant(eCSSProperty_clip_right);
|
|
|
|
SetValueImportant(eCSSProperty_clip_bottom);
|
|
|
|
SetValueImportant(eCSSProperty_clip_left);
|
1998-06-26 09:51:55 +04:00
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_cue:
|
|
|
|
SetValueImportant(eCSSProperty_cue_after);
|
|
|
|
SetValueImportant(eCSSProperty_cue_before);
|
1998-10-08 05:31:58 +04:00
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_font:
|
|
|
|
SetValueImportant(eCSSProperty_font_family);
|
|
|
|
SetValueImportant(eCSSProperty_font_style);
|
|
|
|
SetValueImportant(eCSSProperty_font_variant);
|
|
|
|
SetValueImportant(eCSSProperty_font_weight);
|
|
|
|
SetValueImportant(eCSSProperty_font_size);
|
|
|
|
SetValueImportant(eCSSProperty_line_height);
|
1998-06-26 09:51:55 +04:00
|
|
|
break;
|
2001-12-05 11:35:05 +03:00
|
|
|
case eCSSProperty_image_region:
|
|
|
|
SetValueImportant(eCSSProperty_image_region_top);
|
|
|
|
SetValueImportant(eCSSProperty_image_region_right);
|
|
|
|
SetValueImportant(eCSSProperty_image_region_bottom);
|
|
|
|
SetValueImportant(eCSSProperty_image_region_left);
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_list_style:
|
|
|
|
SetValueImportant(eCSSProperty_list_style_type);
|
|
|
|
SetValueImportant(eCSSProperty_list_style_image);
|
|
|
|
SetValueImportant(eCSSProperty_list_style_position);
|
1998-06-26 09:51:55 +04:00
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_margin:
|
|
|
|
SetValueImportant(eCSSProperty_margin_top);
|
|
|
|
SetValueImportant(eCSSProperty_margin_right);
|
|
|
|
SetValueImportant(eCSSProperty_margin_bottom);
|
|
|
|
SetValueImportant(eCSSProperty_margin_left);
|
1998-06-26 09:51:55 +04:00
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_outline:
|
|
|
|
SetValueImportant(eCSSProperty_outline_color);
|
|
|
|
SetValueImportant(eCSSProperty_outline_style);
|
|
|
|
SetValueImportant(eCSSProperty_outline_width);
|
1998-10-08 05:31:58 +04:00
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_padding:
|
|
|
|
SetValueImportant(eCSSProperty_padding_top);
|
|
|
|
SetValueImportant(eCSSProperty_padding_right);
|
|
|
|
SetValueImportant(eCSSProperty_padding_bottom);
|
|
|
|
SetValueImportant(eCSSProperty_padding_left);
|
1998-06-26 09:51:55 +04:00
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_pause:
|
|
|
|
SetValueImportant(eCSSProperty_pause_after);
|
|
|
|
SetValueImportant(eCSSProperty_pause_before);
|
1998-10-08 05:31:58 +04:00
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_size:
|
|
|
|
SetValueImportant(eCSSProperty_size_width);
|
|
|
|
SetValueImportant(eCSSProperty_size_height);
|
1998-10-27 02:22:40 +03:00
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_background_position:
|
|
|
|
SetValueImportant(eCSSProperty_background_x_position);
|
|
|
|
SetValueImportant(eCSSProperty_background_y_position);
|
1998-06-26 09:51:55 +04:00
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_top:
|
|
|
|
SetValueImportant(eCSSProperty_border_top_width);
|
|
|
|
SetValueImportant(eCSSProperty_border_top_style);
|
|
|
|
SetValueImportant(eCSSProperty_border_top_color);
|
1998-06-26 09:51:55 +04:00
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_right:
|
|
|
|
SetValueImportant(eCSSProperty_border_right_width);
|
|
|
|
SetValueImportant(eCSSProperty_border_right_style);
|
|
|
|
SetValueImportant(eCSSProperty_border_right_color);
|
1998-06-26 09:51:55 +04:00
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_bottom:
|
|
|
|
SetValueImportant(eCSSProperty_border_bottom_width);
|
|
|
|
SetValueImportant(eCSSProperty_border_bottom_style);
|
|
|
|
SetValueImportant(eCSSProperty_border_bottom_color);
|
1998-06-26 09:51:55 +04:00
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_left:
|
|
|
|
SetValueImportant(eCSSProperty_border_left_width);
|
|
|
|
SetValueImportant(eCSSProperty_border_left_style);
|
|
|
|
SetValueImportant(eCSSProperty_border_left_color);
|
1998-06-26 09:51:55 +04:00
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_color:
|
|
|
|
SetValueImportant(eCSSProperty_border_top_color);
|
|
|
|
SetValueImportant(eCSSProperty_border_right_color);
|
|
|
|
SetValueImportant(eCSSProperty_border_bottom_color);
|
|
|
|
SetValueImportant(eCSSProperty_border_left_color);
|
1998-06-26 09:51:55 +04:00
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_style:
|
|
|
|
SetValueImportant(eCSSProperty_border_top_style);
|
|
|
|
SetValueImportant(eCSSProperty_border_right_style);
|
|
|
|
SetValueImportant(eCSSProperty_border_bottom_style);
|
|
|
|
SetValueImportant(eCSSProperty_border_left_style);
|
1998-06-26 09:51:55 +04:00
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_width:
|
|
|
|
SetValueImportant(eCSSProperty_border_top_width);
|
|
|
|
SetValueImportant(eCSSProperty_border_right_width);
|
|
|
|
SetValueImportant(eCSSProperty_border_bottom_width);
|
|
|
|
SetValueImportant(eCSSProperty_border_left_width);
|
1998-06-26 09:51:55 +04:00
|
|
|
break;
|
1999-12-22 14:27:10 +03:00
|
|
|
case eCSSProperty__moz_border_radius:
|
|
|
|
SetValueImportant(eCSSProperty__moz_border_radius_topLeft);
|
|
|
|
SetValueImportant(eCSSProperty__moz_border_radius_topRight);
|
|
|
|
SetValueImportant(eCSSProperty__moz_border_radius_bottomRight);
|
|
|
|
SetValueImportant(eCSSProperty__moz_border_radius_bottomLeft);
|
|
|
|
break;
|
2000-01-28 13:03:10 +03:00
|
|
|
case eCSSProperty__moz_outline_radius:
|
|
|
|
SetValueImportant(eCSSProperty__moz_outline_radius_topLeft);
|
|
|
|
SetValueImportant(eCSSProperty__moz_outline_radius_topRight);
|
|
|
|
SetValueImportant(eCSSProperty__moz_outline_radius_bottomRight);
|
|
|
|
SetValueImportant(eCSSProperty__moz_outline_radius_bottomLeft);
|
|
|
|
break;
|
1998-06-26 09:51:55 +04:00
|
|
|
default:
|
|
|
|
result = NS_ERROR_ILLEGAL_VALUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2000-04-28 12:35:40 +04:00
|
|
|
|
|
|
|
#define CSS_CHECK(data) \
|
|
|
|
if (nsnull == m##data) { \
|
|
|
|
result = NS_ERROR_NOT_AVAILABLE; \
|
|
|
|
} \
|
|
|
|
else
|
|
|
|
|
|
|
|
#define CSS_CHECK_RECT(data) \
|
|
|
|
if (nsnull == data) { \
|
|
|
|
result = NS_ERROR_NOT_AVAILABLE; \
|
|
|
|
} \
|
|
|
|
else
|
|
|
|
|
|
|
|
#define CSS_CHECK_DATA(data,type) \
|
|
|
|
if (nsnull == data) { \
|
|
|
|
result = NS_ERROR_NOT_AVAILABLE; \
|
|
|
|
} \
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
CSSDeclarationImpl::RemoveProperty(nsCSSProperty aProperty)
|
|
|
|
{
|
|
|
|
nsresult result = NS_OK;
|
|
|
|
|
|
|
|
switch (aProperty) {
|
|
|
|
// nsCSSFont
|
|
|
|
case eCSSProperty_font_family:
|
|
|
|
case eCSSProperty_font_style:
|
|
|
|
case eCSSProperty_font_variant:
|
|
|
|
case eCSSProperty_font_weight:
|
|
|
|
case eCSSProperty_font_size:
|
|
|
|
case eCSSProperty_font_size_adjust:
|
|
|
|
case eCSSProperty_font_stretch:
|
|
|
|
CSS_CHECK(Font) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty_font_family: mFont->mFamily.Reset(); break;
|
|
|
|
case eCSSProperty_font_style: mFont->mStyle.Reset(); break;
|
|
|
|
case eCSSProperty_font_variant: mFont->mVariant.Reset(); break;
|
|
|
|
case eCSSProperty_font_weight: mFont->mWeight.Reset(); break;
|
|
|
|
case eCSSProperty_font_size: mFont->mSize.Reset(); break;
|
|
|
|
case eCSSProperty_font_size_adjust: mFont->mSizeAdjust.Reset(); break;
|
|
|
|
case eCSSProperty_font_stretch: mFont->mStretch.Reset(); break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSColor
|
|
|
|
case eCSSProperty_color:
|
|
|
|
case eCSSProperty_background_color:
|
|
|
|
case eCSSProperty_background_image:
|
|
|
|
case eCSSProperty_background_repeat:
|
|
|
|
case eCSSProperty_background_attachment:
|
|
|
|
case eCSSProperty_background_x_position:
|
|
|
|
case eCSSProperty_background_y_position:
|
|
|
|
CSS_CHECK(Color) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty_color: mColor->mColor.Reset(); break;
|
|
|
|
case eCSSProperty_background_color: mColor->mBackColor.Reset(); break;
|
|
|
|
case eCSSProperty_background_image: mColor->mBackImage.Reset(); break;
|
|
|
|
case eCSSProperty_background_repeat: mColor->mBackRepeat.Reset(); break;
|
|
|
|
case eCSSProperty_background_attachment: mColor->mBackAttachment.Reset(); break;
|
|
|
|
case eCSSProperty_background_x_position: mColor->mBackPositionX.Reset(); break;
|
|
|
|
case eCSSProperty_background_y_position: mColor->mBackPositionY.Reset(); break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSText
|
|
|
|
case eCSSProperty_word_spacing:
|
|
|
|
case eCSSProperty_letter_spacing:
|
|
|
|
case eCSSProperty_text_decoration:
|
|
|
|
case eCSSProperty_vertical_align:
|
|
|
|
case eCSSProperty_text_transform:
|
|
|
|
case eCSSProperty_text_align:
|
|
|
|
case eCSSProperty_text_indent:
|
|
|
|
case eCSSProperty_unicode_bidi:
|
|
|
|
case eCSSProperty_line_height:
|
|
|
|
case eCSSProperty_white_space:
|
|
|
|
CSS_CHECK(Text) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty_word_spacing: mText->mWordSpacing.Reset(); break;
|
|
|
|
case eCSSProperty_letter_spacing: mText->mLetterSpacing.Reset(); break;
|
|
|
|
case eCSSProperty_text_decoration: mText->mDecoration.Reset(); break;
|
|
|
|
case eCSSProperty_vertical_align: mText->mVerticalAlign.Reset(); break;
|
|
|
|
case eCSSProperty_text_transform: mText->mTextTransform.Reset(); break;
|
|
|
|
case eCSSProperty_text_align: mText->mTextAlign.Reset(); break;
|
|
|
|
case eCSSProperty_text_indent: mText->mTextIndent.Reset(); break;
|
|
|
|
case eCSSProperty_unicode_bidi: mText->mUnicodeBidi.Reset(); break;
|
|
|
|
case eCSSProperty_line_height: mText->mLineHeight.Reset(); break;
|
|
|
|
case eCSSProperty_white_space: mText->mWhiteSpace.Reset(); break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case eCSSProperty_text_shadow_color:
|
|
|
|
case eCSSProperty_text_shadow_radius:
|
|
|
|
case eCSSProperty_text_shadow_x:
|
|
|
|
case eCSSProperty_text_shadow_y:
|
|
|
|
CSS_CHECK(Text) {
|
|
|
|
CSS_CHECK_DATA(mText->mTextShadow, nsCSSShadow) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty_text_shadow_color: mText->mTextShadow->mColor.Reset(); break;
|
|
|
|
case eCSSProperty_text_shadow_radius: mText->mTextShadow->mRadius.Reset(); break;
|
|
|
|
case eCSSProperty_text_shadow_x: mText->mTextShadow->mXOffset.Reset(); break;
|
|
|
|
case eCSSProperty_text_shadow_y: mText->mTextShadow->mYOffset.Reset(); break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
CSS_IF_DELETE(mText->mTextShadow->mNext);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSDisplay
|
|
|
|
case eCSSProperty_float:
|
|
|
|
case eCSSProperty_clear:
|
|
|
|
case eCSSProperty_display:
|
2001-06-01 02:19:43 +04:00
|
|
|
case eCSSProperty_binding:
|
|
|
|
case eCSSProperty_position:
|
2000-04-28 12:35:40 +04:00
|
|
|
case eCSSProperty_direction:
|
|
|
|
case eCSSProperty_visibility:
|
2001-06-01 02:19:43 +04:00
|
|
|
case eCSSProperty_opacity:
|
2000-04-28 12:35:40 +04:00
|
|
|
case eCSSProperty_overflow:
|
|
|
|
CSS_CHECK(Display) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty_float: mDisplay->mFloat.Reset(); break;
|
|
|
|
case eCSSProperty_clear: mDisplay->mClear.Reset(); break;
|
|
|
|
case eCSSProperty_display: mDisplay->mDisplay.Reset(); break;
|
2001-06-01 02:19:43 +04:00
|
|
|
case eCSSProperty_position: mDisplay->mPosition.Reset(); break;
|
|
|
|
case eCSSProperty_binding:
|
|
|
|
mDisplay->mBinding.Reset();
|
|
|
|
break;
|
2000-04-28 12:35:40 +04:00
|
|
|
case eCSSProperty_direction: mDisplay->mDirection.Reset(); break;
|
|
|
|
case eCSSProperty_visibility: mDisplay->mVisibility.Reset(); break;
|
2001-06-01 02:19:43 +04:00
|
|
|
case eCSSProperty_opacity: mDisplay->mOpacity.Reset(); break;
|
2000-04-28 12:35:40 +04:00
|
|
|
case eCSSProperty_overflow: mDisplay->mOverflow.Reset(); break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case eCSSProperty_clip_top:
|
|
|
|
case eCSSProperty_clip_right:
|
|
|
|
case eCSSProperty_clip_bottom:
|
|
|
|
case eCSSProperty_clip_left:
|
|
|
|
CSS_CHECK(Display) {
|
|
|
|
CSS_CHECK_RECT(mDisplay->mClip) {
|
|
|
|
switch(aProperty) {
|
|
|
|
case eCSSProperty_clip_top: mDisplay->mClip->mTop.Reset(); break;
|
|
|
|
case eCSSProperty_clip_right: mDisplay->mClip->mRight.Reset(); break;
|
|
|
|
case eCSSProperty_clip_bottom: mDisplay->mClip->mBottom.Reset(); break;
|
|
|
|
case eCSSProperty_clip_left: mDisplay->mClip->mLeft.Reset(); break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSMargin
|
|
|
|
case eCSSProperty_margin_top:
|
|
|
|
case eCSSProperty_margin_right:
|
|
|
|
case eCSSProperty_margin_bottom:
|
|
|
|
case eCSSProperty_margin_left:
|
|
|
|
CSS_CHECK(Margin) {
|
|
|
|
CSS_CHECK_RECT(mMargin->mMargin) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty_margin_top: mMargin->mMargin->mTop.Reset(); break;
|
|
|
|
case eCSSProperty_margin_right: mMargin->mMargin->mRight.Reset(); break;
|
|
|
|
case eCSSProperty_margin_bottom: mMargin->mMargin->mBottom.Reset(); break;
|
|
|
|
case eCSSProperty_margin_left: mMargin->mMargin->mLeft.Reset(); break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case eCSSProperty_padding_top:
|
|
|
|
case eCSSProperty_padding_right:
|
|
|
|
case eCSSProperty_padding_bottom:
|
|
|
|
case eCSSProperty_padding_left:
|
|
|
|
CSS_CHECK(Margin) {
|
|
|
|
CSS_CHECK_RECT(mMargin->mPadding) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty_padding_top: mMargin->mPadding->mTop.Reset(); break;
|
|
|
|
case eCSSProperty_padding_right: mMargin->mPadding->mRight.Reset(); break;
|
|
|
|
case eCSSProperty_padding_bottom: mMargin->mPadding->mBottom.Reset(); break;
|
|
|
|
case eCSSProperty_padding_left: mMargin->mPadding->mLeft.Reset(); break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case eCSSProperty_border_top_width:
|
|
|
|
case eCSSProperty_border_right_width:
|
|
|
|
case eCSSProperty_border_bottom_width:
|
|
|
|
case eCSSProperty_border_left_width:
|
|
|
|
CSS_CHECK(Margin) {
|
|
|
|
CSS_CHECK_RECT(mMargin->mBorderWidth) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty_border_top_width: mMargin->mBorderWidth->mTop.Reset(); break;
|
|
|
|
case eCSSProperty_border_right_width: mMargin->mBorderWidth->mRight.Reset(); break;
|
|
|
|
case eCSSProperty_border_bottom_width: mMargin->mBorderWidth->mBottom.Reset(); break;
|
|
|
|
case eCSSProperty_border_left_width: mMargin->mBorderWidth->mLeft.Reset(); break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case eCSSProperty_border_top_color:
|
|
|
|
case eCSSProperty_border_right_color:
|
|
|
|
case eCSSProperty_border_bottom_color:
|
|
|
|
case eCSSProperty_border_left_color:
|
|
|
|
CSS_CHECK(Margin) {
|
|
|
|
CSS_CHECK_RECT(mMargin->mBorderColor) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty_border_top_color: mMargin->mBorderColor->mTop.Reset(); break;
|
|
|
|
case eCSSProperty_border_right_color: mMargin->mBorderColor->mRight.Reset(); break;
|
|
|
|
case eCSSProperty_border_bottom_color: mMargin->mBorderColor->mBottom.Reset(); break;
|
|
|
|
case eCSSProperty_border_left_color: mMargin->mBorderColor->mLeft.Reset(); break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2001-12-05 11:35:05 +03:00
|
|
|
case eCSSProperty_border_top_colors:
|
|
|
|
case eCSSProperty_border_right_colors:
|
|
|
|
case eCSSProperty_border_bottom_colors:
|
|
|
|
case eCSSProperty_border_left_colors:
|
|
|
|
CSS_CHECK(Margin) {
|
|
|
|
if (mMargin->mBorderColors) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty_border_top_colors: CSS_IF_DELETE(mMargin->mBorderColors[0]); break;
|
|
|
|
case eCSSProperty_border_right_colors: CSS_IF_DELETE(mMargin->mBorderColors[1]); break;
|
|
|
|
case eCSSProperty_border_bottom_colors: CSS_IF_DELETE(mMargin->mBorderColors[2]); break;
|
|
|
|
case eCSSProperty_border_left_colors: CSS_IF_DELETE(mMargin->mBorderColors[3]); break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2000-04-28 12:35:40 +04:00
|
|
|
case eCSSProperty_border_top_style:
|
|
|
|
case eCSSProperty_border_right_style:
|
|
|
|
case eCSSProperty_border_bottom_style:
|
|
|
|
case eCSSProperty_border_left_style:
|
|
|
|
CSS_CHECK(Margin) {
|
|
|
|
CSS_CHECK_RECT(mMargin->mBorderStyle) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty_border_top_style: mMargin->mBorderStyle->mTop.Reset(); break;
|
|
|
|
case eCSSProperty_border_right_style: mMargin->mBorderStyle->mRight.Reset(); break;
|
|
|
|
case eCSSProperty_border_bottom_style: mMargin->mBorderStyle->mBottom.Reset(); break;
|
|
|
|
case eCSSProperty_border_left_style: mMargin->mBorderStyle->mLeft.Reset(); break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case eCSSProperty__moz_border_radius_topLeft:
|
|
|
|
case eCSSProperty__moz_border_radius_topRight:
|
|
|
|
case eCSSProperty__moz_border_radius_bottomRight:
|
|
|
|
case eCSSProperty__moz_border_radius_bottomLeft:
|
|
|
|
CSS_CHECK(Margin) {
|
|
|
|
CSS_CHECK_RECT(mMargin->mBorderRadius) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty__moz_border_radius_topLeft: mMargin->mBorderRadius->mTop.Reset(); break;
|
|
|
|
case eCSSProperty__moz_border_radius_topRight: mMargin->mBorderRadius->mRight.Reset(); break;
|
|
|
|
case eCSSProperty__moz_border_radius_bottomRight: mMargin->mBorderRadius->mBottom.Reset(); break;
|
|
|
|
case eCSSProperty__moz_border_radius_bottomLeft: mMargin->mBorderRadius->mLeft.Reset(); break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case eCSSProperty__moz_outline_radius_topLeft:
|
|
|
|
case eCSSProperty__moz_outline_radius_topRight:
|
|
|
|
case eCSSProperty__moz_outline_radius_bottomRight:
|
|
|
|
case eCSSProperty__moz_outline_radius_bottomLeft:
|
|
|
|
CSS_CHECK(Margin) {
|
|
|
|
CSS_CHECK_RECT(mMargin->mOutlineRadius) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty__moz_outline_radius_topLeft: mMargin->mOutlineRadius->mTop.Reset(); break;
|
|
|
|
case eCSSProperty__moz_outline_radius_topRight: mMargin->mOutlineRadius->mRight.Reset(); break;
|
|
|
|
case eCSSProperty__moz_outline_radius_bottomRight: mMargin->mOutlineRadius->mBottom.Reset(); break;
|
|
|
|
case eCSSProperty__moz_outline_radius_bottomLeft: mMargin->mOutlineRadius->mLeft.Reset(); break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case eCSSProperty_outline_width:
|
|
|
|
case eCSSProperty_outline_color:
|
|
|
|
case eCSSProperty_outline_style:
|
|
|
|
case eCSSProperty_float_edge:
|
|
|
|
CSS_CHECK(Margin) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty_outline_width: mMargin->mOutlineWidth.Reset(); break;
|
|
|
|
case eCSSProperty_outline_color: mMargin->mOutlineColor.Reset(); break;
|
|
|
|
case eCSSProperty_outline_style: mMargin->mOutlineStyle.Reset(); break;
|
|
|
|
case eCSSProperty_float_edge: mMargin->mFloatEdge.Reset(); break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSPosition
|
|
|
|
case eCSSProperty_width:
|
|
|
|
case eCSSProperty_min_width:
|
|
|
|
case eCSSProperty_max_width:
|
|
|
|
case eCSSProperty_height:
|
|
|
|
case eCSSProperty_min_height:
|
|
|
|
case eCSSProperty_max_height:
|
|
|
|
case eCSSProperty_box_sizing:
|
|
|
|
case eCSSProperty_z_index:
|
|
|
|
CSS_CHECK(Position) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty_width: mPosition->mWidth.Reset(); break;
|
|
|
|
case eCSSProperty_min_width: mPosition->mMinWidth.Reset(); break;
|
|
|
|
case eCSSProperty_max_width: mPosition->mMaxWidth.Reset(); break;
|
|
|
|
case eCSSProperty_height: mPosition->mHeight.Reset(); break;
|
|
|
|
case eCSSProperty_min_height: mPosition->mMinHeight.Reset(); break;
|
|
|
|
case eCSSProperty_max_height: mPosition->mMaxHeight.Reset(); break;
|
|
|
|
case eCSSProperty_box_sizing: mPosition->mBoxSizing.Reset(); break;
|
|
|
|
case eCSSProperty_z_index: mPosition->mZIndex.Reset(); break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case eCSSProperty_top:
|
|
|
|
case eCSSProperty_right:
|
|
|
|
case eCSSProperty_bottom:
|
|
|
|
case eCSSProperty_left:
|
|
|
|
CSS_CHECK(Position) {
|
|
|
|
CSS_CHECK_RECT(mPosition->mOffset) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty_top: mPosition->mOffset->mTop.Reset(); break;
|
|
|
|
case eCSSProperty_right: mPosition->mOffset->mRight.Reset(); break;
|
|
|
|
case eCSSProperty_bottom: mPosition->mOffset->mBottom.Reset(); break;
|
|
|
|
case eCSSProperty_left: mPosition->mOffset->mLeft.Reset(); break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSList
|
|
|
|
case eCSSProperty_list_style_type:
|
|
|
|
case eCSSProperty_list_style_image:
|
|
|
|
case eCSSProperty_list_style_position:
|
|
|
|
CSS_CHECK(List) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty_list_style_type: mList->mType.Reset(); break;
|
|
|
|
case eCSSProperty_list_style_image: mList->mImage.Reset(); break;
|
|
|
|
case eCSSProperty_list_style_position: mList->mPosition.Reset(); break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2001-12-05 11:35:05 +03:00
|
|
|
case eCSSProperty_image_region_top:
|
|
|
|
case eCSSProperty_image_region_right:
|
|
|
|
case eCSSProperty_image_region_bottom:
|
|
|
|
case eCSSProperty_image_region_left:
|
|
|
|
CSS_CHECK(List) {
|
|
|
|
CSS_CHECK_RECT(mList->mImageRegion) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty_image_region_top: mList->mImageRegion->mTop.Reset(); break;
|
|
|
|
case eCSSProperty_image_region_right: mList->mImageRegion->mRight.Reset(); break;
|
|
|
|
case eCSSProperty_image_region_bottom: mList->mImageRegion->mBottom.Reset(); break;
|
|
|
|
case eCSSProperty_image_region_left: mList->mImageRegion->mLeft.Reset(); break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2000-04-28 12:35:40 +04:00
|
|
|
// nsCSSTable
|
|
|
|
case eCSSProperty_border_collapse:
|
|
|
|
case eCSSProperty_border_x_spacing:
|
|
|
|
case eCSSProperty_border_y_spacing:
|
|
|
|
case eCSSProperty_caption_side:
|
|
|
|
case eCSSProperty_empty_cells:
|
|
|
|
case eCSSProperty_table_layout:
|
|
|
|
CSS_CHECK(Table) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty_border_collapse: mTable->mBorderCollapse.Reset(); break;
|
|
|
|
case eCSSProperty_border_x_spacing: mTable->mBorderSpacingX.Reset(); break;
|
|
|
|
case eCSSProperty_border_y_spacing: mTable->mBorderSpacingY.Reset(); break;
|
|
|
|
case eCSSProperty_caption_side: mTable->mCaptionSide.Reset(); break;
|
|
|
|
case eCSSProperty_empty_cells: mTable->mEmptyCells.Reset(); break;
|
|
|
|
case eCSSProperty_table_layout: mTable->mLayout.Reset(); break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSBreaks
|
|
|
|
case eCSSProperty_orphans:
|
|
|
|
case eCSSProperty_widows:
|
|
|
|
case eCSSProperty_page:
|
|
|
|
case eCSSProperty_page_break_after:
|
|
|
|
case eCSSProperty_page_break_before:
|
|
|
|
case eCSSProperty_page_break_inside:
|
|
|
|
CSS_CHECK(Breaks) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty_orphans: mBreaks->mOrphans.Reset(); break;
|
|
|
|
case eCSSProperty_widows: mBreaks->mWidows.Reset(); break;
|
|
|
|
case eCSSProperty_page: mBreaks->mPage.Reset(); break;
|
|
|
|
case eCSSProperty_page_break_after: mBreaks->mPageBreakAfter.Reset(); break;
|
|
|
|
case eCSSProperty_page_break_before: mBreaks->mPageBreakBefore.Reset(); break;
|
|
|
|
case eCSSProperty_page_break_inside: mBreaks->mPageBreakInside.Reset(); break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSPage
|
|
|
|
case eCSSProperty_marks:
|
|
|
|
case eCSSProperty_size_width:
|
|
|
|
case eCSSProperty_size_height:
|
|
|
|
CSS_CHECK(Page) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty_marks: mPage->mMarks.Reset(); break;
|
|
|
|
case eCSSProperty_size_width: mPage->mSizeWidth.Reset(); break;
|
|
|
|
case eCSSProperty_size_height: mPage->mSizeHeight.Reset(); break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSContent
|
|
|
|
case eCSSProperty_content:
|
|
|
|
case eCSSProperty_counter_increment:
|
|
|
|
case eCSSProperty_counter_reset:
|
|
|
|
case eCSSProperty_marker_offset:
|
|
|
|
case eCSSProperty_quotes_open:
|
|
|
|
case eCSSProperty_quotes_close:
|
|
|
|
CSS_CHECK(Content) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty_content:
|
|
|
|
CSS_CHECK_DATA(mContent->mContent, nsCSSValueList) {
|
|
|
|
mContent->mContent->mValue.Reset();
|
|
|
|
CSS_IF_DELETE(mContent->mContent->mNext);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case eCSSProperty_counter_increment:
|
|
|
|
CSS_CHECK_DATA(mContent->mCounterIncrement, nsCSSCounterData) {
|
|
|
|
mContent->mCounterIncrement->mCounter.Reset();
|
|
|
|
CSS_IF_DELETE(mContent->mCounterIncrement->mNext);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case eCSSProperty_counter_reset:
|
|
|
|
CSS_CHECK_DATA(mContent->mCounterReset, nsCSSCounterData) {
|
|
|
|
mContent->mCounterReset->mCounter.Reset();
|
|
|
|
CSS_IF_DELETE(mContent->mCounterReset->mNext);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case eCSSProperty_marker_offset: mContent->mMarkerOffset.Reset(); break;
|
|
|
|
case eCSSProperty_quotes_open:
|
|
|
|
CSS_CHECK_DATA(mContent->mQuotes, nsCSSQuotes) {
|
|
|
|
mContent->mQuotes->mOpen.Reset();
|
|
|
|
CSS_IF_DELETE(mContent->mQuotes->mNext);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case eCSSProperty_quotes_close:
|
|
|
|
CSS_CHECK_DATA(mContent->mQuotes, nsCSSQuotes) {
|
|
|
|
mContent->mQuotes->mClose.Reset();
|
|
|
|
CSS_IF_DELETE(mContent->mQuotes->mNext);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSUserInterface
|
|
|
|
case eCSSProperty_user_input:
|
|
|
|
case eCSSProperty_user_modify:
|
|
|
|
case eCSSProperty_user_select:
|
|
|
|
case eCSSProperty_key_equivalent:
|
|
|
|
case eCSSProperty_user_focus:
|
|
|
|
case eCSSProperty_resizer:
|
2001-06-01 02:19:43 +04:00
|
|
|
case eCSSProperty_cursor:
|
2000-04-28 12:35:40 +04:00
|
|
|
CSS_CHECK(UserInterface) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty_user_input: mUserInterface->mUserInput.Reset(); break;
|
|
|
|
case eCSSProperty_user_modify: mUserInterface->mUserModify.Reset(); break;
|
|
|
|
case eCSSProperty_user_select: mUserInterface->mUserSelect.Reset(); break;
|
|
|
|
case eCSSProperty_key_equivalent:
|
|
|
|
CSS_CHECK_DATA(mUserInterface->mKeyEquivalent, nsCSSValueList) {
|
|
|
|
mUserInterface->mKeyEquivalent->mValue.Reset();
|
|
|
|
CSS_IF_DELETE(mUserInterface->mKeyEquivalent->mNext);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case eCSSProperty_user_focus: mUserInterface->mUserFocus.Reset(); break;
|
|
|
|
case eCSSProperty_resizer: mUserInterface->mResizer.Reset(); break;
|
2001-06-01 02:19:43 +04:00
|
|
|
case eCSSProperty_cursor:
|
|
|
|
CSS_CHECK_DATA(mUserInterface->mCursor, nsCSSValueList) {
|
|
|
|
mUserInterface->mCursor->mValue.Reset();
|
|
|
|
CSS_IF_DELETE(mUserInterface->mCursor->mNext);
|
|
|
|
}
|
2000-04-28 12:35:40 +04:00
|
|
|
break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2001-03-06 05:30:30 +03:00
|
|
|
#ifdef INCLUDE_XUL
|
|
|
|
// nsCSSXUL
|
2001-08-02 04:09:27 +04:00
|
|
|
case eCSSProperty_box_align:
|
|
|
|
case eCSSProperty_box_direction:
|
|
|
|
case eCSSProperty_box_flex:
|
2001-03-06 05:30:30 +03:00
|
|
|
case eCSSProperty_box_orient:
|
2001-08-02 04:09:27 +04:00
|
|
|
case eCSSProperty_box_pack:
|
2001-09-26 02:17:00 +04:00
|
|
|
case eCSSProperty_box_ordinal_group:
|
2001-03-06 05:30:30 +03:00
|
|
|
CSS_CHECK(XUL) {
|
|
|
|
switch(aProperty) {
|
2001-09-26 02:17:00 +04:00
|
|
|
case eCSSProperty_box_align: mXUL->mBoxAlign.Reset(); break;
|
|
|
|
case eCSSProperty_box_direction: mXUL->mBoxDirection.Reset(); break;
|
|
|
|
case eCSSProperty_box_flex: mXUL->mBoxFlex.Reset(); break;
|
|
|
|
case eCSSProperty_box_orient: mXUL->mBoxOrient.Reset(); break;
|
|
|
|
case eCSSProperty_box_pack: mXUL->mBoxPack.Reset(); break;
|
|
|
|
case eCSSProperty_box_ordinal_group: mXUL->mBoxOrdinal.Reset(); break;
|
2001-03-06 05:30:30 +03:00
|
|
|
CSS_BOGUS_DEFAULT; // Make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
|
2000-04-28 12:35:40 +04:00
|
|
|
// nsCSSAural
|
|
|
|
case eCSSProperty_azimuth:
|
|
|
|
case eCSSProperty_elevation:
|
|
|
|
case eCSSProperty_cue_after:
|
|
|
|
case eCSSProperty_cue_before:
|
|
|
|
case eCSSProperty_pause_after:
|
|
|
|
case eCSSProperty_pause_before:
|
|
|
|
case eCSSProperty_pitch:
|
|
|
|
case eCSSProperty_pitch_range:
|
|
|
|
case eCSSProperty_play_during:
|
|
|
|
case eCSSProperty_play_during_flags:
|
|
|
|
case eCSSProperty_richness:
|
|
|
|
case eCSSProperty_speak:
|
|
|
|
case eCSSProperty_speak_header:
|
|
|
|
case eCSSProperty_speak_numeral:
|
|
|
|
case eCSSProperty_speak_punctuation:
|
|
|
|
case eCSSProperty_speech_rate:
|
|
|
|
case eCSSProperty_stress:
|
|
|
|
case eCSSProperty_voice_family:
|
|
|
|
case eCSSProperty_volume:
|
|
|
|
CSS_CHECK(Aural) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty_azimuth: mAural->mAzimuth.Reset(); break;
|
|
|
|
case eCSSProperty_elevation: mAural->mElevation.Reset(); break;
|
|
|
|
case eCSSProperty_cue_after: mAural->mCueAfter.Reset(); break;
|
|
|
|
case eCSSProperty_cue_before: mAural->mCueBefore.Reset(); break;
|
|
|
|
case eCSSProperty_pause_after: mAural->mPauseAfter.Reset(); break;
|
|
|
|
case eCSSProperty_pause_before: mAural->mPauseBefore.Reset(); break;
|
|
|
|
case eCSSProperty_pitch: mAural->mPitch.Reset(); break;
|
|
|
|
case eCSSProperty_pitch_range: mAural->mPitchRange.Reset(); break;
|
|
|
|
case eCSSProperty_play_during: mAural->mPlayDuring.Reset(); break;
|
|
|
|
case eCSSProperty_play_during_flags: mAural->mPlayDuringFlags.Reset(); break;
|
|
|
|
case eCSSProperty_richness: mAural->mRichness.Reset(); break;
|
|
|
|
case eCSSProperty_speak: mAural->mSpeak.Reset(); break;
|
|
|
|
case eCSSProperty_speak_header: mAural->mSpeakHeader.Reset(); break;
|
|
|
|
case eCSSProperty_speak_numeral: mAural->mSpeakNumeral.Reset(); break;
|
|
|
|
case eCSSProperty_speak_punctuation: mAural->mSpeakPunctuation.Reset(); break;
|
|
|
|
case eCSSProperty_speech_rate: mAural->mSpeechRate.Reset(); break;
|
|
|
|
case eCSSProperty_stress: mAural->mStress.Reset(); break;
|
|
|
|
case eCSSProperty_voice_family: mAural->mVoiceFamily.Reset(); break;
|
|
|
|
case eCSSProperty_volume: mAural->mVolume.Reset(); break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// Shorthands
|
|
|
|
case eCSSProperty_background:
|
|
|
|
RemoveProperty(eCSSProperty_background_color);
|
|
|
|
RemoveProperty(eCSSProperty_background_image);
|
|
|
|
RemoveProperty(eCSSProperty_background_repeat);
|
|
|
|
RemoveProperty(eCSSProperty_background_attachment);
|
|
|
|
RemoveProperty(eCSSProperty_background_x_position);
|
|
|
|
RemoveProperty(eCSSProperty_background_y_position);
|
|
|
|
break;
|
|
|
|
case eCSSProperty_border:
|
|
|
|
CSS_CHECK(Margin) {
|
|
|
|
CSS_IF_DELETE(mMargin->mBorderWidth);
|
|
|
|
CSS_IF_DELETE(mMargin->mBorderStyle);
|
|
|
|
CSS_IF_DELETE(mMargin->mBorderColor);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case eCSSProperty_border_spacing:
|
|
|
|
RemoveProperty(eCSSProperty_border_x_spacing);
|
|
|
|
RemoveProperty(eCSSProperty_border_y_spacing);
|
|
|
|
break;
|
|
|
|
case eCSSProperty_clip:
|
|
|
|
CSS_CHECK(Display) {
|
|
|
|
CSS_IF_DELETE(mDisplay->mClip);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case eCSSProperty_cue:
|
|
|
|
RemoveProperty(eCSSProperty_cue_after);
|
|
|
|
RemoveProperty(eCSSProperty_cue_before);
|
|
|
|
break;
|
|
|
|
case eCSSProperty_font:
|
|
|
|
RemoveProperty(eCSSProperty_font_family);
|
|
|
|
RemoveProperty(eCSSProperty_font_style);
|
|
|
|
RemoveProperty(eCSSProperty_font_variant);
|
|
|
|
RemoveProperty(eCSSProperty_font_weight);
|
|
|
|
RemoveProperty(eCSSProperty_font_size);
|
|
|
|
RemoveProperty(eCSSProperty_line_height);
|
|
|
|
break;
|
2001-12-05 11:35:05 +03:00
|
|
|
case eCSSProperty_image_region:
|
|
|
|
CSS_CHECK(List) {
|
|
|
|
CSS_IF_DELETE(mList->mImageRegion);
|
|
|
|
}
|
|
|
|
break;
|
2000-04-28 12:35:40 +04:00
|
|
|
case eCSSProperty_list_style:
|
|
|
|
RemoveProperty(eCSSProperty_list_style_type);
|
|
|
|
RemoveProperty(eCSSProperty_list_style_image);
|
|
|
|
RemoveProperty(eCSSProperty_list_style_position);
|
|
|
|
break;
|
|
|
|
case eCSSProperty_margin:
|
|
|
|
CSS_CHECK(Margin) {
|
|
|
|
CSS_IF_DELETE(mMargin->mMargin);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case eCSSProperty_outline:
|
|
|
|
RemoveProperty(eCSSProperty_outline_color);
|
|
|
|
RemoveProperty(eCSSProperty_outline_style);
|
|
|
|
RemoveProperty(eCSSProperty_outline_width);
|
|
|
|
break;
|
|
|
|
case eCSSProperty_padding:
|
|
|
|
CSS_CHECK(Margin) {
|
|
|
|
CSS_IF_DELETE(mMargin->mPadding);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case eCSSProperty_pause:
|
|
|
|
RemoveProperty(eCSSProperty_pause_after);
|
|
|
|
RemoveProperty(eCSSProperty_pause_before);
|
|
|
|
break;
|
|
|
|
case eCSSProperty_quotes:
|
|
|
|
CSS_CHECK(Content) {
|
|
|
|
CSS_IF_DELETE(mContent->mQuotes);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case eCSSProperty_size:
|
|
|
|
RemoveProperty(eCSSProperty_size_width);
|
|
|
|
RemoveProperty(eCSSProperty_size_height);
|
|
|
|
break;
|
|
|
|
case eCSSProperty_text_shadow:
|
|
|
|
CSS_CHECK(Text) {
|
|
|
|
CSS_IF_DELETE(mText->mTextShadow);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case eCSSProperty_background_position:
|
|
|
|
RemoveProperty(eCSSProperty_background_x_position);
|
|
|
|
RemoveProperty(eCSSProperty_background_y_position);
|
|
|
|
break;
|
|
|
|
case eCSSProperty_border_top:
|
|
|
|
RemoveProperty(eCSSProperty_border_top_width);
|
|
|
|
RemoveProperty(eCSSProperty_border_top_style);
|
|
|
|
RemoveProperty(eCSSProperty_border_top_color);
|
|
|
|
break;
|
|
|
|
case eCSSProperty_border_right:
|
|
|
|
RemoveProperty(eCSSProperty_border_right_width);
|
|
|
|
RemoveProperty(eCSSProperty_border_right_style);
|
|
|
|
RemoveProperty(eCSSProperty_border_right_color);
|
|
|
|
break;
|
|
|
|
case eCSSProperty_border_bottom:
|
|
|
|
RemoveProperty(eCSSProperty_border_bottom_width);
|
|
|
|
RemoveProperty(eCSSProperty_border_bottom_style);
|
|
|
|
RemoveProperty(eCSSProperty_border_bottom_color);
|
|
|
|
break;
|
|
|
|
case eCSSProperty_border_left:
|
|
|
|
RemoveProperty(eCSSProperty_border_left_width);
|
|
|
|
RemoveProperty(eCSSProperty_border_left_style);
|
|
|
|
RemoveProperty(eCSSProperty_border_left_color);
|
|
|
|
break;
|
|
|
|
case eCSSProperty_border_color:
|
|
|
|
CSS_CHECK(Margin) {
|
|
|
|
CSS_IF_DELETE(mMargin->mBorderColor);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case eCSSProperty_border_style:
|
|
|
|
CSS_CHECK(Margin) {
|
|
|
|
CSS_IF_DELETE(mMargin->mBorderStyle);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case eCSSProperty_border_width:
|
|
|
|
CSS_CHECK(Margin) {
|
|
|
|
CSS_IF_DELETE(mMargin->mBorderWidth);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case eCSSProperty__moz_border_radius:
|
|
|
|
CSS_CHECK(Margin) {
|
|
|
|
CSS_IF_DELETE(mMargin->mBorderRadius);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case eCSSProperty__moz_outline_radius:
|
|
|
|
CSS_CHECK(Margin) {
|
|
|
|
CSS_IF_DELETE(mMargin->mOutlineRadius);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
// default: // XXX explicitly removing default case so compiler will help find missed props
|
|
|
|
case eCSSProperty_UNKNOWN:
|
|
|
|
case eCSSProperty_COUNT:
|
|
|
|
result = NS_ERROR_ILLEGAL_VALUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (NS_OK == result) {
|
|
|
|
if (nsnull != mOrder) {
|
|
|
|
PRInt32 index = mOrder->IndexOf((void*)aProperty);
|
|
|
|
if (-1 != index) {
|
|
|
|
mOrder->RemoveElementAt(index);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
CSSDeclarationImpl::RemoveProperty(nsCSSProperty aProperty, nsCSSValue& aValue)
|
|
|
|
{
|
|
|
|
nsresult result = NS_OK;
|
|
|
|
|
|
|
|
PRBool isImportant = PR_FALSE;
|
|
|
|
GetValueIsImportant(aProperty, isImportant);
|
|
|
|
if (isImportant) {
|
|
|
|
result = mImportant->GetValue(aProperty, aValue);
|
|
|
|
if (NS_SUCCEEDED(result)) {
|
|
|
|
result = mImportant->RemoveProperty(aProperty);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
result = GetValue(aProperty, aValue);
|
|
|
|
if (NS_SUCCEEDED(result)) {
|
|
|
|
result = RemoveProperty(aProperty);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
1999-01-06 04:25:39 +03:00
|
|
|
NS_IMETHODIMP
|
2000-08-23 21:27:06 +04:00
|
|
|
CSSDeclarationImpl::AppendComment(const nsAReadableString& aComment)
|
1998-07-17 09:50:35 +04:00
|
|
|
{
|
|
|
|
nsresult result = NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
|
|
|
|
if (nsnull == mOrder) {
|
2001-08-27 10:15:54 +04:00
|
|
|
mOrder = new nsAutoVoidArray();
|
1998-07-17 09:50:35 +04:00
|
|
|
}
|
|
|
|
if (nsnull == mComments) {
|
1999-06-03 05:58:11 +04:00
|
|
|
mComments = new nsStringArray();
|
1998-07-17 09:50:35 +04:00
|
|
|
}
|
|
|
|
if ((nsnull != mComments) && (nsnull != mOrder)) {
|
1999-06-03 05:58:11 +04:00
|
|
|
mComments->AppendString(aComment);
|
1998-07-17 09:50:35 +04:00
|
|
|
mOrder->AppendElement((void*)-mComments->Count());
|
|
|
|
result = NS_OK;
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
1999-01-06 04:25:39 +03:00
|
|
|
NS_IMETHODIMP
|
1999-07-18 04:25:28 +04:00
|
|
|
CSSDeclarationImpl::GetValue(nsCSSProperty aProperty, nsCSSValue& aValue)
|
1998-04-14 00:24:54 +04:00
|
|
|
{
|
|
|
|
nsresult result = NS_OK;
|
|
|
|
|
|
|
|
switch (aProperty) {
|
|
|
|
// nsCSSFont
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_font_family:
|
|
|
|
case eCSSProperty_font_style:
|
|
|
|
case eCSSProperty_font_variant:
|
|
|
|
case eCSSProperty_font_weight:
|
|
|
|
case eCSSProperty_font_size:
|
|
|
|
case eCSSProperty_font_size_adjust:
|
|
|
|
case eCSSProperty_font_stretch:
|
1998-04-14 00:24:54 +04:00
|
|
|
if (nsnull != mFont) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_font_family: aValue = mFont->mFamily; break;
|
|
|
|
case eCSSProperty_font_style: aValue = mFont->mStyle; break;
|
|
|
|
case eCSSProperty_font_variant: aValue = mFont->mVariant; break;
|
|
|
|
case eCSSProperty_font_weight: aValue = mFont->mWeight; break;
|
|
|
|
case eCSSProperty_font_size: aValue = mFont->mSize; break;
|
|
|
|
case eCSSProperty_font_size_adjust: aValue = mFont->mSizeAdjust; break;
|
|
|
|
case eCSSProperty_font_stretch: aValue = mFont->mStretch; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aValue.Reset();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSColor
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_color:
|
|
|
|
case eCSSProperty_background_color:
|
|
|
|
case eCSSProperty_background_image:
|
|
|
|
case eCSSProperty_background_repeat:
|
|
|
|
case eCSSProperty_background_attachment:
|
|
|
|
case eCSSProperty_background_x_position:
|
|
|
|
case eCSSProperty_background_y_position:
|
1998-04-14 00:24:54 +04:00
|
|
|
if (nsnull != mColor) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_color: aValue = mColor->mColor; break;
|
|
|
|
case eCSSProperty_background_color: aValue = mColor->mBackColor; break;
|
|
|
|
case eCSSProperty_background_image: aValue = mColor->mBackImage; break;
|
|
|
|
case eCSSProperty_background_repeat: aValue = mColor->mBackRepeat; break;
|
|
|
|
case eCSSProperty_background_attachment: aValue = mColor->mBackAttachment; break;
|
|
|
|
case eCSSProperty_background_x_position: aValue = mColor->mBackPositionX; break;
|
|
|
|
case eCSSProperty_background_y_position: aValue = mColor->mBackPositionY; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aValue.Reset();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSText
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_word_spacing:
|
|
|
|
case eCSSProperty_letter_spacing:
|
|
|
|
case eCSSProperty_text_decoration:
|
|
|
|
case eCSSProperty_vertical_align:
|
|
|
|
case eCSSProperty_text_transform:
|
|
|
|
case eCSSProperty_text_align:
|
|
|
|
case eCSSProperty_text_indent:
|
|
|
|
case eCSSProperty_unicode_bidi:
|
|
|
|
case eCSSProperty_line_height:
|
|
|
|
case eCSSProperty_white_space:
|
1998-04-14 00:24:54 +04:00
|
|
|
if (nsnull != mText) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_word_spacing: aValue = mText->mWordSpacing; break;
|
|
|
|
case eCSSProperty_letter_spacing: aValue = mText->mLetterSpacing; break;
|
|
|
|
case eCSSProperty_text_decoration: aValue = mText->mDecoration; break;
|
|
|
|
case eCSSProperty_vertical_align: aValue = mText->mVerticalAlign; break;
|
|
|
|
case eCSSProperty_text_transform: aValue = mText->mTextTransform; break;
|
|
|
|
case eCSSProperty_text_align: aValue = mText->mTextAlign; break;
|
|
|
|
case eCSSProperty_text_indent: aValue = mText->mTextIndent; break;
|
|
|
|
case eCSSProperty_unicode_bidi: aValue = mText->mUnicodeBidi; break;
|
|
|
|
case eCSSProperty_line_height: aValue = mText->mLineHeight; break;
|
|
|
|
case eCSSProperty_white_space: aValue = mText->mWhiteSpace; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aValue.Reset();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_text_shadow_color:
|
|
|
|
case eCSSProperty_text_shadow_x:
|
|
|
|
case eCSSProperty_text_shadow_y:
|
|
|
|
case eCSSProperty_text_shadow_radius:
|
1998-10-08 05:31:58 +04:00
|
|
|
if ((nsnull != mText) && (nsnull != mText->mTextShadow)) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_text_shadow_color: aValue = mText->mTextShadow->mColor; break;
|
|
|
|
case eCSSProperty_text_shadow_x: aValue = mText->mTextShadow->mXOffset; break;
|
|
|
|
case eCSSProperty_text_shadow_y: aValue = mText->mTextShadow->mYOffset; break;
|
|
|
|
case eCSSProperty_text_shadow_radius: aValue = mText->mTextShadow->mRadius; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSDisplay
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_float:
|
|
|
|
case eCSSProperty_clear:
|
|
|
|
case eCSSProperty_display:
|
2001-06-01 02:19:43 +04:00
|
|
|
case eCSSProperty_binding:
|
|
|
|
case eCSSProperty_position:
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_direction:
|
|
|
|
case eCSSProperty_visibility:
|
2001-06-01 02:19:43 +04:00
|
|
|
case eCSSProperty_opacity:
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_overflow:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mDisplay) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_float: aValue = mDisplay->mFloat; break;
|
|
|
|
case eCSSProperty_clear: aValue = mDisplay->mClear; break;
|
|
|
|
case eCSSProperty_display: aValue = mDisplay->mDisplay; break;
|
2001-06-01 02:19:43 +04:00
|
|
|
case eCSSProperty_binding:
|
|
|
|
aValue = mDisplay->mBinding;
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_direction: aValue = mDisplay->mDirection; break;
|
2001-06-01 02:19:43 +04:00
|
|
|
case eCSSProperty_position: aValue = mDisplay->mPosition; break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_visibility: aValue = mDisplay->mVisibility; break;
|
2001-06-01 02:19:43 +04:00
|
|
|
case eCSSProperty_opacity: aValue = mDisplay->mOpacity; break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_overflow: aValue = mDisplay->mOverflow; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aValue.Reset();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_clip_top:
|
|
|
|
case eCSSProperty_clip_right:
|
|
|
|
case eCSSProperty_clip_bottom:
|
|
|
|
case eCSSProperty_clip_left:
|
1998-10-08 05:31:58 +04:00
|
|
|
if ((nsnull != mDisplay) && (nsnull != mDisplay->mClip)) {
|
|
|
|
switch(aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_clip_top: aValue = mDisplay->mClip->mTop; break;
|
|
|
|
case eCSSProperty_clip_right: aValue = mDisplay->mClip->mRight; break;
|
|
|
|
case eCSSProperty_clip_bottom: aValue = mDisplay->mClip->mBottom; break;
|
|
|
|
case eCSSProperty_clip_left: aValue = mDisplay->mClip->mLeft; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aValue.Reset();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
// nsCSSMargin
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_margin_top:
|
|
|
|
case eCSSProperty_margin_right:
|
|
|
|
case eCSSProperty_margin_bottom:
|
|
|
|
case eCSSProperty_margin_left:
|
1998-04-14 00:24:54 +04:00
|
|
|
if ((nsnull != mMargin) && (nsnull != mMargin->mMargin)) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_margin_top: aValue = mMargin->mMargin->mTop; break;
|
|
|
|
case eCSSProperty_margin_right: aValue = mMargin->mMargin->mRight; break;
|
|
|
|
case eCSSProperty_margin_bottom: aValue = mMargin->mMargin->mBottom; break;
|
|
|
|
case eCSSProperty_margin_left: aValue = mMargin->mMargin->mLeft; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aValue.Reset();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_padding_top:
|
|
|
|
case eCSSProperty_padding_right:
|
|
|
|
case eCSSProperty_padding_bottom:
|
|
|
|
case eCSSProperty_padding_left:
|
1998-04-14 00:24:54 +04:00
|
|
|
if ((nsnull != mMargin) && (nsnull != mMargin->mPadding)) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_padding_top: aValue = mMargin->mPadding->mTop; break;
|
|
|
|
case eCSSProperty_padding_right: aValue = mMargin->mPadding->mRight; break;
|
|
|
|
case eCSSProperty_padding_bottom: aValue = mMargin->mPadding->mBottom; break;
|
|
|
|
case eCSSProperty_padding_left: aValue = mMargin->mPadding->mLeft; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aValue.Reset();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_top_width:
|
|
|
|
case eCSSProperty_border_right_width:
|
|
|
|
case eCSSProperty_border_bottom_width:
|
|
|
|
case eCSSProperty_border_left_width:
|
1998-10-08 05:31:58 +04:00
|
|
|
if ((nsnull != mMargin) && (nsnull != mMargin->mBorderWidth)) {
|
1998-04-14 00:24:54 +04:00
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_top_width: aValue = mMargin->mBorderWidth->mTop; break;
|
|
|
|
case eCSSProperty_border_right_width: aValue = mMargin->mBorderWidth->mRight; break;
|
|
|
|
case eCSSProperty_border_bottom_width: aValue = mMargin->mBorderWidth->mBottom; break;
|
|
|
|
case eCSSProperty_border_left_width: aValue = mMargin->mBorderWidth->mLeft; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aValue.Reset();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_top_color:
|
|
|
|
case eCSSProperty_border_right_color:
|
|
|
|
case eCSSProperty_border_bottom_color:
|
|
|
|
case eCSSProperty_border_left_color:
|
1998-10-08 05:31:58 +04:00
|
|
|
if ((nsnull != mMargin) && (nsnull != mMargin->mBorderColor)) {
|
1998-04-14 00:24:54 +04:00
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_top_color: aValue = mMargin->mBorderColor->mTop; break;
|
|
|
|
case eCSSProperty_border_right_color: aValue = mMargin->mBorderColor->mRight; break;
|
|
|
|
case eCSSProperty_border_bottom_color: aValue = mMargin->mBorderColor->mBottom; break;
|
|
|
|
case eCSSProperty_border_left_color: aValue = mMargin->mBorderColor->mLeft; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aValue.Reset();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_top_style:
|
|
|
|
case eCSSProperty_border_right_style:
|
|
|
|
case eCSSProperty_border_bottom_style:
|
|
|
|
case eCSSProperty_border_left_style:
|
1998-10-08 05:31:58 +04:00
|
|
|
if ((nsnull != mMargin) && (nsnull != mMargin->mBorderStyle)) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_top_style: aValue = mMargin->mBorderStyle->mTop; break;
|
|
|
|
case eCSSProperty_border_right_style: aValue = mMargin->mBorderStyle->mRight; break;
|
|
|
|
case eCSSProperty_border_bottom_style: aValue = mMargin->mBorderStyle->mBottom; break;
|
|
|
|
case eCSSProperty_border_left_style: aValue = mMargin->mBorderStyle->mLeft; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aValue.Reset();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-12-22 14:27:10 +03:00
|
|
|
case eCSSProperty__moz_border_radius_topLeft:
|
|
|
|
case eCSSProperty__moz_border_radius_topRight:
|
|
|
|
case eCSSProperty__moz_border_radius_bottomRight:
|
|
|
|
case eCSSProperty__moz_border_radius_bottomLeft:
|
|
|
|
if ((nsnull != mMargin) && (nsnull != mMargin->mBorderRadius)) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty__moz_border_radius_topLeft: aValue = mMargin->mBorderRadius->mTop; break;
|
|
|
|
case eCSSProperty__moz_border_radius_topRight: aValue = mMargin->mBorderRadius->mRight; break;
|
|
|
|
case eCSSProperty__moz_border_radius_bottomRight: aValue = mMargin->mBorderRadius->mBottom; break;
|
|
|
|
case eCSSProperty__moz_border_radius_bottomLeft: aValue = mMargin->mBorderRadius->mLeft; break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aValue.Reset();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2000-01-24 14:19:55 +03:00
|
|
|
case eCSSProperty__moz_outline_radius_topLeft:
|
|
|
|
case eCSSProperty__moz_outline_radius_topRight:
|
|
|
|
case eCSSProperty__moz_outline_radius_bottomRight:
|
|
|
|
case eCSSProperty__moz_outline_radius_bottomLeft:
|
|
|
|
if ((nsnull != mMargin) && (nsnull != mMargin->mOutlineRadius)) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty__moz_outline_radius_topLeft: aValue = mMargin->mOutlineRadius->mTop; break;
|
|
|
|
case eCSSProperty__moz_outline_radius_topRight: aValue = mMargin->mOutlineRadius->mRight; break;
|
|
|
|
case eCSSProperty__moz_outline_radius_bottomRight: aValue = mMargin->mOutlineRadius->mBottom; break;
|
|
|
|
case eCSSProperty__moz_outline_radius_bottomLeft: aValue = mMargin->mOutlineRadius->mLeft; break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aValue.Reset();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_outline_width:
|
|
|
|
case eCSSProperty_outline_color:
|
|
|
|
case eCSSProperty_outline_style:
|
1999-07-24 23:04:42 +04:00
|
|
|
case eCSSProperty_float_edge:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mMargin) {
|
1998-04-14 00:24:54 +04:00
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_outline_width: aValue = mMargin->mOutlineWidth; break;
|
|
|
|
case eCSSProperty_outline_color: aValue = mMargin->mOutlineColor; break;
|
|
|
|
case eCSSProperty_outline_style: aValue = mMargin->mOutlineStyle; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
case eCSSProperty_float_edge: aValue = mMargin->mFloatEdge; break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aValue.Reset();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSPosition
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_width:
|
|
|
|
case eCSSProperty_min_width:
|
|
|
|
case eCSSProperty_max_width:
|
|
|
|
case eCSSProperty_height:
|
|
|
|
case eCSSProperty_min_height:
|
|
|
|
case eCSSProperty_max_height:
|
1999-07-24 23:04:42 +04:00
|
|
|
case eCSSProperty_box_sizing:
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_z_index:
|
1998-04-14 00:24:54 +04:00
|
|
|
if (nsnull != mPosition) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_width: aValue = mPosition->mWidth; break;
|
|
|
|
case eCSSProperty_min_width: aValue = mPosition->mMinWidth; break;
|
|
|
|
case eCSSProperty_max_width: aValue = mPosition->mMaxWidth; break;
|
|
|
|
case eCSSProperty_height: aValue = mPosition->mHeight; break;
|
|
|
|
case eCSSProperty_min_height: aValue = mPosition->mMinHeight; break;
|
|
|
|
case eCSSProperty_max_height: aValue = mPosition->mMaxHeight; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
case eCSSProperty_box_sizing: aValue = mPosition->mBoxSizing; break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_z_index: aValue = mPosition->mZIndex; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aValue.Reset();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_top:
|
|
|
|
case eCSSProperty_right:
|
|
|
|
case eCSSProperty_bottom:
|
|
|
|
case eCSSProperty_left:
|
1998-10-08 05:31:58 +04:00
|
|
|
if ((nsnull != mPosition) && (nsnull != mPosition->mOffset)) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_top: aValue = mPosition->mOffset->mTop; break;
|
|
|
|
case eCSSProperty_right: aValue = mPosition->mOffset->mRight; break;
|
|
|
|
case eCSSProperty_bottom: aValue = mPosition->mOffset->mBottom; break;
|
|
|
|
case eCSSProperty_left: aValue = mPosition->mOffset->mLeft; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aValue.Reset();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
// nsCSSList
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_list_style_type:
|
|
|
|
case eCSSProperty_list_style_image:
|
|
|
|
case eCSSProperty_list_style_position:
|
1998-04-14 00:24:54 +04:00
|
|
|
if (nsnull != mList) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_list_style_type: aValue = mList->mType; break;
|
|
|
|
case eCSSProperty_list_style_image: aValue = mList->mImage; break;
|
|
|
|
case eCSSProperty_list_style_position: aValue = mList->mPosition; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-04-14 00:24:54 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aValue.Reset();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2001-12-05 11:35:05 +03:00
|
|
|
case eCSSProperty_image_region_top:
|
|
|
|
case eCSSProperty_image_region_right:
|
|
|
|
case eCSSProperty_image_region_bottom:
|
|
|
|
case eCSSProperty_image_region_left:
|
|
|
|
if (mList && mList->mImageRegion) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty_image_region_top: aValue = mList->mImageRegion->mTop; break;
|
|
|
|
case eCSSProperty_image_region_right: aValue = mList->mImageRegion->mRight; break;
|
|
|
|
case eCSSProperty_image_region_bottom: aValue = mList->mImageRegion->mBottom; break;
|
|
|
|
case eCSSProperty_image_region_left: aValue = mList->mImageRegion->mLeft; break;
|
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aValue.Reset();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
// nsCSSTable
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_collapse:
|
|
|
|
case eCSSProperty_border_x_spacing:
|
|
|
|
case eCSSProperty_border_y_spacing:
|
|
|
|
case eCSSProperty_caption_side:
|
|
|
|
case eCSSProperty_empty_cells:
|
|
|
|
case eCSSProperty_table_layout:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mTable) {
|
1998-04-25 22:43:42 +04:00
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_collapse: aValue = mTable->mBorderCollapse; break;
|
|
|
|
case eCSSProperty_border_x_spacing: aValue = mTable->mBorderSpacingX; break;
|
|
|
|
case eCSSProperty_border_y_spacing: aValue = mTable->mBorderSpacingY; break;
|
|
|
|
case eCSSProperty_caption_side: aValue = mTable->mCaptionSide; break;
|
|
|
|
case eCSSProperty_empty_cells: aValue = mTable->mEmptyCells; break;
|
|
|
|
case eCSSProperty_table_layout: aValue = mTable->mLayout; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-05-27 03:16:55 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aValue.Reset();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
// nsCSSBreaks
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_orphans:
|
|
|
|
case eCSSProperty_widows:
|
|
|
|
case eCSSProperty_page:
|
|
|
|
case eCSSProperty_page_break_after:
|
|
|
|
case eCSSProperty_page_break_before:
|
|
|
|
case eCSSProperty_page_break_inside:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mBreaks) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_orphans: aValue = mBreaks->mOrphans; break;
|
|
|
|
case eCSSProperty_widows: aValue = mBreaks->mWidows; break;
|
|
|
|
case eCSSProperty_page: aValue = mBreaks->mPage; break;
|
|
|
|
case eCSSProperty_page_break_after: aValue = mBreaks->mPageBreakAfter; break;
|
|
|
|
case eCSSProperty_page_break_before: aValue = mBreaks->mPageBreakBefore; break;
|
|
|
|
case eCSSProperty_page_break_inside: aValue = mBreaks->mPageBreakInside; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aValue.Reset();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSPage
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_marks:
|
|
|
|
case eCSSProperty_size_width:
|
|
|
|
case eCSSProperty_size_height:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mPage) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_marks: aValue = mPage->mMarks; break;
|
|
|
|
case eCSSProperty_size_width: aValue = mPage->mSizeWidth; break;
|
|
|
|
case eCSSProperty_size_height: aValue = mPage->mSizeHeight; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aValue.Reset();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSContent
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_content:
|
|
|
|
case eCSSProperty_counter_increment:
|
|
|
|
case eCSSProperty_counter_reset:
|
|
|
|
case eCSSProperty_marker_offset:
|
|
|
|
case eCSSProperty_quotes_open:
|
|
|
|
case eCSSProperty_quotes_close:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mContent) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_content:
|
1998-10-27 02:22:40 +03:00
|
|
|
if (nsnull != mContent->mContent) {
|
|
|
|
aValue = mContent->mContent->mValue;
|
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_counter_increment:
|
1998-10-27 02:22:40 +03:00
|
|
|
if (nsnull != mContent->mCounterIncrement) {
|
|
|
|
aValue = mContent->mCounterIncrement->mCounter;
|
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_counter_reset:
|
1998-10-27 02:22:40 +03:00
|
|
|
if (nsnull != mContent->mCounterReset) {
|
|
|
|
aValue = mContent->mCounterReset->mCounter;
|
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_marker_offset: aValue = mContent->mMarkerOffset; break;
|
|
|
|
case eCSSProperty_quotes_open:
|
1998-10-27 02:22:40 +03:00
|
|
|
if (nsnull != mContent->mQuotes) {
|
|
|
|
aValue = mContent->mQuotes->mOpen;
|
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_quotes_close:
|
1998-10-27 02:22:40 +03:00
|
|
|
if (nsnull != mContent->mQuotes) {
|
|
|
|
aValue = mContent->mQuotes->mClose;
|
|
|
|
}
|
|
|
|
break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aValue.Reset();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
// nsCSSUserInterface
|
|
|
|
case eCSSProperty_user_input:
|
1999-09-04 03:40:35 +04:00
|
|
|
case eCSSProperty_user_modify:
|
|
|
|
case eCSSProperty_user_select:
|
1999-07-24 23:04:42 +04:00
|
|
|
case eCSSProperty_key_equivalent:
|
1999-09-04 03:40:35 +04:00
|
|
|
case eCSSProperty_user_focus:
|
1999-07-24 23:04:42 +04:00
|
|
|
case eCSSProperty_resizer:
|
2001-06-01 02:19:43 +04:00
|
|
|
case eCSSProperty_cursor:
|
1999-07-24 23:04:42 +04:00
|
|
|
if (nsnull != mUserInterface) {
|
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty_user_input: aValue = mUserInterface->mUserInput; break;
|
1999-09-04 03:40:35 +04:00
|
|
|
case eCSSProperty_user_modify: aValue = mUserInterface->mUserModify; break;
|
|
|
|
case eCSSProperty_user_select: aValue = mUserInterface->mUserSelect; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
case eCSSProperty_key_equivalent:
|
|
|
|
if (nsnull != mUserInterface->mKeyEquivalent) {
|
|
|
|
aValue = mUserInterface->mKeyEquivalent->mValue;
|
|
|
|
}
|
1999-07-20 14:10:12 +04:00
|
|
|
break;
|
1999-09-04 03:40:35 +04:00
|
|
|
case eCSSProperty_user_focus: aValue = mUserInterface->mUserFocus; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
case eCSSProperty_resizer: aValue = mUserInterface->mResizer; break;
|
2001-06-01 02:19:43 +04:00
|
|
|
case eCSSProperty_cursor:
|
|
|
|
if (nsnull != mUserInterface->mCursor) {
|
|
|
|
aValue = mUserInterface->mCursor->mValue;
|
|
|
|
}
|
2000-02-01 03:20:26 +03:00
|
|
|
break;
|
2001-06-01 02:19:43 +04:00
|
|
|
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aValue.Reset();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2001-03-06 05:30:30 +03:00
|
|
|
#ifdef INCLUDE_XUL
|
|
|
|
// nsCSSXUL
|
2001-08-02 04:09:27 +04:00
|
|
|
case eCSSProperty_box_align:
|
|
|
|
case eCSSProperty_box_direction:
|
|
|
|
case eCSSProperty_box_flex:
|
2001-03-06 05:30:30 +03:00
|
|
|
case eCSSProperty_box_orient:
|
2001-08-02 04:09:27 +04:00
|
|
|
case eCSSProperty_box_pack:
|
2001-09-26 02:17:00 +04:00
|
|
|
case eCSSProperty_box_ordinal_group:
|
2001-03-06 05:30:30 +03:00
|
|
|
if (nsnull != mXUL) {
|
|
|
|
switch (aProperty) {
|
2001-09-26 02:17:00 +04:00
|
|
|
case eCSSProperty_box_align: aValue = mXUL->mBoxAlign; break;
|
|
|
|
case eCSSProperty_box_direction: aValue = mXUL->mBoxDirection; break;
|
|
|
|
case eCSSProperty_box_flex: aValue = mXUL->mBoxFlex; break;
|
|
|
|
case eCSSProperty_box_orient: aValue = mXUL->mBoxOrient; break;
|
|
|
|
case eCSSProperty_box_pack: aValue = mXUL->mBoxPack; break;
|
|
|
|
case eCSSProperty_box_ordinal_group: aValue = mXUL->mBoxOrdinal; break;
|
2001-03-06 05:30:30 +03:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aValue.Reset();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
// nsCSSAural
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_azimuth:
|
|
|
|
case eCSSProperty_elevation:
|
|
|
|
case eCSSProperty_cue_after:
|
|
|
|
case eCSSProperty_cue_before:
|
|
|
|
case eCSSProperty_pause_after:
|
|
|
|
case eCSSProperty_pause_before:
|
|
|
|
case eCSSProperty_pitch:
|
|
|
|
case eCSSProperty_pitch_range:
|
|
|
|
case eCSSProperty_play_during:
|
|
|
|
case eCSSProperty_play_during_flags:
|
|
|
|
case eCSSProperty_richness:
|
|
|
|
case eCSSProperty_speak:
|
|
|
|
case eCSSProperty_speak_header:
|
|
|
|
case eCSSProperty_speak_numeral:
|
|
|
|
case eCSSProperty_speak_punctuation:
|
|
|
|
case eCSSProperty_speech_rate:
|
|
|
|
case eCSSProperty_stress:
|
|
|
|
case eCSSProperty_voice_family:
|
|
|
|
case eCSSProperty_volume:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mAural) {
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_azimuth: aValue = mAural->mAzimuth; break;
|
|
|
|
case eCSSProperty_elevation: aValue = mAural->mElevation; break;
|
|
|
|
case eCSSProperty_cue_after: aValue = mAural->mCueAfter; break;
|
|
|
|
case eCSSProperty_cue_before: aValue = mAural->mCueBefore; break;
|
|
|
|
case eCSSProperty_pause_after: aValue = mAural->mPauseAfter; break;
|
|
|
|
case eCSSProperty_pause_before: aValue = mAural->mPauseBefore; break;
|
|
|
|
case eCSSProperty_pitch: aValue = mAural->mPitch; break;
|
|
|
|
case eCSSProperty_pitch_range: aValue = mAural->mPitchRange; break;
|
|
|
|
case eCSSProperty_play_during: aValue = mAural->mPlayDuring; break;
|
|
|
|
case eCSSProperty_play_during_flags: aValue = mAural->mPlayDuringFlags; break;
|
|
|
|
case eCSSProperty_richness: aValue = mAural->mRichness; break;
|
|
|
|
case eCSSProperty_speak: aValue = mAural->mSpeak; break;
|
|
|
|
case eCSSProperty_speak_header: aValue = mAural->mSpeakHeader; break;
|
|
|
|
case eCSSProperty_speak_numeral: aValue = mAural->mSpeakNumeral; break;
|
|
|
|
case eCSSProperty_speak_punctuation: aValue = mAural->mSpeakPunctuation; break;
|
|
|
|
case eCSSProperty_speech_rate: aValue = mAural->mSpeechRate; break;
|
|
|
|
case eCSSProperty_stress: aValue = mAural->mStress; break;
|
|
|
|
case eCSSProperty_voice_family: aValue = mAural->mVoiceFamily; break;
|
|
|
|
case eCSSProperty_volume: aValue = mAural->mVolume; break;
|
1999-07-24 23:04:42 +04:00
|
|
|
CSS_BOGUS_DEFAULT; // make compiler happy
|
1998-04-25 22:43:42 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aValue.Reset();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
|
|
|
|
// Shorthands
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_background:
|
|
|
|
case eCSSProperty_border:
|
|
|
|
case eCSSProperty_border_spacing:
|
|
|
|
case eCSSProperty_clip:
|
|
|
|
case eCSSProperty_cue:
|
|
|
|
case eCSSProperty_font:
|
2001-12-05 11:35:05 +03:00
|
|
|
case eCSSProperty_image_region:
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_list_style:
|
|
|
|
case eCSSProperty_margin:
|
|
|
|
case eCSSProperty_outline:
|
|
|
|
case eCSSProperty_padding:
|
|
|
|
case eCSSProperty_pause:
|
|
|
|
case eCSSProperty_quotes:
|
|
|
|
case eCSSProperty_size:
|
|
|
|
case eCSSProperty_text_shadow:
|
|
|
|
case eCSSProperty_background_position:
|
|
|
|
case eCSSProperty_border_top:
|
|
|
|
case eCSSProperty_border_right:
|
|
|
|
case eCSSProperty_border_bottom:
|
|
|
|
case eCSSProperty_border_left:
|
|
|
|
case eCSSProperty_border_color:
|
|
|
|
case eCSSProperty_border_style:
|
|
|
|
case eCSSProperty_border_width:
|
1999-12-22 14:27:10 +03:00
|
|
|
case eCSSProperty__moz_border_radius:
|
1998-04-14 00:24:54 +04:00
|
|
|
NS_ERROR("can't query for shorthand properties");
|
|
|
|
default:
|
|
|
|
result = NS_ERROR_ILLEGAL_VALUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
1998-09-30 05:08:59 +04:00
|
|
|
|
1999-01-06 04:25:39 +03:00
|
|
|
NS_IMETHODIMP
|
2000-08-23 21:27:06 +04:00
|
|
|
CSSDeclarationImpl::GetValue(const nsAReadableString& aProperty,
|
|
|
|
nsAWritableString& aValue)
|
1998-09-30 05:08:59 +04:00
|
|
|
{
|
1999-07-18 04:25:28 +04:00
|
|
|
nsCSSProperty propID = nsCSSProps::LookupProperty(aProperty);
|
1998-09-30 05:08:59 +04:00
|
|
|
return GetValue(propID, aValue);
|
|
|
|
}
|
|
|
|
|
2000-08-23 21:27:06 +04:00
|
|
|
PRBool CSSDeclarationImpl::AppendValueToString(nsCSSProperty aProperty, nsAWritableString& aResult)
|
1998-09-30 05:08:59 +04:00
|
|
|
{
|
|
|
|
nsCSSValue value;
|
|
|
|
GetValue(aProperty, value);
|
1998-10-08 05:31:58 +04:00
|
|
|
return AppendValueToString(aProperty, value, aResult);
|
|
|
|
}
|
1998-09-30 05:08:59 +04:00
|
|
|
|
2000-08-23 21:27:06 +04:00
|
|
|
PRBool CSSDeclarationImpl::AppendValueToString(nsCSSProperty aProperty, const nsCSSValue& aValue, nsAWritableString& aResult)
|
1998-10-08 05:31:58 +04:00
|
|
|
{
|
|
|
|
nsCSSUnit unit = aValue.GetUnit();
|
1998-09-30 05:08:59 +04:00
|
|
|
|
|
|
|
if (eCSSUnit_Null == unit) {
|
1998-10-08 05:31:58 +04:00
|
|
|
return PR_FALSE;
|
1998-09-30 05:08:59 +04:00
|
|
|
}
|
|
|
|
|
1998-10-27 02:22:40 +03:00
|
|
|
if ((eCSSUnit_String <= unit) && (unit <= eCSSUnit_Counters)) {
|
|
|
|
switch (unit) {
|
2000-08-23 21:27:06 +04:00
|
|
|
case eCSSUnit_URL: aResult.Append(NS_LITERAL_STRING("url("));
|
|
|
|
break;
|
|
|
|
case eCSSUnit_Attr: aResult.Append(NS_LITERAL_STRING("attr("));
|
|
|
|
break;
|
|
|
|
case eCSSUnit_Counter: aResult.Append(NS_LITERAL_STRING("counter("));
|
|
|
|
break;
|
|
|
|
case eCSSUnit_Counters: aResult.Append(NS_LITERAL_STRING("counters("));
|
|
|
|
break;
|
1998-10-27 02:22:40 +03:00
|
|
|
default: break;
|
|
|
|
}
|
1998-09-30 05:08:59 +04:00
|
|
|
nsAutoString buffer;
|
1998-10-08 05:31:58 +04:00
|
|
|
aValue.GetStringValue(buffer);
|
|
|
|
aResult.Append(buffer);
|
1998-09-30 05:08:59 +04:00
|
|
|
}
|
|
|
|
else if (eCSSUnit_Integer == unit) {
|
2000-03-31 11:08:36 +04:00
|
|
|
switch (aProperty) {
|
|
|
|
case eCSSProperty_color:
|
|
|
|
case eCSSProperty_background_color: {
|
|
|
|
// we can lookup the property in the ColorTable and then
|
|
|
|
// get a string mapping the name
|
2000-08-23 21:27:06 +04:00
|
|
|
nsAutoString tmpStr;
|
|
|
|
nsCAutoString str;
|
2000-03-31 11:08:36 +04:00
|
|
|
if (nsCSSProps::GetColorName(aValue.GetIntValue(), str)){
|
2000-08-23 21:27:06 +04:00
|
|
|
aResult.Append(NS_ConvertASCIItoUCS2(str));
|
2000-03-31 11:08:36 +04:00
|
|
|
} else {
|
2000-08-23 21:27:06 +04:00
|
|
|
tmpStr.AppendInt(aValue.GetIntValue(), 10);
|
|
|
|
aResult.Append(tmpStr);
|
2000-03-31 11:08:36 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2000-08-23 21:27:06 +04:00
|
|
|
{
|
|
|
|
nsAutoString tmpStr;
|
|
|
|
tmpStr.AppendInt(aValue.GetIntValue(), 10);
|
|
|
|
aResult.Append(tmpStr);
|
|
|
|
}
|
2000-03-31 11:08:36 +04:00
|
|
|
}
|
1998-09-30 05:08:59 +04:00
|
|
|
}
|
|
|
|
else if (eCSSUnit_Enumerated == unit) {
|
1999-07-18 04:25:28 +04:00
|
|
|
if (eCSSProperty_text_decoration == aProperty) {
|
1998-10-08 05:31:58 +04:00
|
|
|
PRInt32 intValue = aValue.GetIntValue();
|
1998-09-30 05:08:59 +04:00
|
|
|
if (NS_STYLE_TEXT_DECORATION_NONE != intValue) {
|
|
|
|
PRInt32 mask;
|
|
|
|
for (mask = NS_STYLE_TEXT_DECORATION_UNDERLINE;
|
|
|
|
mask <= NS_STYLE_TEXT_DECORATION_BLINK;
|
|
|
|
mask <<= 1) {
|
|
|
|
if ((mask & intValue) == mask) {
|
2000-08-23 21:27:06 +04:00
|
|
|
aResult.Append(NS_ConvertASCIItoUCS2(nsCSSProps::LookupPropertyValue(aProperty, mask)));
|
1998-09-30 05:08:59 +04:00
|
|
|
intValue &= ~mask;
|
|
|
|
if (0 != intValue) { // more left
|
2000-08-23 21:27:06 +04:00
|
|
|
aResult.Append(PRUnichar(' '));
|
1998-09-30 05:08:59 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
2000-08-23 21:27:06 +04:00
|
|
|
aResult.Append(NS_ConvertASCIItoUCS2(nsCSSProps::LookupPropertyValue(aProperty, NS_STYLE_TEXT_DECORATION_NONE)));
|
1998-09-30 05:08:59 +04:00
|
|
|
}
|
|
|
|
}
|
1999-07-18 04:25:28 +04:00
|
|
|
else if (eCSSProperty_azimuth == aProperty) {
|
1998-10-27 02:22:40 +03:00
|
|
|
PRInt32 intValue = aValue.GetIntValue();
|
2000-08-23 21:27:06 +04:00
|
|
|
aResult.Append(NS_ConvertASCIItoUCS2(nsCSSProps::LookupPropertyValue(aProperty, (intValue & ~NS_STYLE_AZIMUTH_BEHIND))));
|
1998-10-27 02:22:40 +03:00
|
|
|
if ((NS_STYLE_AZIMUTH_BEHIND & intValue) != 0) {
|
2000-08-23 21:27:06 +04:00
|
|
|
aResult.Append(PRUnichar(' '));
|
|
|
|
aResult.Append(NS_ConvertASCIItoUCS2(nsCSSProps::LookupPropertyValue(aProperty, NS_STYLE_AZIMUTH_BEHIND)));
|
1998-10-27 02:22:40 +03:00
|
|
|
}
|
|
|
|
}
|
1999-07-18 04:25:28 +04:00
|
|
|
else if (eCSSProperty_play_during_flags == aProperty) {
|
1998-10-27 02:22:40 +03:00
|
|
|
PRInt32 intValue = aValue.GetIntValue();
|
|
|
|
if ((NS_STYLE_PLAY_DURING_MIX & intValue) != 0) {
|
2000-08-23 21:27:06 +04:00
|
|
|
aResult.Append(NS_ConvertASCIItoUCS2(nsCSSProps::LookupPropertyValue(aProperty, NS_STYLE_PLAY_DURING_MIX)));
|
1998-10-27 02:22:40 +03:00
|
|
|
}
|
|
|
|
if ((NS_STYLE_PLAY_DURING_REPEAT & intValue) != 0) {
|
|
|
|
if (NS_STYLE_PLAY_DURING_REPEAT != intValue) {
|
2000-08-23 21:27:06 +04:00
|
|
|
aResult.Append(PRUnichar(' '));
|
1998-10-27 02:22:40 +03:00
|
|
|
}
|
2000-08-23 21:27:06 +04:00
|
|
|
aResult.Append(NS_ConvertASCIItoUCS2(nsCSSProps::LookupPropertyValue(aProperty, NS_STYLE_PLAY_DURING_REPEAT)));
|
1998-10-27 02:22:40 +03:00
|
|
|
}
|
|
|
|
}
|
1999-07-18 04:25:28 +04:00
|
|
|
else if (eCSSProperty_marks == aProperty) {
|
1999-02-10 11:37:28 +03:00
|
|
|
PRInt32 intValue = aValue.GetIntValue();
|
|
|
|
if ((NS_STYLE_PAGE_MARKS_CROP & intValue) != 0) {
|
2000-08-23 21:27:06 +04:00
|
|
|
aResult.Append(NS_ConvertASCIItoUCS2(nsCSSProps::LookupPropertyValue(aProperty, NS_STYLE_PAGE_MARKS_CROP)));
|
1999-02-10 11:37:28 +03:00
|
|
|
}
|
|
|
|
if ((NS_STYLE_PAGE_MARKS_REGISTER & intValue) != 0) {
|
|
|
|
if ((NS_STYLE_PAGE_MARKS_CROP & intValue) != 0) {
|
2000-08-23 21:27:06 +04:00
|
|
|
aResult.Append(PRUnichar(' '));
|
1999-02-10 11:37:28 +03:00
|
|
|
}
|
2000-08-23 21:27:06 +04:00
|
|
|
aResult.Append(NS_ConvertASCIItoUCS2(nsCSSProps::LookupPropertyValue(aProperty, NS_STYLE_PAGE_MARKS_REGISTER)));
|
1999-02-10 11:37:28 +03:00
|
|
|
}
|
|
|
|
}
|
1998-09-30 05:08:59 +04:00
|
|
|
else {
|
2001-11-28 00:13:53 +03:00
|
|
|
const nsAFlatCString& name = nsCSSProps::LookupPropertyValue(aProperty, aValue.GetIntValue());
|
2000-08-23 21:27:06 +04:00
|
|
|
aResult.Append(NS_ConvertASCIItoUCS2(name));
|
1998-09-30 05:08:59 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (eCSSUnit_Color == unit){
|
2000-08-23 21:27:06 +04:00
|
|
|
nsAutoString tmpStr;
|
1998-10-08 05:31:58 +04:00
|
|
|
nscolor color = aValue.GetColorValue();
|
2000-08-23 21:27:06 +04:00
|
|
|
|
|
|
|
aResult.Append(NS_LITERAL_STRING("rgb("));
|
|
|
|
|
|
|
|
tmpStr.AppendInt(NS_GET_R(color), 10);
|
|
|
|
aResult.Append(tmpStr);
|
|
|
|
|
|
|
|
aResult.Append(PRUnichar(','));
|
|
|
|
|
|
|
|
tmpStr.Truncate();
|
|
|
|
tmpStr.AppendInt(NS_GET_G(color), 10);
|
|
|
|
aResult.Append(tmpStr);
|
|
|
|
|
|
|
|
aResult.Append(PRUnichar(','));
|
|
|
|
|
|
|
|
tmpStr.Truncate();
|
|
|
|
tmpStr.AppendInt(NS_GET_B(color), 10);
|
|
|
|
aResult.Append(tmpStr);
|
|
|
|
|
|
|
|
aResult.Append(PRUnichar(')'));
|
1998-09-30 05:08:59 +04:00
|
|
|
}
|
|
|
|
else if (eCSSUnit_Percent == unit) {
|
2000-08-23 21:27:06 +04:00
|
|
|
nsAutoString tmpStr;
|
|
|
|
tmpStr.AppendFloat(aValue.GetPercentValue() * 100.0f);
|
|
|
|
aResult.Append(tmpStr);
|
1998-09-30 05:08:59 +04:00
|
|
|
}
|
|
|
|
else if (eCSSUnit_Percent < unit) { // length unit
|
2000-08-23 21:27:06 +04:00
|
|
|
nsAutoString tmpStr;
|
|
|
|
tmpStr.AppendFloat(aValue.GetFloatValue());
|
|
|
|
aResult.Append(tmpStr);
|
1998-09-30 05:08:59 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
switch (unit) {
|
1998-10-27 02:22:40 +03:00
|
|
|
case eCSSUnit_Null: break;
|
2000-08-23 21:27:06 +04:00
|
|
|
case eCSSUnit_Auto: aResult.Append(NS_LITERAL_STRING("auto")); break;
|
|
|
|
case eCSSUnit_Inherit: aResult.Append(NS_LITERAL_STRING("inherit")); break;
|
2001-06-01 02:19:43 +04:00
|
|
|
case eCSSUnit_Initial: aResult.Append(NS_LITERAL_STRING("initial")); break;
|
2000-08-23 21:27:06 +04:00
|
|
|
case eCSSUnit_None: aResult.Append(NS_LITERAL_STRING("none")); break;
|
|
|
|
case eCSSUnit_Normal: aResult.Append(NS_LITERAL_STRING("normal")); break;
|
1998-10-27 02:22:40 +03:00
|
|
|
|
|
|
|
case eCSSUnit_String: break;
|
|
|
|
case eCSSUnit_URL:
|
|
|
|
case eCSSUnit_Attr:
|
|
|
|
case eCSSUnit_Counter:
|
2000-08-23 21:27:06 +04:00
|
|
|
case eCSSUnit_Counters: aResult.Append(PRUnichar(')')); break;
|
1998-10-27 02:22:40 +03:00
|
|
|
case eCSSUnit_Integer: break;
|
|
|
|
case eCSSUnit_Enumerated: break;
|
|
|
|
case eCSSUnit_Color: break;
|
2000-08-23 21:27:06 +04:00
|
|
|
case eCSSUnit_Percent: aResult.Append(PRUnichar('%')); break;
|
1998-10-27 02:22:40 +03:00
|
|
|
case eCSSUnit_Number: break;
|
|
|
|
|
2000-08-23 21:27:06 +04:00
|
|
|
case eCSSUnit_Inch: aResult.Append(NS_LITERAL_STRING("in")); break;
|
|
|
|
case eCSSUnit_Foot: aResult.Append(NS_LITERAL_STRING("ft")); break;
|
|
|
|
case eCSSUnit_Mile: aResult.Append(NS_LITERAL_STRING("mi")); break;
|
|
|
|
case eCSSUnit_Millimeter: aResult.Append(NS_LITERAL_STRING("mm")); break;
|
|
|
|
case eCSSUnit_Centimeter: aResult.Append(NS_LITERAL_STRING("cm")); break;
|
|
|
|
case eCSSUnit_Meter: aResult.Append(NS_LITERAL_STRING("m")); break;
|
|
|
|
case eCSSUnit_Kilometer: aResult.Append(NS_LITERAL_STRING("km")); break;
|
|
|
|
case eCSSUnit_Point: aResult.Append(NS_LITERAL_STRING("pt")); break;
|
|
|
|
case eCSSUnit_Pica: aResult.Append(NS_LITERAL_STRING("pc")); break;
|
|
|
|
case eCSSUnit_Didot: aResult.Append(NS_LITERAL_STRING("dt")); break;
|
|
|
|
case eCSSUnit_Cicero: aResult.Append(NS_LITERAL_STRING("cc")); break;
|
|
|
|
|
|
|
|
case eCSSUnit_EM: aResult.Append(NS_LITERAL_STRING("em")); break;
|
|
|
|
case eCSSUnit_EN: aResult.Append(NS_LITERAL_STRING("en")); break;
|
|
|
|
case eCSSUnit_XHeight: aResult.Append(NS_LITERAL_STRING("ex")); break;
|
|
|
|
case eCSSUnit_CapHeight: aResult.Append(NS_LITERAL_STRING("cap")); break;
|
|
|
|
case eCSSUnit_Char: aResult.Append(NS_LITERAL_STRING("ch")); break;
|
|
|
|
|
|
|
|
case eCSSUnit_Pixel: aResult.Append(NS_LITERAL_STRING("px")); break;
|
|
|
|
|
2001-06-01 02:19:43 +04:00
|
|
|
case eCSSUnit_Proportional: aResult.Append(NS_LITERAL_STRING("*")); break;
|
|
|
|
|
2000-08-23 21:27:06 +04:00
|
|
|
case eCSSUnit_Degree: aResult.Append(NS_LITERAL_STRING("deg")); break;
|
|
|
|
case eCSSUnit_Grad: aResult.Append(NS_LITERAL_STRING("grad")); break;
|
|
|
|
case eCSSUnit_Radian: aResult.Append(NS_LITERAL_STRING("rad")); break;
|
|
|
|
|
|
|
|
case eCSSUnit_Hertz: aResult.Append(NS_LITERAL_STRING("Hz")); break;
|
|
|
|
case eCSSUnit_Kilohertz: aResult.Append(NS_LITERAL_STRING("kHz")); break;
|
|
|
|
|
|
|
|
case eCSSUnit_Seconds: aResult.Append(PRUnichar('s')); break;
|
|
|
|
case eCSSUnit_Milliseconds: aResult.Append(NS_LITERAL_STRING("ms")); break;
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return PR_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
#define HAS_VALUE(strct,data) \
|
|
|
|
((nsnull != strct) && (eCSSUnit_Null != strct->data.GetUnit()))
|
|
|
|
#define HAS_RECT(strct,rect) \
|
|
|
|
((nsnull != strct) && (nsnull != strct->rect) && \
|
|
|
|
(eCSSUnit_Null != strct->rect->mTop.GetUnit()) && \
|
|
|
|
(eCSSUnit_Null != strct->rect->mRight.GetUnit()) && \
|
|
|
|
(eCSSUnit_Null != strct->rect->mBottom.GetUnit()) && \
|
|
|
|
(eCSSUnit_Null != strct->rect->mLeft.GetUnit()))
|
|
|
|
|
1999-01-06 04:25:39 +03:00
|
|
|
NS_IMETHODIMP
|
2000-08-23 21:27:06 +04:00
|
|
|
CSSDeclarationImpl::GetValue(nsCSSProperty aProperty,
|
|
|
|
nsAWritableString& aValue)
|
1998-10-08 05:31:58 +04:00
|
|
|
{
|
1998-11-06 03:56:28 +03:00
|
|
|
PRBool isImportant = PR_FALSE;
|
|
|
|
GetValueIsImportant(aProperty, isImportant);
|
|
|
|
if (PR_TRUE == isImportant) {
|
|
|
|
return mImportant->GetValue(aProperty, aValue);
|
|
|
|
}
|
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
aValue.Truncate(0);
|
1998-09-30 05:08:59 +04:00
|
|
|
|
1998-10-08 05:31:58 +04:00
|
|
|
// shorthands
|
|
|
|
switch (aProperty) {
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_background:
|
2000-08-23 21:27:06 +04:00
|
|
|
if (AppendValueToString(eCSSProperty_background_color, aValue)) aValue.Append(PRUnichar(' '));
|
|
|
|
if (AppendValueToString(eCSSProperty_background_image, aValue)) aValue.Append(PRUnichar(' '));
|
|
|
|
if (AppendValueToString(eCSSProperty_background_repeat, aValue)) aValue.Append(PRUnichar(' '));
|
|
|
|
if (AppendValueToString(eCSSProperty_background_attachment, aValue)) aValue.Append(PRUnichar(' '));
|
1998-10-08 05:31:58 +04:00
|
|
|
if (HAS_VALUE(mColor,mBackPositionX) && HAS_VALUE(mColor,mBackPositionY)) {
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_background_x_position, aValue);
|
2000-08-23 21:27:06 +04:00
|
|
|
aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_background_y_position, aValue);
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border:
|
2000-08-23 21:27:06 +04:00
|
|
|
if (AppendValueToString(eCSSProperty_border_top_width, aValue)) aValue.Append(PRUnichar(' '));
|
|
|
|
if (AppendValueToString(eCSSProperty_border_top_style, aValue)) aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_border_top_color, aValue);
|
1998-10-08 05:31:58 +04:00
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_spacing:
|
|
|
|
if (AppendValueToString(eCSSProperty_border_x_spacing, aValue)) {
|
2000-08-23 21:27:06 +04:00
|
|
|
aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_border_y_spacing, aValue);
|
1998-10-27 02:22:40 +03:00
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_clip:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (HAS_RECT(mDisplay,mClip)) {
|
2000-08-23 21:27:06 +04:00
|
|
|
aValue.Append(NS_LITERAL_STRING("rect("));
|
|
|
|
AppendValueToString(eCSSProperty_clip_top, aValue); aValue.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString(eCSSProperty_clip_right, aValue); aValue.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString(eCSSProperty_clip_bottom, aValue); aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_clip_left, aValue);
|
2000-08-23 21:27:06 +04:00
|
|
|
aValue.Append(PRUnichar(')'));
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_cue:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (HAS_VALUE(mAural,mCueAfter) && HAS_VALUE(mAural,mCueBefore)) {
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_cue_after, aValue);
|
2000-08-23 21:27:06 +04:00
|
|
|
aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_cue_before, aValue);
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_cursor:
|
2001-06-01 02:19:43 +04:00
|
|
|
if ((nsnull != mUserInterface) && (nsnull != mUserInterface->mCursor)) {
|
|
|
|
nsCSSValueList* cursor = mUserInterface->mCursor;
|
1998-10-27 02:22:40 +03:00
|
|
|
do {
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_cursor, cursor->mValue, aValue);
|
1998-10-27 02:22:40 +03:00
|
|
|
cursor = cursor->mNext;
|
|
|
|
if (nsnull != cursor) {
|
2000-08-23 21:27:06 +04:00
|
|
|
aValue.Append(PRUnichar(' '));
|
1998-10-27 02:22:40 +03:00
|
|
|
}
|
|
|
|
} while (nsnull != cursor);
|
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_font:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (HAS_VALUE(mFont,mSize)) {
|
2000-08-23 21:27:06 +04:00
|
|
|
if (AppendValueToString(eCSSProperty_font_style, aValue)) aValue.Append(PRUnichar(' '));
|
|
|
|
if (AppendValueToString(eCSSProperty_font_variant, aValue)) aValue.Append(PRUnichar(' '));
|
|
|
|
if (AppendValueToString(eCSSProperty_font_weight, aValue)) aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_font_size, aValue);
|
1998-10-08 05:31:58 +04:00
|
|
|
if (HAS_VALUE(mText,mLineHeight)) {
|
2000-08-23 21:27:06 +04:00
|
|
|
aValue.Append(PRUnichar('/'));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_line_height, aValue);
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
2000-08-23 21:27:06 +04:00
|
|
|
aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_font_family, aValue);
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
break;
|
2001-12-05 11:35:05 +03:00
|
|
|
case eCSSProperty_image_region:
|
|
|
|
if (HAS_RECT(mList,mImageRegion)) {
|
|
|
|
aValue.Append(NS_LITERAL_STRING("rect("));
|
|
|
|
AppendValueToString(eCSSProperty_image_region_top, aValue); aValue.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString(eCSSProperty_image_region_right, aValue); aValue.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString(eCSSProperty_image_region_bottom, aValue); aValue.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString(eCSSProperty_image_region_left, aValue);
|
|
|
|
aValue.Append(PRUnichar(')'));
|
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_list_style:
|
2000-08-23 21:27:06 +04:00
|
|
|
if (AppendValueToString(eCSSProperty_list_style_type, aValue)) aValue.Append(PRUnichar(' '));
|
|
|
|
if (AppendValueToString(eCSSProperty_list_style_position, aValue)) aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_list_style_image, aValue);
|
1998-10-08 05:31:58 +04:00
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_margin:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (HAS_RECT(mMargin,mMargin)) {
|
2000-08-23 21:27:06 +04:00
|
|
|
AppendValueToString(eCSSProperty_margin_top, aValue); aValue.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString(eCSSProperty_margin_right, aValue); aValue.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString(eCSSProperty_margin_bottom, aValue); aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_margin_left, aValue);
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_outline:
|
2000-08-23 21:27:06 +04:00
|
|
|
if (AppendValueToString(eCSSProperty_outline_color, aValue)) aValue.Append(PRUnichar(' '));
|
|
|
|
if (AppendValueToString(eCSSProperty_outline_style, aValue)) aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_outline_width, aValue);
|
1998-10-08 05:31:58 +04:00
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_padding:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (HAS_RECT(mMargin,mPadding)) {
|
2000-08-23 21:27:06 +04:00
|
|
|
AppendValueToString(eCSSProperty_padding_top, aValue); aValue.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString(eCSSProperty_padding_right, aValue); aValue.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString(eCSSProperty_padding_bottom, aValue); aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_padding_left, aValue);
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_pause:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (HAS_VALUE(mAural,mPauseAfter) && HAS_VALUE(mAural,mPauseBefore)) {
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_pause_after, aValue);
|
2000-08-23 21:27:06 +04:00
|
|
|
aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_pause_before, aValue);
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_size:
|
1998-10-27 02:22:40 +03:00
|
|
|
if (HAS_VALUE(mPage,mSizeWidth) && HAS_VALUE(mPage,mSizeHeight)) {
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_size_width, aValue);
|
2000-08-23 21:27:06 +04:00
|
|
|
aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_size_height, aValue);
|
1998-10-27 02:22:40 +03:00
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_text_shadow:
|
1998-10-08 05:31:58 +04:00
|
|
|
if ((nsnull != mText) && (nsnull != mText->mTextShadow)) {
|
1998-10-27 02:22:40 +03:00
|
|
|
if (mText->mTextShadow->mXOffset.IsLengthUnit()) {
|
1998-10-08 05:31:58 +04:00
|
|
|
nsCSSShadow* shadow = mText->mTextShadow;
|
|
|
|
while (nsnull != shadow) {
|
2000-08-23 21:27:06 +04:00
|
|
|
if (AppendValueToString(eCSSProperty_text_shadow_color, shadow->mColor, aValue)) aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
if (AppendValueToString(eCSSProperty_text_shadow_x, shadow->mXOffset, aValue)) {
|
2000-08-23 21:27:06 +04:00
|
|
|
aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_text_shadow_y, shadow->mYOffset, aValue);
|
2000-08-23 21:27:06 +04:00
|
|
|
aValue.Append(PRUnichar(' '));
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
2000-08-23 21:27:06 +04:00
|
|
|
if (AppendValueToString(eCSSProperty_text_shadow_radius, shadow->mRadius, aValue)) aValue.Append(PRUnichar(' '));
|
1998-10-08 05:31:58 +04:00
|
|
|
shadow = shadow->mNext;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else { // none or inherit
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_text_shadow_x, aValue);
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_background_position:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (HAS_VALUE(mColor,mBackPositionX) && HAS_VALUE(mColor,mBackPositionY)) {
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_background_x_position, aValue);
|
2000-08-23 21:27:06 +04:00
|
|
|
aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_background_y_position, aValue);
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_top:
|
2000-08-23 21:27:06 +04:00
|
|
|
if (AppendValueToString(eCSSProperty_border_top_width, aValue)) aValue.Append(PRUnichar(' '));
|
|
|
|
if (AppendValueToString(eCSSProperty_border_top_style, aValue)) aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_border_top_color, aValue);
|
1998-10-08 05:31:58 +04:00
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_right:
|
2000-08-23 21:27:06 +04:00
|
|
|
if (AppendValueToString(eCSSProperty_border_right_width, aValue)) aValue.Append(PRUnichar(' '));
|
|
|
|
if (AppendValueToString(eCSSProperty_border_right_style, aValue)) aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_border_right_color, aValue);
|
1998-10-08 05:31:58 +04:00
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_bottom:
|
2000-08-23 21:27:06 +04:00
|
|
|
if (AppendValueToString(eCSSProperty_border_bottom_width, aValue)) aValue.Append(PRUnichar(' '));
|
|
|
|
if (AppendValueToString(eCSSProperty_border_bottom_style, aValue)) aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_border_bottom_color, aValue);
|
1998-10-08 05:31:58 +04:00
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_left:
|
2000-08-23 21:27:06 +04:00
|
|
|
if (AppendValueToString(eCSSProperty_border_left_width, aValue)) aValue.Append(PRUnichar(' '));
|
|
|
|
if (AppendValueToString(eCSSProperty_border_left_style, aValue)) aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_border_left_color, aValue);
|
1998-10-08 05:31:58 +04:00
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_color:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (HAS_RECT(mMargin,mBorderColor)) {
|
2000-08-23 21:27:06 +04:00
|
|
|
AppendValueToString(eCSSProperty_border_top_color, aValue); aValue.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString(eCSSProperty_border_right_color, aValue); aValue.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString(eCSSProperty_border_bottom_color, aValue); aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_border_left_color, aValue);
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_style:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (HAS_RECT(mMargin,mBorderStyle)) {
|
2000-08-23 21:27:06 +04:00
|
|
|
AppendValueToString(eCSSProperty_border_top_style, aValue); aValue.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString(eCSSProperty_border_right_style, aValue); aValue.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString(eCSSProperty_border_bottom_style, aValue); aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_border_left_style, aValue);
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
break;
|
1999-12-22 14:27:10 +03:00
|
|
|
case eCSSProperty__moz_border_radius:
|
|
|
|
if (HAS_RECT(mMargin,mBorderRadius)) {
|
2000-08-23 21:27:06 +04:00
|
|
|
AppendValueToString(eCSSProperty__moz_border_radius_topLeft, aValue); aValue.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString(eCSSProperty__moz_border_radius_topRight, aValue); aValue.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString(eCSSProperty__moz_border_radius_bottomRight, aValue); aValue.Append(PRUnichar(' '));
|
1999-12-22 14:27:10 +03:00
|
|
|
AppendValueToString(eCSSProperty__moz_border_radius_bottomLeft, aValue);
|
|
|
|
}
|
|
|
|
break;
|
2000-01-24 14:19:55 +03:00
|
|
|
case eCSSProperty__moz_outline_radius:
|
|
|
|
if (HAS_RECT(mMargin,mOutlineRadius)) {
|
2000-08-23 21:27:06 +04:00
|
|
|
AppendValueToString(eCSSProperty__moz_outline_radius_topLeft, aValue); aValue.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString(eCSSProperty__moz_outline_radius_topRight, aValue); aValue.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString(eCSSProperty__moz_outline_radius_bottomRight, aValue); aValue.Append(PRUnichar(' '));
|
2000-01-24 14:19:55 +03:00
|
|
|
AppendValueToString(eCSSProperty__moz_outline_radius_bottomLeft, aValue);
|
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_border_width:
|
1998-10-08 05:31:58 +04:00
|
|
|
if (HAS_RECT(mMargin,mBorderWidth)) {
|
2000-08-23 21:27:06 +04:00
|
|
|
AppendValueToString(eCSSProperty_border_top_width, aValue); aValue.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString(eCSSProperty_border_right_width, aValue); aValue.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString(eCSSProperty_border_bottom_width, aValue); aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_border_left_width, aValue);
|
1998-10-08 05:31:58 +04:00
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_content:
|
1998-10-27 02:22:40 +03:00
|
|
|
if ((nsnull != mContent) && (nsnull != mContent->mContent)) {
|
|
|
|
nsCSSValueList* content = mContent->mContent;
|
|
|
|
do {
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_content, content->mValue, aValue);
|
1998-10-27 02:22:40 +03:00
|
|
|
content = content->mNext;
|
|
|
|
if (nsnull != content) {
|
2000-08-23 21:27:06 +04:00
|
|
|
aValue.Append(PRUnichar(' '));
|
1998-10-27 02:22:40 +03:00
|
|
|
}
|
|
|
|
} while (nsnull != content);
|
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_counter_increment:
|
1998-10-27 02:22:40 +03:00
|
|
|
if ((nsnull != mContent) && (nsnull != mContent->mCounterIncrement)) {
|
|
|
|
nsCSSCounterData* data = mContent->mCounterIncrement;
|
|
|
|
do {
|
1999-07-18 04:25:28 +04:00
|
|
|
if (AppendValueToString(eCSSProperty_counter_increment, data->mCounter, aValue)) {
|
1998-10-27 02:22:40 +03:00
|
|
|
if (HAS_VALUE(data, mValue)) {
|
2000-08-23 21:27:06 +04:00
|
|
|
aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_counter_increment, data->mValue, aValue);
|
1998-10-27 02:22:40 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
data = data->mNext;
|
|
|
|
if (nsnull != data) {
|
2000-08-23 21:27:06 +04:00
|
|
|
aValue.Append(PRUnichar(' '));
|
1998-10-27 02:22:40 +03:00
|
|
|
}
|
|
|
|
} while (nsnull != data);
|
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_counter_reset:
|
1998-10-27 02:22:40 +03:00
|
|
|
if ((nsnull != mContent) && (nsnull != mContent->mCounterReset)) {
|
|
|
|
nsCSSCounterData* data = mContent->mCounterReset;
|
|
|
|
do {
|
1999-07-18 04:25:28 +04:00
|
|
|
if (AppendValueToString(eCSSProperty_counter_reset, data->mCounter, aValue)) {
|
1998-10-27 02:22:40 +03:00
|
|
|
if (HAS_VALUE(data, mValue)) {
|
2000-08-23 21:27:06 +04:00
|
|
|
aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_counter_reset, data->mValue, aValue);
|
1998-10-27 02:22:40 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
data = data->mNext;
|
|
|
|
if (nsnull != data) {
|
2000-08-23 21:27:06 +04:00
|
|
|
aValue.Append(PRUnichar(' '));
|
1998-10-27 02:22:40 +03:00
|
|
|
}
|
|
|
|
} while (nsnull != data);
|
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_play_during:
|
1998-10-27 02:22:40 +03:00
|
|
|
if (HAS_VALUE(mAural, mPlayDuring)) {
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_play_during, aValue);
|
1998-10-27 02:22:40 +03:00
|
|
|
if (HAS_VALUE(mAural, mPlayDuringFlags)) {
|
2000-08-23 21:27:06 +04:00
|
|
|
aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_play_during_flags, aValue);
|
1998-10-27 02:22:40 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
1999-07-18 04:25:28 +04:00
|
|
|
case eCSSProperty_quotes:
|
1998-10-27 02:22:40 +03:00
|
|
|
if ((nsnull != mContent) && (nsnull != mContent->mQuotes)) {
|
|
|
|
nsCSSQuotes* quotes = mContent->mQuotes;
|
|
|
|
do {
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_quotes_open, quotes->mOpen, aValue);
|
2000-08-23 21:27:06 +04:00
|
|
|
aValue.Append(PRUnichar(' '));
|
1999-07-18 04:25:28 +04:00
|
|
|
AppendValueToString(eCSSProperty_quotes_close, quotes->mClose, aValue);
|
1998-10-27 02:22:40 +03:00
|
|
|
quotes = quotes->mNext;
|
|
|
|
if (nsnull != quotes) {
|
2000-08-23 21:27:06 +04:00
|
|
|
aValue.Append(PRUnichar(' '));
|
1998-10-27 02:22:40 +03:00
|
|
|
}
|
|
|
|
} while (nsnull != quotes);
|
|
|
|
}
|
|
|
|
break;
|
1999-07-24 23:04:42 +04:00
|
|
|
case eCSSProperty_key_equivalent:
|
|
|
|
if ((nsnull != mUserInterface) && (nsnull != mUserInterface->mKeyEquivalent)) {
|
|
|
|
nsCSSValueList* keyEquiv = mUserInterface->mKeyEquivalent;
|
|
|
|
do {
|
|
|
|
AppendValueToString(eCSSProperty_key_equivalent, keyEquiv->mValue, aValue);
|
|
|
|
keyEquiv = keyEquiv->mNext;
|
|
|
|
if (nsnull != keyEquiv) {
|
2000-08-23 21:27:06 +04:00
|
|
|
aValue.Append(PRUnichar(' '));
|
1999-07-24 23:04:42 +04:00
|
|
|
}
|
|
|
|
} while (nsnull != keyEquiv);
|
|
|
|
}
|
|
|
|
break;
|
1998-10-08 05:31:58 +04:00
|
|
|
default:
|
|
|
|
AppendValueToString(aProperty, aValue);
|
|
|
|
break;
|
|
|
|
}
|
1998-09-30 05:08:59 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
1999-01-06 04:25:39 +03:00
|
|
|
NS_IMETHODIMP
|
|
|
|
CSSDeclarationImpl::GetImportantValues(nsICSSDeclaration*& aResult)
|
1998-06-26 09:51:55 +04:00
|
|
|
{
|
|
|
|
if (nsnull != mImportant) {
|
|
|
|
aResult = mImportant;
|
|
|
|
NS_ADDREF(aResult);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aResult = nsnull;
|
|
|
|
}
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
1999-01-06 04:25:39 +03:00
|
|
|
NS_IMETHODIMP
|
2000-08-23 21:27:06 +04:00
|
|
|
CSSDeclarationImpl::GetValueIsImportant(const nsAReadableString& aProperty,
|
1999-01-06 04:25:39 +03:00
|
|
|
PRBool& aIsImportant)
|
1998-11-06 03:56:28 +03:00
|
|
|
{
|
1999-07-18 04:25:28 +04:00
|
|
|
nsCSSProperty propID = nsCSSProps::LookupProperty(aProperty);
|
1998-11-06 03:56:28 +03:00
|
|
|
return GetValueIsImportant(propID, aIsImportant);
|
|
|
|
}
|
|
|
|
|
1999-01-06 04:25:39 +03:00
|
|
|
NS_IMETHODIMP
|
1999-07-18 04:25:28 +04:00
|
|
|
CSSDeclarationImpl::GetValueIsImportant(nsCSSProperty aProperty,
|
1999-01-06 04:25:39 +03:00
|
|
|
PRBool& aIsImportant)
|
1998-07-15 02:34:27 +04:00
|
|
|
{
|
1998-09-25 04:51:45 +04:00
|
|
|
nsCSSValue val;
|
1998-09-10 05:19:26 +04:00
|
|
|
|
1998-09-25 04:51:45 +04:00
|
|
|
if (nsnull != mImportant) {
|
|
|
|
mImportant->GetValue(aProperty, val);
|
|
|
|
if (eCSSUnit_Null != val.GetUnit()) {
|
|
|
|
aIsImportant = PR_TRUE;
|
1998-09-10 05:19:26 +04:00
|
|
|
}
|
1998-09-25 04:51:45 +04:00
|
|
|
else {
|
|
|
|
aIsImportant = PR_FALSE;
|
1998-07-18 03:00:54 +04:00
|
|
|
}
|
1998-07-15 02:34:27 +04:00
|
|
|
}
|
1998-09-25 04:51:45 +04:00
|
|
|
else {
|
|
|
|
aIsImportant = PR_FALSE;
|
1998-07-15 02:34:27 +04:00
|
|
|
}
|
|
|
|
|
1998-09-25 04:51:45 +04:00
|
|
|
return NS_OK;
|
1998-07-15 02:34:27 +04:00
|
|
|
}
|
|
|
|
|
2001-10-24 12:08:30 +04:00
|
|
|
#define SHORTHAND_BORDER_WIDTH 0x001
|
|
|
|
#define SHORTHAND_BORDER_STYLE 0x010
|
|
|
|
#define SHORTHAND_BORDER_COLOR 0x100
|
|
|
|
|
|
|
|
PRBool
|
|
|
|
CSSDeclarationImpl::AllPropertiesSameValue(PRInt32 aFirst, PRInt32 aSecond,
|
|
|
|
PRInt32 aThird, PRInt32 aFourth)
|
|
|
|
{
|
|
|
|
nsCSSValue firstValue, otherValue;
|
|
|
|
GetValue((nsCSSProperty)NS_PTR_TO_INT32(mOrder->ElementAt(aFirst)), firstValue);
|
|
|
|
GetValue((nsCSSProperty)NS_PTR_TO_INT32(mOrder->ElementAt(aSecond)), otherValue);
|
|
|
|
if (firstValue != otherValue) {
|
|
|
|
return PR_FALSE;
|
|
|
|
}
|
|
|
|
GetValue((nsCSSProperty)NS_PTR_TO_INT32(mOrder->ElementAt(aThird)), otherValue);
|
|
|
|
if (firstValue != otherValue) {
|
|
|
|
return PR_FALSE;
|
|
|
|
}
|
|
|
|
GetValue((nsCSSProperty)NS_PTR_TO_INT32(mOrder->ElementAt(aFourth)), otherValue);
|
|
|
|
if (firstValue != otherValue) {
|
|
|
|
return PR_FALSE;
|
|
|
|
}
|
|
|
|
return PR_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
CSSDeclarationImpl::AppendPropertyAndValueToString(nsCSSProperty aProperty,
|
|
|
|
nsAWritableString& aString)
|
|
|
|
{
|
|
|
|
NS_ASSERTION(aProperty, "null CSS property passed to AppendPropertyAndValueToString.");
|
|
|
|
aString.Append(NS_ConvertASCIItoUCS2(nsCSSProps::GetStringValue(aProperty))
|
|
|
|
+ NS_LITERAL_STRING(": "));
|
|
|
|
AppendValueToString(aProperty, aString);
|
|
|
|
aString.Append(NS_LITERAL_STRING("; "));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
CSSDeclarationImpl::TryBorderShorthand(nsAWritableString & aString,
|
|
|
|
PRInt32 & aBorderTopWidth,
|
|
|
|
PRInt32 & aBorderTopStyle,
|
|
|
|
PRInt32 & aBorderTopColor,
|
|
|
|
PRInt32 & aBorderBottomWidth,
|
|
|
|
PRInt32 & aBorderBottomStyle,
|
|
|
|
PRInt32 & aBorderBottomColor,
|
|
|
|
PRInt32 & aBorderLeftWidth,
|
|
|
|
PRInt32 & aBorderLeftStyle,
|
|
|
|
PRInt32 & aBorderLeftColor,
|
|
|
|
PRInt32 & aBorderRightWidth,
|
|
|
|
PRInt32 & aBorderRightStyle,
|
|
|
|
PRInt32 & aBorderRightColor)
|
|
|
|
{
|
|
|
|
PRInt32 border = 0;
|
|
|
|
if (aBorderTopWidth && aBorderBottomWidth
|
|
|
|
&& aBorderLeftWidth && aBorderRightWidth
|
|
|
|
&& AllPropertiesSameValue(aBorderTopWidth-1, aBorderBottomWidth-1,
|
|
|
|
aBorderLeftWidth-1, aBorderRightWidth-1))
|
|
|
|
border |= SHORTHAND_BORDER_WIDTH;
|
|
|
|
if (aBorderTopStyle && aBorderBottomStyle
|
|
|
|
&& aBorderLeftStyle && aBorderRightStyle
|
|
|
|
&& AllPropertiesSameValue(aBorderTopStyle-1, aBorderBottomStyle-1,
|
|
|
|
aBorderLeftStyle-1, aBorderRightStyle-1))
|
|
|
|
border |= SHORTHAND_BORDER_STYLE;
|
|
|
|
if (aBorderTopColor && aBorderBottomColor
|
|
|
|
&& aBorderLeftColor && aBorderRightColor
|
|
|
|
&& AllPropertiesSameValue(aBorderTopColor-1, aBorderBottomColor-1,
|
|
|
|
aBorderLeftColor-1, aBorderRightColor-1))
|
|
|
|
border |= SHORTHAND_BORDER_COLOR;
|
|
|
|
|
|
|
|
if (border) {
|
|
|
|
aString.Append(NS_ConvertASCIItoUCS2(nsCSSProps::GetStringValue(eCSSProperty_border))
|
|
|
|
+ NS_LITERAL_STRING(": "));
|
|
|
|
if (border & SHORTHAND_BORDER_WIDTH) {
|
|
|
|
AppendValueToString(eCSSProperty_border_top_width, aString);
|
|
|
|
border ^= SHORTHAND_BORDER_WIDTH;
|
|
|
|
aBorderTopWidth = 0;
|
|
|
|
aBorderBottomWidth = 0;
|
|
|
|
aBorderLeftWidth = 0;
|
|
|
|
aBorderRightWidth = 0;
|
|
|
|
if (border)
|
|
|
|
aString.Append(PRUnichar(' '));
|
|
|
|
else
|
|
|
|
aString.Append(NS_LITERAL_STRING("; "));
|
|
|
|
}
|
|
|
|
if (border & SHORTHAND_BORDER_STYLE) {
|
|
|
|
AppendValueToString(eCSSProperty_border_top_style, aString);
|
|
|
|
border ^= SHORTHAND_BORDER_STYLE;
|
|
|
|
aBorderTopStyle = 0;
|
|
|
|
aBorderBottomStyle = 0;
|
|
|
|
aBorderLeftStyle = 0;
|
|
|
|
aBorderRightStyle = 0;
|
|
|
|
if (border)
|
|
|
|
aString.Append(PRUnichar(' '));
|
|
|
|
else
|
|
|
|
aString.Append(NS_LITERAL_STRING("; "));
|
|
|
|
}
|
|
|
|
if (border & SHORTHAND_BORDER_COLOR) {
|
|
|
|
nsAutoString valueString;
|
|
|
|
AppendValueToString(eCSSProperty_border_top_color, valueString);
|
|
|
|
if (!valueString.Equals(NS_LITERAL_STRING("-moz-use-text-color"))) {
|
|
|
|
aString.Append(valueString);
|
|
|
|
}
|
|
|
|
aBorderTopColor = 0;
|
|
|
|
aBorderBottomColor = 0;
|
|
|
|
aBorderLeftColor = 0;
|
|
|
|
aBorderRightColor = 0;
|
|
|
|
aString.Append(NS_LITERAL_STRING("; "));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
CSSDeclarationImpl::TryBorderSideShorthand(nsAWritableString & aString,
|
|
|
|
nsCSSProperty aShorthand,
|
|
|
|
PRInt32 & aBorderWidth,
|
|
|
|
PRInt32 & aBorderStyle,
|
|
|
|
PRInt32 & aBorderColor)
|
|
|
|
{
|
|
|
|
if ((aBorderWidth && aBorderStyle) ||
|
|
|
|
(aBorderWidth && aBorderColor) ||
|
|
|
|
(aBorderStyle && aBorderColor)) {
|
|
|
|
// ok, we have at least two values and we can make a shorthand
|
|
|
|
aString.Append(NS_ConvertASCIItoUCS2(nsCSSProps::GetStringValue(aShorthand))
|
|
|
|
+ NS_LITERAL_STRING(":"));
|
|
|
|
if (aBorderWidth) {
|
|
|
|
aString.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString((nsCSSProperty)NS_PTR_TO_INT32(mOrder->ElementAt(aBorderWidth-1)), aString);
|
|
|
|
aBorderWidth = 0;
|
|
|
|
}
|
|
|
|
if (aBorderStyle) {
|
|
|
|
aString.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString((nsCSSProperty)NS_PTR_TO_INT32(mOrder->ElementAt(aBorderStyle-1)), aString);
|
|
|
|
aBorderStyle = 0;
|
|
|
|
}
|
|
|
|
if (aBorderColor) {
|
|
|
|
nsAutoString valueString;
|
|
|
|
AppendValueToString((nsCSSProperty)NS_PTR_TO_INT32(mOrder->ElementAt(aBorderColor-1)), valueString);
|
|
|
|
if (!valueString.Equals(NS_LITERAL_STRING("-moz-use-text-color"))) {
|
|
|
|
aString.Append(NS_LITERAL_STRING(" ") + valueString);
|
|
|
|
}
|
|
|
|
aBorderColor = 0;
|
|
|
|
}
|
|
|
|
aString.Append(NS_LITERAL_STRING("; "));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
CSSDeclarationImpl::TryMarginOrPaddingShorthand(nsAWritableString & aString,
|
|
|
|
nsCSSProperty aShorthand,
|
|
|
|
PRInt32 & aTop,
|
|
|
|
PRInt32 & aBottom,
|
|
|
|
PRInt32 & aLeft,
|
|
|
|
PRInt32 & aRight)
|
|
|
|
{
|
|
|
|
if (aTop && aBottom && aLeft && aRight) {
|
|
|
|
// all 4 properties are set, we can output a shorthand
|
|
|
|
aString.Append(NS_ConvertASCIItoUCS2(nsCSSProps::GetStringValue(aShorthand))
|
|
|
|
+ NS_LITERAL_STRING(": "));
|
|
|
|
nsCSSValue topValue, bottomValue, leftValue, rightValue;
|
|
|
|
nsCSSProperty topProp = (nsCSSProperty)NS_PTR_TO_INT32(mOrder->ElementAt(aTop-1));
|
|
|
|
nsCSSProperty bottomProp = (nsCSSProperty)NS_PTR_TO_INT32(mOrder->ElementAt(aBottom-1));
|
|
|
|
nsCSSProperty leftProp = (nsCSSProperty)NS_PTR_TO_INT32(mOrder->ElementAt(aLeft-1));
|
|
|
|
nsCSSProperty rightProp = (nsCSSProperty)NS_PTR_TO_INT32(mOrder->ElementAt(aRight-1));
|
|
|
|
GetValue(topProp, topValue);
|
|
|
|
GetValue(bottomProp, bottomValue);
|
|
|
|
GetValue(leftProp, leftValue);
|
|
|
|
GetValue(rightProp, rightValue);
|
|
|
|
AppendValueToString(topProp, topValue, aString);
|
|
|
|
if (topValue != rightValue || topValue != leftValue || topValue != bottomValue) {
|
|
|
|
aString.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString(rightProp, rightValue, aString);
|
|
|
|
if (topValue != bottomValue || rightValue != leftValue) {
|
|
|
|
aString.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString(bottomProp, bottomValue, aString);
|
|
|
|
if (rightValue != leftValue) {
|
|
|
|
aString.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString(leftProp, leftValue, aString);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
aTop = 0; aBottom = 0; aLeft = 0; aRight = 0;
|
|
|
|
aString.Append(NS_LITERAL_STRING("; "));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
CSSDeclarationImpl::TryBackgroundShorthand(nsAWritableString & aString,
|
|
|
|
PRInt32 & aBgColor,
|
|
|
|
PRInt32 & aBgImage,
|
|
|
|
PRInt32 & aBgRepeat,
|
|
|
|
PRInt32 & aBgAttachment,
|
|
|
|
PRInt32 & aBgPositionX,
|
|
|
|
PRInt32 & aBgPositionY)
|
|
|
|
{
|
|
|
|
// check if we have at least two properties set; otherwise, no need to
|
|
|
|
// use a shorthand
|
|
|
|
PRInt8 numberPropertiesSpecified = (aBgColor ? 1 : 0) + (aBgImage ? 1 : 0)
|
|
|
|
+ (aBgRepeat ? 1 : 0) + (aBgAttachment ? 1 : 0)
|
|
|
|
+ (aBgPositionX*aBgPositionY ? 1 : 0);
|
|
|
|
if (numberPropertiesSpecified >= 2) {
|
|
|
|
aString.Append(NS_ConvertASCIItoUCS2(nsCSSProps::GetStringValue(eCSSProperty_background))
|
|
|
|
+ NS_LITERAL_STRING(":"));
|
|
|
|
if (aBgColor) {
|
|
|
|
aString.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString(eCSSProperty_background_color, aString);
|
|
|
|
aBgColor = 0;
|
|
|
|
}
|
|
|
|
if (aBgImage) {
|
|
|
|
aString.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString(eCSSProperty_background_image, aString);
|
|
|
|
aBgImage = 0;
|
|
|
|
}
|
|
|
|
if (aBgRepeat) {
|
|
|
|
aString.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString(eCSSProperty_background_repeat, aString);
|
|
|
|
aBgRepeat = 0;
|
|
|
|
}
|
|
|
|
if (aBgAttachment) {
|
|
|
|
aString.Append(PRUnichar(' '));
|
|
|
|
AppendValueToString(eCSSProperty_background_attachment, aString);
|
|
|
|
aBgAttachment = 0;
|
|
|
|
}
|
|
|
|
if (aBgPositionX && aBgPositionY) {
|
|
|
|
aString.Append(PRUnichar(' '));
|
|
|
|
TryBackgroundPosition(aString, aBgPositionX, aBgPositionY);
|
|
|
|
}
|
|
|
|
aString.Append(NS_LITERAL_STRING("; "));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
CSSDeclarationImpl::TryBackgroundPosition(nsAWritableString & aString,
|
|
|
|
PRInt32 & aBgPositionX,
|
|
|
|
PRInt32 & aBgPositionY)
|
|
|
|
{
|
|
|
|
if (aBgPositionX && aBgPositionY) {
|
|
|
|
nsAutoString backgroundXValue, backgroundYValue;
|
|
|
|
AppendValueToString(eCSSProperty_background_x_position, backgroundXValue);
|
|
|
|
AppendValueToString(eCSSProperty_background_y_position, backgroundYValue);
|
|
|
|
aString.Append(backgroundYValue);
|
|
|
|
if (Compare(backgroundXValue, backgroundYValue, nsCaseInsensitiveStringComparator())) {
|
|
|
|
// the two values are different
|
|
|
|
aString.Append(PRUnichar(' '));
|
|
|
|
aString.Append(backgroundXValue);
|
|
|
|
}
|
|
|
|
aBgPositionX = 0;
|
|
|
|
aBgPositionY = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#define NS_CASE_OUTPUT_PROPERTY_VALUE(_prop, _index) \
|
|
|
|
case _prop: \
|
|
|
|
if (_index) { \
|
|
|
|
AppendPropertyAndValueToString(property, aString); \
|
|
|
|
_index = 0; \
|
|
|
|
} \
|
|
|
|
break;
|
|
|
|
|
1999-01-06 04:25:39 +03:00
|
|
|
NS_IMETHODIMP
|
2000-08-23 21:27:06 +04:00
|
|
|
CSSDeclarationImpl::ToString(nsAWritableString& aString)
|
1998-07-15 02:34:27 +04:00
|
|
|
{
|
1998-09-10 05:19:26 +04:00
|
|
|
if (nsnull != mOrder) {
|
|
|
|
PRInt32 count = mOrder->Count();
|
|
|
|
PRInt32 index;
|
2001-10-24 12:08:30 +04:00
|
|
|
PRInt32 borderTopWidth = 0, borderTopStyle = 0, borderTopColor = 0;
|
|
|
|
PRInt32 borderBottomWidth = 0, borderBottomStyle = 0, borderBottomColor = 0;
|
|
|
|
PRInt32 borderLeftWidth = 0, borderLeftStyle = 0, borderLeftColor = 0;
|
|
|
|
PRInt32 borderRightWidth = 0, borderRightStyle = 0, borderRightColor = 0;
|
|
|
|
PRInt32 marginTop = 0, marginBottom = 0, marginLeft = 0, marginRight = 0;
|
|
|
|
PRInt32 paddingTop = 0, paddingBottom = 0, paddingLeft = 0, paddingRight = 0;
|
|
|
|
PRInt32 bgColor = 0, bgImage = 0, bgRepeat = 0, bgAttachment = 0;
|
|
|
|
PRInt32 bgPositionX = 0, bgPositionY = 0;
|
1998-09-10 05:19:26 +04:00
|
|
|
for (index = 0; index < count; index++) {
|
2001-08-14 11:59:59 +04:00
|
|
|
nsCSSProperty property = (nsCSSProperty)NS_PTR_TO_INT32(mOrder->ElementAt(index));
|
2001-10-24 12:08:30 +04:00
|
|
|
switch (property) {
|
|
|
|
case eCSSProperty_border_top_width: borderTopWidth = index+1; break;
|
|
|
|
case eCSSProperty_border_bottom_width: borderBottomWidth = index+1; break;
|
|
|
|
case eCSSProperty_border_left_width: borderLeftWidth = index+1; break;
|
|
|
|
case eCSSProperty_border_right_width: borderRightWidth = index+1; break;
|
|
|
|
|
|
|
|
case eCSSProperty_border_top_style: borderTopStyle = index+1; break;
|
|
|
|
case eCSSProperty_border_bottom_style: borderBottomStyle = index+1; break;
|
|
|
|
case eCSSProperty_border_left_style: borderLeftStyle = index+1; break;
|
|
|
|
case eCSSProperty_border_right_style: borderRightStyle = index+1; break;
|
|
|
|
|
|
|
|
case eCSSProperty_border_top_color: borderTopColor = index+1; break;
|
|
|
|
case eCSSProperty_border_bottom_color: borderBottomColor = index+1; break;
|
|
|
|
case eCSSProperty_border_left_color: borderLeftColor = index+1; break;
|
|
|
|
case eCSSProperty_border_right_color: borderRightColor = index+1; break;
|
|
|
|
|
|
|
|
case eCSSProperty_margin_top: marginTop = index+1; break;
|
|
|
|
case eCSSProperty_margin_bottom: marginBottom = index+1; break;
|
|
|
|
case eCSSProperty_margin_left: marginLeft = index+1; break;
|
|
|
|
case eCSSProperty_margin_right: marginRight = index+1; break;
|
|
|
|
|
|
|
|
case eCSSProperty_padding_top: paddingTop = index+1; break;
|
|
|
|
case eCSSProperty_padding_bottom: paddingBottom = index+1; break;
|
|
|
|
case eCSSProperty_padding_left: paddingLeft = index+1; break;
|
|
|
|
case eCSSProperty_padding_right: paddingRight = index+1; break;
|
|
|
|
|
|
|
|
case eCSSProperty_background_color: bgColor = index+1; break;
|
|
|
|
case eCSSProperty_background_image: bgImage = index+1; break;
|
|
|
|
case eCSSProperty_background_repeat: bgRepeat = index+1; break;
|
|
|
|
case eCSSProperty_background_attachment: bgAttachment = index+1; break;
|
|
|
|
case eCSSProperty_background_x_position: bgPositionX = index+1; break;
|
|
|
|
case eCSSProperty_background_y_position: bgPositionY = index+1; break;
|
1998-09-10 05:19:26 +04:00
|
|
|
}
|
2001-10-24 12:08:30 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
TryBorderShorthand(aString,
|
|
|
|
borderTopWidth, borderTopStyle, borderTopColor,
|
|
|
|
borderBottomWidth, borderBottomStyle, borderBottomColor,
|
|
|
|
borderLeftWidth, borderLeftStyle, borderLeftColor,
|
|
|
|
borderRightWidth, borderRightStyle, borderRightColor);
|
|
|
|
TryBorderSideShorthand(aString, eCSSProperty_border_top,
|
|
|
|
borderTopWidth, borderTopStyle, borderTopColor);
|
|
|
|
TryBorderSideShorthand(aString, eCSSProperty_border_bottom,
|
|
|
|
borderBottomWidth, borderBottomStyle, borderBottomColor);
|
|
|
|
TryBorderSideShorthand(aString, eCSSProperty_border_left,
|
|
|
|
borderLeftWidth, borderLeftStyle, borderLeftColor);
|
|
|
|
TryBorderSideShorthand(aString, eCSSProperty_border_right,
|
|
|
|
borderRightWidth, borderRightStyle, borderRightColor);
|
|
|
|
|
|
|
|
|
|
|
|
TryMarginOrPaddingShorthand(aString, eCSSProperty_margin,
|
|
|
|
marginTop, marginBottom, marginLeft, marginRight);
|
|
|
|
TryMarginOrPaddingShorthand(aString, eCSSProperty_padding,
|
|
|
|
paddingTop, paddingBottom, paddingLeft, paddingRight);
|
|
|
|
|
|
|
|
TryBackgroundShorthand(aString,
|
|
|
|
bgColor, bgImage, bgRepeat, bgAttachment,
|
|
|
|
bgPositionX, bgPositionY);
|
|
|
|
|
|
|
|
for (index = 0; index < count; index++) {
|
|
|
|
nsCSSProperty property = (nsCSSProperty)NS_PTR_TO_INT32(mOrder->ElementAt(index));
|
|
|
|
switch (property) {
|
|
|
|
|
|
|
|
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_border_top_width, borderTopWidth)
|
|
|
|
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_border_bottom_width, borderBottomWidth)
|
|
|
|
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_border_left_width, borderLeftWidth)
|
|
|
|
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_border_right_width, borderRightWidth)
|
|
|
|
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_border_top_style, borderTopStyle)
|
|
|
|
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_border_bottom_style, borderBottomStyle)
|
|
|
|
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_border_left_style, borderLeftStyle)
|
|
|
|
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_border_right_style, borderRightStyle)
|
|
|
|
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_border_top_color, borderTopColor)
|
|
|
|
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_border_bottom_color, borderBottomColor)
|
|
|
|
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_border_left_color, borderLeftColor)
|
|
|
|
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_border_right_color, borderRightColor)
|
|
|
|
|
|
|
|
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_margin_top, marginTop)
|
|
|
|
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_margin_bottom, marginBottom)
|
|
|
|
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_margin_left, marginLeft)
|
|
|
|
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_margin_right, marginRight)
|
|
|
|
|
|
|
|
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_padding_top, paddingTop)
|
|
|
|
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_padding_bottom, paddingBottom)
|
|
|
|
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_padding_left, paddingLeft)
|
|
|
|
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_padding_right, paddingRight)
|
|
|
|
|
|
|
|
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_background_color, bgColor)
|
|
|
|
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_background_image, bgImage)
|
|
|
|
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_background_repeat, bgRepeat)
|
|
|
|
NS_CASE_OUTPUT_PROPERTY_VALUE(eCSSProperty_background_attachment, bgAttachment)
|
|
|
|
|
|
|
|
case eCSSProperty_background_x_position:
|
|
|
|
case eCSSProperty_background_y_position:
|
|
|
|
if (bgPositionX && bgPositionY) {
|
|
|
|
aString.Append(NS_ConvertASCIItoUCS2(nsCSSProps::GetStringValue(eCSSProperty_background_position))
|
|
|
|
+ NS_LITERAL_STRING(": "));
|
|
|
|
TryBackgroundPosition(aString, bgPositionX, bgPositionY);
|
|
|
|
aString.Append(NS_LITERAL_STRING("; "));
|
|
|
|
}
|
|
|
|
else if (eCSSProperty_background_x_position == property && bgPositionX) {
|
|
|
|
AppendPropertyAndValueToString(eCSSProperty_background_x_position, aString);
|
|
|
|
bgPositionX = 0;
|
|
|
|
}
|
|
|
|
else if (eCSSProperty_background_y_position == property && bgPositionY) {
|
|
|
|
AppendPropertyAndValueToString(eCSSProperty_background_y_position, aString);
|
|
|
|
bgPositionY = 0;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
if (0 <= property) {
|
|
|
|
AppendPropertyAndValueToString(property, aString);
|
|
|
|
}
|
|
|
|
else { // is comment
|
|
|
|
aString.Append(NS_LITERAL_STRING("/* "));
|
|
|
|
nsString* comment = mComments->StringAt((-1) - property);
|
|
|
|
aString.Append(*comment);
|
|
|
|
aString.Append(NS_LITERAL_STRING(" */ "));
|
|
|
|
}
|
|
|
|
break;
|
1998-09-10 05:19:26 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2001-10-24 12:08:30 +04:00
|
|
|
if (! aString.IsEmpty()) {
|
|
|
|
// if the string is not empty, we have a trailing whitespace we should remove
|
|
|
|
aString.Truncate(aString.Length() - 1);
|
|
|
|
}
|
1998-09-10 05:19:26 +04:00
|
|
|
return NS_OK;
|
1998-07-15 02:34:27 +04:00
|
|
|
}
|
|
|
|
|
2001-10-16 09:31:36 +04:00
|
|
|
#ifdef DEBUG
|
1998-09-10 05:19:26 +04:00
|
|
|
void CSSDeclarationImpl::List(FILE* out, PRInt32 aIndent) const
|
|
|
|
{
|
|
|
|
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
|
|
|
|
|
|
|
|
fputs("{ ", out);
|
|
|
|
|
|
|
|
if (nsnull != mFont) {
|
|
|
|
mFont->List(out);
|
|
|
|
}
|
|
|
|
if (nsnull != mColor) {
|
|
|
|
mColor->List(out);
|
|
|
|
}
|
|
|
|
if (nsnull != mText) {
|
|
|
|
mText->List(out);
|
|
|
|
}
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mDisplay) {
|
|
|
|
mDisplay->List(out);
|
|
|
|
}
|
1998-09-10 05:19:26 +04:00
|
|
|
if (nsnull != mMargin) {
|
|
|
|
mMargin->List(out);
|
|
|
|
}
|
|
|
|
if (nsnull != mPosition) {
|
|
|
|
mPosition->List(out);
|
|
|
|
}
|
|
|
|
if (nsnull != mList) {
|
|
|
|
mList->List(out);
|
|
|
|
}
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mTable) {
|
|
|
|
mTable->List(out);
|
|
|
|
}
|
|
|
|
if (nsnull != mBreaks) {
|
|
|
|
mBreaks->List(out);
|
|
|
|
}
|
|
|
|
if (nsnull != mPage) {
|
|
|
|
mPage->List(out);
|
|
|
|
}
|
|
|
|
if (nsnull != mContent) {
|
|
|
|
mContent->List(out);
|
|
|
|
}
|
1999-07-24 23:04:42 +04:00
|
|
|
if (nsnull != mUserInterface) {
|
|
|
|
mUserInterface->List(out);
|
|
|
|
}
|
1998-10-08 05:31:58 +04:00
|
|
|
if (nsnull != mAural) {
|
|
|
|
mAural->List(out);
|
1998-09-10 05:19:26 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
fputs("}", out);
|
|
|
|
|
|
|
|
if (nsnull != mImportant) {
|
|
|
|
fputs(" ! important ", out);
|
|
|
|
mImportant->List(out, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-03-31 11:08:36 +04:00
|
|
|
/******************************************************************************
|
|
|
|
* SizeOf method:
|
|
|
|
*
|
|
|
|
* Self (reported as CSSDeclarationImpl's size):
|
|
|
|
* 1) sizeof(*this) + the sizeof each non-null attribute
|
|
|
|
*
|
|
|
|
* Contained / Aggregated data (not reported as CSSDeclarationImpl's size):
|
|
|
|
* none
|
|
|
|
*
|
|
|
|
* Children / siblings / parents:
|
|
|
|
* none
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
void CSSDeclarationImpl::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize)
|
|
|
|
{
|
|
|
|
NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null");
|
|
|
|
|
|
|
|
// first get the unique items collection
|
|
|
|
UNIQUE_STYLE_ITEMS(uniqueItems);
|
|
|
|
if(! uniqueItems->AddItem((void*)this)){
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// create a tag for this instance
|
|
|
|
nsCOMPtr<nsIAtom> tag;
|
|
|
|
tag = getter_AddRefs(NS_NewAtom("CSSDeclarationImpl"));
|
|
|
|
// get the size of an empty instance and add to the sizeof handler
|
|
|
|
aSize = sizeof(*this);
|
|
|
|
|
|
|
|
// now add in all of the contained objects, checking for duplicates on all of them
|
|
|
|
if(mFont && uniqueItems->AddItem(mFont)){
|
|
|
|
aSize += sizeof(*mFont);
|
|
|
|
}
|
|
|
|
if(mColor && uniqueItems->AddItem(mColor)){
|
|
|
|
aSize += sizeof(*mColor);
|
|
|
|
}
|
|
|
|
if(mText && uniqueItems->AddItem(mText)){
|
|
|
|
aSize += sizeof(*mText);
|
|
|
|
}
|
|
|
|
if(mMargin && uniqueItems->AddItem(mMargin)){
|
|
|
|
aSize += sizeof(*mMargin);
|
|
|
|
}
|
|
|
|
if(mPosition && uniqueItems->AddItem(mPosition)){
|
|
|
|
aSize += sizeof(*mPosition);
|
|
|
|
}
|
|
|
|
if(mList && uniqueItems->AddItem(mList)){
|
|
|
|
aSize += sizeof(*mList);
|
|
|
|
}
|
|
|
|
if(mDisplay && uniqueItems->AddItem(mDisplay)){
|
|
|
|
aSize += sizeof(*mDisplay);
|
|
|
|
}
|
|
|
|
if(mTable && uniqueItems->AddItem(mTable)){
|
|
|
|
aSize += sizeof(*mTable);
|
|
|
|
}
|
|
|
|
if(mBreaks && uniqueItems->AddItem(mBreaks)){
|
|
|
|
aSize += sizeof(*mBreaks);
|
|
|
|
}
|
|
|
|
if(mPage && uniqueItems->AddItem(mPage)){
|
|
|
|
aSize += sizeof(*mPage);
|
|
|
|
}
|
|
|
|
if(mContent && uniqueItems->AddItem(mContent)){
|
|
|
|
aSize += sizeof(*mContent);
|
|
|
|
}
|
|
|
|
if(mUserInterface && uniqueItems->AddItem(mUserInterface)){
|
|
|
|
aSize += sizeof(*mUserInterface);
|
|
|
|
}
|
2001-03-06 05:30:30 +03:00
|
|
|
#ifdef INCLUDE_XUL
|
|
|
|
if(mXUL && uniqueItems->AddItem(mXUL)){
|
|
|
|
aSize += sizeof(*mXUL);
|
|
|
|
}
|
|
|
|
#endif
|
2000-03-31 11:08:36 +04:00
|
|
|
if(mAural && uniqueItems->AddItem(mAural)){
|
|
|
|
aSize += sizeof(*mAural);
|
|
|
|
}
|
|
|
|
aSizeOfHandler->AddSize(tag, aSize);
|
|
|
|
}
|
2001-10-16 09:31:36 +04:00
|
|
|
#endif
|
2000-03-31 11:08:36 +04:00
|
|
|
|
1999-01-06 04:25:39 +03:00
|
|
|
NS_IMETHODIMP
|
1998-09-25 04:51:45 +04:00
|
|
|
CSSDeclarationImpl::Count(PRUint32* aCount)
|
|
|
|
{
|
|
|
|
if (nsnull != mOrder) {
|
|
|
|
*aCount = (PRUint32)mOrder->Count();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
*aCount = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
1999-01-06 04:25:39 +03:00
|
|
|
NS_IMETHODIMP
|
2000-08-23 21:27:06 +04:00
|
|
|
CSSDeclarationImpl::GetNthProperty(PRUint32 aIndex, nsAWritableString& aReturn)
|
1998-09-25 04:51:45 +04:00
|
|
|
{
|
2000-08-23 21:27:06 +04:00
|
|
|
aReturn.Truncate();
|
1998-09-25 04:51:45 +04:00
|
|
|
if (nsnull != mOrder) {
|
2001-08-14 11:59:59 +04:00
|
|
|
nsCSSProperty property = (nsCSSProperty)NS_PTR_TO_INT32(mOrder->ElementAt(aIndex));
|
1998-09-25 04:51:45 +04:00
|
|
|
if (0 <= property) {
|
2000-08-23 21:27:06 +04:00
|
|
|
aReturn.Append(NS_ConvertASCIItoUCS2(nsCSSProps::GetStringValue(property)));
|
1998-09-25 04:51:45 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
1999-01-06 04:25:39 +03:00
|
|
|
NS_IMETHODIMP
|
|
|
|
CSSDeclarationImpl::GetStyleImpact(PRInt32* aHint) const
|
|
|
|
{
|
|
|
|
NS_ASSERTION(nsnull != aHint, "null pointer");
|
|
|
|
if (nsnull == aHint) {
|
|
|
|
return NS_ERROR_NULL_POINTER;
|
|
|
|
}
|
1999-01-15 05:04:51 +03:00
|
|
|
PRInt32 hint = NS_STYLE_HINT_NONE;
|
1999-01-06 04:25:39 +03:00
|
|
|
if (nsnull != mOrder) {
|
|
|
|
PRInt32 count = mOrder->Count();
|
|
|
|
PRInt32 index;
|
|
|
|
for (index = 0; index < count; index++) {
|
2001-08-14 11:59:59 +04:00
|
|
|
nsCSSProperty property = (nsCSSProperty)NS_PTR_TO_INT32(mOrder->ElementAt(index));
|
1999-07-18 04:25:28 +04:00
|
|
|
if (eCSSProperty_UNKNOWN < property) {
|
1999-01-06 04:25:39 +03:00
|
|
|
if (hint < nsCSSProps::kHintTable[property]) {
|
|
|
|
hint = nsCSSProps::kHintTable[property];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*aHint = hint;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
1999-06-03 05:58:11 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
CSSDeclarationImpl::Clone(nsICSSDeclaration*& aClone) const
|
|
|
|
{
|
|
|
|
CSSDeclarationImpl* clone = new CSSDeclarationImpl(*this);
|
|
|
|
if (clone) {
|
2001-01-04 23:44:42 +03:00
|
|
|
return clone->QueryInterface(NS_GET_IID(nsICSSDeclaration), (void**)&aClone);
|
1999-06-03 05:58:11 +04:00
|
|
|
}
|
|
|
|
aClone = nsnull;
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
}
|
|
|
|
|
1998-09-25 04:51:45 +04:00
|
|
|
|
2001-10-20 00:59:33 +04:00
|
|
|
NS_EXPORT nsresult
|
1998-09-10 05:19:26 +04:00
|
|
|
NS_NewCSSDeclaration(nsICSSDeclaration** aInstancePtrResult)
|
|
|
|
{
|
|
|
|
if (aInstancePtrResult == nsnull) {
|
|
|
|
return NS_ERROR_NULL_POINTER;
|
|
|
|
}
|
|
|
|
|
1998-10-05 09:11:18 +04:00
|
|
|
CSSDeclarationImpl *it;
|
|
|
|
NS_NEWXPCOM(it, CSSDeclarationImpl);
|
1998-09-10 05:19:26 +04:00
|
|
|
|
|
|
|
if (nsnull == it) {
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
}
|
|
|
|
|
2001-01-04 23:44:42 +03:00
|
|
|
return it->QueryInterface(NS_GET_IID(nsICSSDeclaration), (void **) aInstancePtrResult);
|
1998-09-10 05:19:26 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|