mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 569719 part 1: Rename nsCSSDeclaration to mozilla::css::Declaration. r=dbaron
This commit is contained in:
parent
a7fd29ee6b
commit
9c006a4ff7
@ -56,6 +56,8 @@
|
||||
#include "nsISVGValue.h"
|
||||
#endif
|
||||
|
||||
namespace css = mozilla::css;
|
||||
|
||||
#define MISC_STR_PTR(_cont) \
|
||||
reinterpret_cast<void*>((_cont)->mStringBits & NS_ATTRVALUE_POINTERVALUE_MASK)
|
||||
|
||||
@ -425,7 +427,7 @@ nsAttrValue::ToString(nsAString& aResult) const
|
||||
{
|
||||
aResult.Truncate();
|
||||
MiscContainer *container = GetMiscContainer();
|
||||
nsCSSDeclaration* decl = container->mCSSStyleRule->GetDeclaration();
|
||||
css::Declaration *decl = container->mCSSStyleRule->GetDeclaration();
|
||||
if (decl) {
|
||||
decl->ToString(aResult);
|
||||
}
|
||||
|
@ -72,8 +72,6 @@
|
||||
#include "nsDOMCID.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIDOMCSSStyleDeclaration.h"
|
||||
#include "nsCSSDeclaration.h"
|
||||
#include "nsDOMCSSDeclaration.h"
|
||||
#include "nsDOMCSSAttrDeclaration.h"
|
||||
#include "nsINameSpaceManager.h"
|
||||
#include "nsContentList.h"
|
||||
@ -93,7 +91,6 @@
|
||||
|
||||
#include "nsBindingManager.h"
|
||||
#include "nsXBLBinding.h"
|
||||
#include "nsIDOMCSSStyleDeclaration.h"
|
||||
#include "nsIDOMViewCSS.h"
|
||||
#include "nsIXBLService.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
|
@ -77,6 +77,8 @@
|
||||
#include "nsCSSProperty.h"
|
||||
#include "nsIDOMCSSRule.h"
|
||||
|
||||
namespace css = mozilla::css;
|
||||
|
||||
//
|
||||
// XXX THIS IS TEMPORARY CODE
|
||||
// There's a considerable amount of copied code from the
|
||||
@ -1215,7 +1217,7 @@ void
|
||||
nsHTMLParanoidFragmentSink::SanitizeStyleRule(nsICSSStyleRule *aRule, nsAutoString &aRuleText)
|
||||
{
|
||||
aRuleText.Truncate();
|
||||
nsCSSDeclaration *style = aRule->GetDeclaration();
|
||||
css::Declaration *style = aRule->GetDeclaration();
|
||||
if (style) {
|
||||
nsresult rv = style->RemoveProperty(eCSSProperty_binding);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
|
@ -40,7 +40,6 @@
|
||||
#include "nsSMILCSSProperty.h"
|
||||
#include "nsSMILCSSValueType.h"
|
||||
#include "nsSMILValue.h"
|
||||
#include "nsCSSDeclaration.h"
|
||||
#include "nsComputedDOMStyle.h"
|
||||
#include "nsStyleAnimation.h"
|
||||
#include "nsIContent.h"
|
||||
|
@ -46,7 +46,6 @@
|
||||
#include "nsCSSValue.h"
|
||||
|
||||
class nsIContent;
|
||||
class nsCSSDeclaration;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
@ -43,7 +43,6 @@
|
||||
#include "nsSMILParserUtils.h"
|
||||
#include "nsSMILValue.h"
|
||||
#include "nsCSSValue.h"
|
||||
#include "nsCSSDeclaration.h"
|
||||
#include "nsColor.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIContent.h"
|
||||
|
@ -1094,9 +1094,12 @@ nsSVGElement::DidModifySVGObservable(nsISVGValue* aObservable,
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Helper class: MappedAttrParser, for parsing values of mapped attributes
|
||||
|
||||
namespace {
|
||||
|
||||
class MappedAttrParser {
|
||||
public:
|
||||
MappedAttrParser(mozilla::css::Loader* aLoader,
|
||||
MappedAttrParser(css::Loader* aLoader,
|
||||
nsIURI* aDocURI,
|
||||
already_AddRefed<nsIURI> aBaseURI,
|
||||
nsIPrincipal* aNodePrincipal);
|
||||
@ -1108,7 +1111,7 @@ public:
|
||||
|
||||
// If we've parsed any values for mapped attributes, this method returns
|
||||
// a new already_AddRefed nsICSSStyleRule that incorporates the parsed
|
||||
// values. Otherwise, this method returns null.
|
||||
// values. Otherwise, this method returns null.
|
||||
already_AddRefed<nsICSSStyleRule> CreateStyleRule();
|
||||
|
||||
private:
|
||||
@ -1122,10 +1125,10 @@ private:
|
||||
nsIPrincipal* mNodePrincipal;
|
||||
|
||||
// Declaration for storing parsed values (lazily initialized)
|
||||
nsCSSDeclaration* mDecl;
|
||||
css::Declaration* mDecl;
|
||||
};
|
||||
|
||||
MappedAttrParser::MappedAttrParser(mozilla::css::Loader* aLoader,
|
||||
MappedAttrParser::MappedAttrParser(css::Loader* aLoader,
|
||||
nsIURI* aDocURI,
|
||||
already_AddRefed<nsIURI> aBaseURI,
|
||||
nsIPrincipal* aNodePrincipal)
|
||||
@ -1158,8 +1161,7 @@ MappedAttrParser::ParseMappedAttrValue(nsIAtom* aMappedAttrName,
|
||||
nsAString& aMappedAttrValue)
|
||||
{
|
||||
if (!mDecl) {
|
||||
// Need to do lazy initializion of declaration.
|
||||
mDecl = new nsCSSDeclaration();
|
||||
mDecl = new css::Declaration();
|
||||
mDecl->InitializeEmpty();
|
||||
}
|
||||
|
||||
@ -1187,6 +1189,8 @@ MappedAttrParser::CreateStyleRule()
|
||||
return rule.forget();
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Implementation Helpers:
|
||||
|
||||
|
@ -122,7 +122,6 @@
|
||||
#include "nsRuleWalker.h"
|
||||
#include "nsIDOMViewCSS.h"
|
||||
#include "nsIDOMCSSStyleDeclaration.h"
|
||||
#include "nsCSSDeclaration.h"
|
||||
#include "nsCSSParser.h"
|
||||
#include "nsIListBoxObject.h"
|
||||
#include "nsContentUtils.h"
|
||||
@ -131,7 +130,6 @@
|
||||
#include "nsIDOMMutationEvent.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsDOMAttributeMap.h"
|
||||
#include "nsDOMCSSDeclaration.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsXULContentUtils.h"
|
||||
#include "nsNodeUtils.h"
|
||||
|
@ -48,14 +48,18 @@
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
struct nsRuleData;
|
||||
|
||||
class nsCSSExpandedDataBlock;
|
||||
class nsCSSDeclaration;
|
||||
|
||||
namespace mozilla {
|
||||
namespace css {
|
||||
class Declaration;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An |nsCSSCompressedDataBlock| holds a usually-immutable chunk of
|
||||
* property-value data for a CSS declaration block (which we misname a
|
||||
* |nsCSSDeclaration|). Mutation is accomplished through
|
||||
* |css::Declaration|). Mutation is accomplished through
|
||||
* |nsCSSExpandedDataBlock| or in some cases via direct slot access.
|
||||
*
|
||||
* Mutation is forbidden when the reference count is greater than one,
|
||||
@ -66,7 +70,7 @@ class nsCSSDeclaration;
|
||||
class nsCSSCompressedDataBlock {
|
||||
public:
|
||||
friend class nsCSSExpandedDataBlock;
|
||||
friend class nsCSSDeclaration;
|
||||
friend class mozilla::css::Declaration;
|
||||
|
||||
/**
|
||||
* Do what |nsIStyleRule::MapRuleInfoInto| needs to do for a style
|
||||
|
@ -60,18 +60,19 @@
|
||||
#include "nsCOMPtr.h"
|
||||
#include "CSSCalc.h"
|
||||
|
||||
namespace css = mozilla::css;
|
||||
namespace mozilla {
|
||||
namespace css {
|
||||
|
||||
nsCSSDeclaration::nsCSSDeclaration()
|
||||
Declaration::Declaration()
|
||||
{
|
||||
// check that we can fit all the CSS properties into a PRUint8
|
||||
// for the mOrder array - if not, might need to use PRUint16!
|
||||
PR_STATIC_ASSERT(eCSSProperty_COUNT_no_shorthands - 1 <= PR_UINT8_MAX);
|
||||
|
||||
MOZ_COUNT_CTOR(nsCSSDeclaration);
|
||||
MOZ_COUNT_CTOR(mozilla::css::Declaration);
|
||||
}
|
||||
|
||||
nsCSSDeclaration::nsCSSDeclaration(const nsCSSDeclaration& aCopy)
|
||||
Declaration::Declaration(const Declaration& aCopy)
|
||||
: mOrder(aCopy.mOrder),
|
||||
mData(aCopy.mData ? aCopy.mData->Clone()
|
||||
: already_AddRefed<nsCSSCompressedDataBlock>(nsnull)),
|
||||
@ -79,16 +80,16 @@ nsCSSDeclaration::nsCSSDeclaration(const nsCSSDeclaration& aCopy)
|
||||
? aCopy.mImportantData->Clone()
|
||||
: already_AddRefed<nsCSSCompressedDataBlock>(nsnull))
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsCSSDeclaration);
|
||||
MOZ_COUNT_CTOR(mozilla::css::Declaration);
|
||||
}
|
||||
|
||||
nsCSSDeclaration::~nsCSSDeclaration(void)
|
||||
Declaration::~Declaration()
|
||||
{
|
||||
MOZ_COUNT_DTOR(nsCSSDeclaration);
|
||||
MOZ_COUNT_DTOR(mozilla::css::Declaration);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsCSSDeclaration::ValueAppended(nsCSSProperty aProperty)
|
||||
Declaration::ValueAppended(nsCSSProperty aProperty)
|
||||
{
|
||||
NS_ABORT_IF_FALSE(!nsCSSProps::IsShorthand(aProperty),
|
||||
"shorthands forbidden");
|
||||
@ -99,7 +100,7 @@ nsCSSDeclaration::ValueAppended(nsCSSProperty aProperty)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsCSSDeclaration::RemoveProperty(nsCSSProperty aProperty)
|
||||
Declaration::RemoveProperty(nsCSSProperty aProperty)
|
||||
{
|
||||
nsCSSExpandedDataBlock data;
|
||||
ExpandTo(&data);
|
||||
@ -119,18 +120,19 @@ nsCSSDeclaration::RemoveProperty(nsCSSProperty aProperty)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRBool nsCSSDeclaration::AppendValueToString(nsCSSProperty aProperty, nsAString& aResult) const
|
||||
PRBool Declaration::AppendValueToString(nsCSSProperty aProperty,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
nsCSSCompressedDataBlock *data = GetValueIsImportant(aProperty)
|
||||
? mImportantData : mData;
|
||||
const void *storage = data->StorageFor(aProperty);
|
||||
return nsCSSDeclaration::AppendStorageToString(aProperty, storage, aResult);
|
||||
return Declaration::AppendStorageToString(aProperty, storage, aResult);
|
||||
}
|
||||
|
||||
/* static */ PRBool
|
||||
nsCSSDeclaration::AppendStorageToString(nsCSSProperty aProperty,
|
||||
const void* aStorage,
|
||||
nsAString& aResult)
|
||||
Declaration::AppendStorageToString(nsCSSProperty aProperty,
|
||||
const void* aStorage,
|
||||
nsAString& aResult)
|
||||
{
|
||||
if (aStorage) {
|
||||
switch (nsCSSProps::kTypeTable[aProperty]) {
|
||||
@ -250,13 +252,13 @@ struct CSSValueSerializeCalcOps {
|
||||
{
|
||||
NS_ABORT_IF_FALSE(aValue.GetUnit() == eCSSUnit_Percent ||
|
||||
aValue.IsLengthUnit(), "unexpected unit");
|
||||
nsCSSDeclaration::AppendCSSValueToString(mProperty, aValue, mResult);
|
||||
Declaration::AppendCSSValueToString(mProperty, aValue, mResult);
|
||||
}
|
||||
|
||||
void AppendNumber(const input_type& aValue)
|
||||
{
|
||||
NS_ABORT_IF_FALSE(aValue.GetUnit() == eCSSUnit_Number, "unexpected unit");
|
||||
nsCSSDeclaration::AppendCSSValueToString(mProperty, aValue, mResult);
|
||||
Declaration::AppendCSSValueToString(mProperty, aValue, mResult);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -265,9 +267,9 @@ private:
|
||||
};
|
||||
|
||||
/* static */ PRBool
|
||||
nsCSSDeclaration::AppendCSSValueToString(nsCSSProperty aProperty,
|
||||
const nsCSSValue& aValue,
|
||||
nsAString& aResult)
|
||||
Declaration::AppendCSSValueToString(nsCSSProperty aProperty,
|
||||
const nsCSSValue& aValue,
|
||||
nsAString& aResult)
|
||||
{
|
||||
nsCSSUnit unit = aValue.GetUnit();
|
||||
|
||||
@ -621,8 +623,7 @@ nsCSSDeclaration::AppendCSSValueToString(nsCSSProperty aProperty,
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsCSSDeclaration::GetValue(nsCSSProperty aProperty,
|
||||
nsAString& aValue) const
|
||||
Declaration::GetValue(nsCSSProperty aProperty, nsAString& aValue) const
|
||||
{
|
||||
aValue.Truncate(0);
|
||||
|
||||
@ -1177,14 +1178,14 @@ nsCSSDeclaration::GetValue(nsCSSProperty aProperty,
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsCSSDeclaration::GetValueIsImportant(const nsAString& aProperty) const
|
||||
Declaration::GetValueIsImportant(const nsAString& aProperty) const
|
||||
{
|
||||
nsCSSProperty propID = nsCSSProps::LookupProperty(aProperty);
|
||||
return GetValueIsImportant(propID);
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsCSSDeclaration::GetValueIsImportant(nsCSSProperty aProperty) const
|
||||
Declaration::GetValueIsImportant(nsCSSProperty aProperty) const
|
||||
{
|
||||
if (!mImportantData)
|
||||
return PR_FALSE;
|
||||
@ -1209,8 +1210,8 @@ nsCSSDeclaration::GetValueIsImportant(nsCSSProperty aProperty) const
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
nsCSSDeclaration::AppendImportanceToString(PRBool aIsImportant,
|
||||
nsAString& aString)
|
||||
Declaration::AppendImportanceToString(PRBool aIsImportant,
|
||||
nsAString& aString)
|
||||
{
|
||||
if (aIsImportant) {
|
||||
aString.AppendLiteral(" ! important");
|
||||
@ -1218,9 +1219,9 @@ nsCSSDeclaration::AppendImportanceToString(PRBool aIsImportant,
|
||||
}
|
||||
|
||||
void
|
||||
nsCSSDeclaration::AppendPropertyAndValueToString(nsCSSProperty aProperty,
|
||||
nsAutoString& aValue,
|
||||
nsAString& aResult) const
|
||||
Declaration::AppendPropertyAndValueToString(nsCSSProperty aProperty,
|
||||
nsAutoString& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
NS_ASSERTION(0 <= aProperty && aProperty < eCSSProperty_COUNT,
|
||||
"property enum out of range");
|
||||
@ -1239,7 +1240,7 @@ nsCSSDeclaration::AppendPropertyAndValueToString(nsCSSProperty aProperty,
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsCSSDeclaration::ToString(nsAString& aString) const
|
||||
Declaration::ToString(nsAString& aString) const
|
||||
{
|
||||
nsCSSCompressedDataBlock *systemFontData =
|
||||
GetValueIsImportant(eCSSProperty__x_system_font) ? mImportantData : mData;
|
||||
@ -1336,7 +1337,7 @@ nsCSSDeclaration::ToString(nsAString& aString) const
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void nsCSSDeclaration::List(FILE* out, PRInt32 aIndent) const
|
||||
void Declaration::List(FILE* out, PRInt32 aIndent) const
|
||||
{
|
||||
for (PRInt32 index = aIndent; --index >= 0; ) fputs(" ", out);
|
||||
|
||||
@ -1349,7 +1350,7 @@ void nsCSSDeclaration::List(FILE* out, PRInt32 aIndent) const
|
||||
#endif
|
||||
|
||||
nsresult
|
||||
nsCSSDeclaration::GetNthProperty(PRUint32 aIndex, nsAString& aReturn) const
|
||||
Declaration::GetNthProperty(PRUint32 aIndex, nsAString& aReturn) const
|
||||
{
|
||||
aReturn.Truncate();
|
||||
if (aIndex < mOrder.Length()) {
|
||||
@ -1358,18 +1359,18 @@ nsCSSDeclaration::GetNthProperty(PRUint32 aIndex, nsAString& aReturn) const
|
||||
AppendASCIItoUTF16(nsCSSProps::GetStringValue(property), aReturn);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCSSDeclaration*
|
||||
nsCSSDeclaration::Clone() const
|
||||
Declaration*
|
||||
Declaration::Clone() const
|
||||
{
|
||||
return new nsCSSDeclaration(*this);
|
||||
return new Declaration(*this);
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsCSSDeclaration::InitializeEmpty()
|
||||
Declaration::InitializeEmpty()
|
||||
{
|
||||
NS_ASSERTION(!mData && !mImportantData, "already initialized");
|
||||
mData = nsCSSCompressedDataBlock::CreateEmptyBlock();
|
||||
@ -1377,7 +1378,7 @@ nsCSSDeclaration::InitializeEmpty()
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsCSSDeclaration::EnsureMutable()
|
||||
Declaration::EnsureMutable()
|
||||
{
|
||||
if (!mData->IsMutable()) {
|
||||
nsRefPtr<nsCSSCompressedDataBlock> newBlock = mData->Clone();
|
||||
@ -1395,3 +1396,6 @@ nsCSSDeclaration::EnsureMutable()
|
||||
}
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
} // namespace mozilla::css
|
||||
} // namespace mozilla
|
||||
|
@ -55,16 +55,22 @@
|
||||
#include "nsCSSDataBlock.h"
|
||||
#include "nsCSSStruct.h"
|
||||
|
||||
class nsCSSDeclaration {
|
||||
// must be forward-declared in root namespace
|
||||
class CSSStyleRuleImpl;
|
||||
|
||||
namespace mozilla {
|
||||
namespace css {
|
||||
|
||||
class Declaration {
|
||||
public:
|
||||
/**
|
||||
* Construct an |nsCSSDeclaration| that is in an invalid state (null
|
||||
* Construct an |Declaration| that is in an invalid state (null
|
||||
* |mData|) and cannot be used until its |CompressFrom| method or
|
||||
* |InitializeEmpty| method is called.
|
||||
*/
|
||||
nsCSSDeclaration();
|
||||
Declaration();
|
||||
|
||||
nsCSSDeclaration(const nsCSSDeclaration& aCopy);
|
||||
Declaration(const Declaration& aCopy);
|
||||
|
||||
/**
|
||||
* |ValueAppended| must be called to maintain this declaration's
|
||||
@ -82,13 +88,13 @@ public:
|
||||
PRBool GetValueIsImportant(const nsAString& aProperty) const;
|
||||
|
||||
PRUint32 Count() const {
|
||||
return mOrder.Length();
|
||||
return mOrder.Length();
|
||||
}
|
||||
nsresult GetNthProperty(PRUint32 aIndex, nsAString& aReturn) const;
|
||||
|
||||
nsresult ToString(nsAString& aString) const;
|
||||
|
||||
nsCSSDeclaration* Clone() const;
|
||||
Declaration* Clone() const;
|
||||
|
||||
nsCSSCompressedDataBlock* GetNormalBlock() const { return mData; }
|
||||
nsCSSCompressedDataBlock* GetImportantBlock() const { return mImportantData; }
|
||||
@ -174,7 +180,7 @@ public:
|
||||
#ifdef DEBUG
|
||||
void List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
||||
#endif
|
||||
|
||||
|
||||
// return whether there was a value in |aValue| (i.e., it had a non-null unit)
|
||||
static PRBool AppendCSSValueToString(nsCSSProperty aProperty,
|
||||
const nsCSSValue& aValue,
|
||||
@ -187,8 +193,8 @@ public:
|
||||
|
||||
private:
|
||||
// Not implemented, and not supported.
|
||||
nsCSSDeclaration& operator=(const nsCSSDeclaration& aCopy);
|
||||
PRBool operator==(const nsCSSDeclaration& aCopy) const;
|
||||
Declaration& operator=(const Declaration& aCopy);
|
||||
PRBool operator==(const Declaration& aCopy) const;
|
||||
|
||||
static void AppendImportanceToString(PRBool aIsImportant, nsAString& aString);
|
||||
// return whether there was a value in |aValue| (i.e., it had a non-null unit)
|
||||
@ -204,11 +210,11 @@ private:
|
||||
// We do not want everyone to ref count us, only the rules which hold
|
||||
// onto us (our well defined lifetime is when the last rule releases
|
||||
// us).
|
||||
// It's worth a comment here that the main nsCSSDeclaration is refcounted,
|
||||
// but it's |mImportant| is not refcounted, but just owned by the
|
||||
// non-important declaration.
|
||||
// It's worth a comment here that the main css::Declaration is
|
||||
// refcounted, but its |mImportant| is not refcounted, just owned
|
||||
// by the non-important declaration.
|
||||
//
|
||||
friend class CSSStyleRuleImpl;
|
||||
friend class ::CSSStyleRuleImpl;
|
||||
void AddRef(void) {
|
||||
if (mRefCnt == PR_UINT32_MAX) {
|
||||
NS_WARNING("refcount overflow, leaking object");
|
||||
@ -233,8 +239,8 @@ public:
|
||||
}
|
||||
private:
|
||||
// Block everyone, except us or a derivative, from deleting us.
|
||||
~nsCSSDeclaration(void);
|
||||
|
||||
~Declaration();
|
||||
|
||||
nsCSSProperty OrderValueAt(PRUint32 aValue) const {
|
||||
return nsCSSProperty(mOrder.ElementAt(aValue));
|
||||
}
|
||||
@ -250,4 +256,7 @@ private:
|
||||
nsRefPtr<nsCSSCompressedDataBlock> mImportantData;
|
||||
};
|
||||
|
||||
} // namespace mozilla::css
|
||||
} // namespace mozilla
|
||||
|
||||
#endif /* nsCSSDeclaration_h___ */
|
||||
|
@ -90,6 +90,8 @@
|
||||
#include "CSSCalc.h"
|
||||
#include "nsMediaFeatures.h"
|
||||
|
||||
namespace css = mozilla::css;
|
||||
|
||||
// Flags for ParseVariant method
|
||||
#define VARIANT_KEYWORD 0x000001 // K
|
||||
#define VARIANT_LENGTH 0x000002 // L
|
||||
@ -204,7 +206,7 @@ public:
|
||||
nsIURI* aSheetURL,
|
||||
nsIURI* aBaseURL,
|
||||
nsIPrincipal* aSheetPrincipal,
|
||||
nsCSSDeclaration* aDeclaration,
|
||||
css::Declaration* aDeclaration,
|
||||
PRBool aParseOnlyOneDecl,
|
||||
PRBool* aChanged,
|
||||
PRBool aClearOldDecl);
|
||||
@ -220,7 +222,7 @@ public:
|
||||
nsIURI* aSheetURL,
|
||||
nsIURI* aBaseURL,
|
||||
nsIPrincipal* aSheetPrincipal,
|
||||
nsCSSDeclaration* aDeclaration,
|
||||
css::Declaration* aDeclaration,
|
||||
PRBool* aChanged,
|
||||
PRBool aIsImportant);
|
||||
|
||||
@ -400,8 +402,8 @@ protected:
|
||||
PRBool ParseSelectorGroup(nsCSSSelectorList*& aListHead);
|
||||
PRBool ParseSelector(nsCSSSelectorList* aList, PRUnichar aPrevCombinator);
|
||||
|
||||
nsCSSDeclaration* ParseDeclarationBlock(PRBool aCheckForBraces);
|
||||
PRBool ParseDeclaration(nsCSSDeclaration* aDeclaration,
|
||||
css::Declaration* ParseDeclarationBlock(PRBool aCheckForBraces);
|
||||
PRBool ParseDeclaration(css::Declaration* aDeclaration,
|
||||
PRBool aCheckForBraces,
|
||||
PRBool aMustCallValueAppended,
|
||||
PRBool* aChanged);
|
||||
@ -415,13 +417,13 @@ protected:
|
||||
// is already set in it. If aOverrideImportant is true, new data will
|
||||
// replace old settings of the same properties, even if the old settings
|
||||
// are !important and the new data aren't.
|
||||
void TransferTempData(nsCSSDeclaration* aDeclaration,
|
||||
void TransferTempData(css::Declaration* aDeclaration,
|
||||
nsCSSProperty aPropID,
|
||||
PRBool aIsImportant,
|
||||
PRBool aOverrideImportant,
|
||||
PRBool aMustCallValueAppended,
|
||||
PRBool* aChanged);
|
||||
void DoTransferTempData(nsCSSDeclaration* aDeclaration,
|
||||
void DoTransferTempData(css::Declaration* aDeclaration,
|
||||
nsCSSProperty aPropID,
|
||||
PRBool aIsImportant,
|
||||
PRBool aOverrideImportant,
|
||||
@ -1003,7 +1005,7 @@ CSSParserImpl::ParseStyleAttribute(const nsAString& aAttributeValue,
|
||||
haveBraces = PR_FALSE;
|
||||
}
|
||||
|
||||
nsCSSDeclaration* declaration = ParseDeclarationBlock(haveBraces);
|
||||
css::Declaration* declaration = ParseDeclarationBlock(haveBraces);
|
||||
if (declaration) {
|
||||
// Create a style rule for the declaration
|
||||
nsICSSStyleRule* rule = nsnull;
|
||||
@ -1030,7 +1032,7 @@ CSSParserImpl::ParseAndAppendDeclaration(const nsAString& aBuffer,
|
||||
nsIURI* aSheetURI,
|
||||
nsIURI* aBaseURI,
|
||||
nsIPrincipal* aSheetPrincipal,
|
||||
nsCSSDeclaration* aDeclaration,
|
||||
css::Declaration* aDeclaration,
|
||||
PRBool aParseOnlyOneDecl,
|
||||
PRBool* aChanged,
|
||||
PRBool aClearOldDecl)
|
||||
@ -1114,7 +1116,7 @@ CSSParserImpl::ParseProperty(const nsCSSProperty aPropID,
|
||||
nsIURI* aSheetURI,
|
||||
nsIURI* aBaseURI,
|
||||
nsIPrincipal* aSheetPrincipal,
|
||||
nsCSSDeclaration* aDeclaration,
|
||||
css::Declaration* aDeclaration,
|
||||
PRBool* aChanged,
|
||||
PRBool aIsImportant)
|
||||
{
|
||||
@ -2426,7 +2428,7 @@ CSSParserImpl::ParseRuleSet(RuleAppendFunc aAppendFunc, void* aData,
|
||||
CLEAR_ERROR();
|
||||
|
||||
// Next parse the declaration block
|
||||
nsCSSDeclaration* declaration = ParseDeclarationBlock(PR_TRUE);
|
||||
css::Declaration* declaration = ParseDeclarationBlock(PR_TRUE);
|
||||
if (nsnull == declaration) {
|
||||
// XXX skip something here
|
||||
delete slist;
|
||||
@ -3547,7 +3549,7 @@ CSSParserImpl::ParseSelector(nsCSSSelectorList* aList,
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
nsCSSDeclaration*
|
||||
css::Declaration*
|
||||
CSSParserImpl::ParseDeclarationBlock(PRBool aCheckForBraces)
|
||||
{
|
||||
if (aCheckForBraces) {
|
||||
@ -3557,7 +3559,7 @@ CSSParserImpl::ParseDeclarationBlock(PRBool aCheckForBraces)
|
||||
return nsnull;
|
||||
}
|
||||
}
|
||||
nsCSSDeclaration* declaration = new nsCSSDeclaration();
|
||||
css::Declaration* declaration = new css::Declaration();
|
||||
mData.AssertInitialState();
|
||||
if (declaration) {
|
||||
for (;;) {
|
||||
@ -3949,7 +3951,7 @@ CSSParserImpl::ParseTreePseudoElement(nsPseudoClassList **aPseudoElementArgs)
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
PRBool
|
||||
CSSParserImpl::ParseDeclaration(nsCSSDeclaration* aDeclaration,
|
||||
CSSParserImpl::ParseDeclaration(css::Declaration* aDeclaration,
|
||||
PRBool aCheckForBraces,
|
||||
PRBool aMustCallValueAppended,
|
||||
PRBool* aChanged)
|
||||
@ -4099,7 +4101,7 @@ CSSParserImpl::ClearTempData(nsCSSProperty aPropID)
|
||||
}
|
||||
|
||||
void
|
||||
CSSParserImpl::TransferTempData(nsCSSDeclaration* aDeclaration,
|
||||
CSSParserImpl::TransferTempData(css::Declaration* aDeclaration,
|
||||
nsCSSProperty aPropID,
|
||||
PRBool aIsImportant,
|
||||
PRBool aOverrideImportant,
|
||||
@ -4122,7 +4124,7 @@ CSSParserImpl::TransferTempData(nsCSSDeclaration* aDeclaration,
|
||||
// case some other caller wants to use it in the future (although I
|
||||
// can't think of why).
|
||||
void
|
||||
CSSParserImpl::DoTransferTempData(nsCSSDeclaration* aDeclaration,
|
||||
CSSParserImpl::DoTransferTempData(css::Declaration* aDeclaration,
|
||||
nsCSSProperty aPropID,
|
||||
PRBool aIsImportant,
|
||||
PRBool aOverrideImportant,
|
||||
@ -9657,7 +9659,7 @@ nsCSSParser::ParseAndAppendDeclaration(const nsAString& aBuffer,
|
||||
nsIURI* aSheetURI,
|
||||
nsIURI* aBaseURI,
|
||||
nsIPrincipal* aSheetPrincipal,
|
||||
nsCSSDeclaration* aDeclaration,
|
||||
css::Declaration* aDeclaration,
|
||||
PRBool aParseOnlyOneDecl,
|
||||
PRBool* aChanged,
|
||||
PRBool aClearOldDecl)
|
||||
@ -9685,7 +9687,7 @@ nsCSSParser::ParseProperty(const nsCSSProperty aPropID,
|
||||
nsIURI* aSheetURI,
|
||||
nsIURI* aBaseURI,
|
||||
nsIPrincipal* aSheetPrincipal,
|
||||
nsCSSDeclaration* aDeclaration,
|
||||
css::Declaration* aDeclaration,
|
||||
PRBool* aChanged,
|
||||
PRBool aIsImportant)
|
||||
{
|
||||
|
@ -51,13 +51,13 @@ class nsCSSStyleSheet;
|
||||
class nsIPrincipal;
|
||||
class nsIURI;
|
||||
class nsIUnicharInputStream;
|
||||
class nsCSSDeclaration;
|
||||
struct nsCSSSelectorList;
|
||||
class nsMediaList;
|
||||
|
||||
namespace mozilla {
|
||||
namespace css {
|
||||
class Loader;
|
||||
class Declaration;
|
||||
class Loader;
|
||||
}
|
||||
}
|
||||
|
||||
@ -134,7 +134,7 @@ public:
|
||||
nsIURI* aSheetURL,
|
||||
nsIURI* aBaseURL,
|
||||
nsIPrincipal* aSheetPrincipal,
|
||||
nsCSSDeclaration* aDeclaration,
|
||||
mozilla::css::Declaration* aDeclaration,
|
||||
PRBool aParseOnlyOneDecl,
|
||||
PRBool* aChanged,
|
||||
PRBool aClearOldDecl);
|
||||
@ -150,7 +150,7 @@ public:
|
||||
nsIURI* aSheetURL,
|
||||
nsIURI* aBaseURL,
|
||||
nsIPrincipal* aSheetPrincipal,
|
||||
nsCSSDeclaration* aDeclaration,
|
||||
mozilla::css::Declaration* aDeclaration,
|
||||
PRBool* aChanged,
|
||||
PRBool aIsImportant);
|
||||
|
||||
|
@ -74,7 +74,7 @@
|
||||
struct.
|
||||
|
||||
7. 'type' gives the |nsCSSType| of the data in the nsRuleData struct
|
||||
and in the nsCSSDeclaration backend.
|
||||
and in the css::Declaration backend.
|
||||
|
||||
8. 'kwtable', which is either nsnull or the name of the appropriate
|
||||
keyword table member of class nsCSSProps, for use in
|
||||
|
@ -73,6 +73,8 @@
|
||||
#include "nsCSSDeclaration.h"
|
||||
#include "nsPrintfCString.h"
|
||||
|
||||
namespace css = mozilla::css;
|
||||
|
||||
#define IMPL_STYLE_RULE_INHERIT(_class, super) \
|
||||
/* virtual */ already_AddRefed<nsIStyleSheet> _class::GetStyleSheet() const { return super::GetStyleSheet(); } \
|
||||
/* virtual */ void _class::SetStyleSheet(nsCSSStyleSheet* aSheet) { super::SetStyleSheet(aSheet); } \
|
||||
@ -1622,17 +1624,17 @@ nsCSSFontFaceStyleDecl::GetPropertyValue(nsCSSFontDesc aFontDescID,
|
||||
}
|
||||
|
||||
case eCSSFontDesc_Style:
|
||||
nsCSSDeclaration::AppendCSSValueToString(eCSSProperty_font_style, val,
|
||||
css::Declaration::AppendCSSValueToString(eCSSProperty_font_style, val,
|
||||
aResult);
|
||||
return NS_OK;
|
||||
|
||||
case eCSSFontDesc_Weight:
|
||||
nsCSSDeclaration::AppendCSSValueToString(eCSSProperty_font_weight, val,
|
||||
css::Declaration::AppendCSSValueToString(eCSSProperty_font_weight, val,
|
||||
aResult);
|
||||
return NS_OK;
|
||||
|
||||
case eCSSFontDesc_Stretch:
|
||||
nsCSSDeclaration::AppendCSSValueToString(eCSSProperty_font_stretch, val,
|
||||
css::Declaration::AppendCSSValueToString(eCSSProperty_font_stretch, val,
|
||||
aResult);
|
||||
return NS_OK;
|
||||
|
||||
|
@ -260,7 +260,7 @@ struct nsCSSStruct {
|
||||
// EMPTY on purpose. ABSTRACT with no virtuals (typedef void nsCSSStruct?)
|
||||
};
|
||||
|
||||
// We use the nsCSS* structures for storing nsCSSDeclaration's
|
||||
// We use the nsCSS* structures for storing css::Declaration's
|
||||
// *temporary* data during parsing and modification. (They are too big
|
||||
// for permanent storage.) We also use them for nsRuleData, with some
|
||||
// additions of things that the style system must cascade, but that
|
||||
|
@ -82,6 +82,8 @@
|
||||
|
||||
#include "prlog.h"
|
||||
|
||||
namespace css = mozilla::css;
|
||||
|
||||
#define NS_IF_CLONE(member_) \
|
||||
PR_BEGIN_MACRO \
|
||||
if (member_) { \
|
||||
@ -957,7 +959,7 @@ public:
|
||||
|
||||
NS_IMETHOD GetParentRule(nsIDOMCSSRule **aParent);
|
||||
void DropReference(void);
|
||||
virtual nsresult GetCSSDeclaration(nsCSSDeclaration **aDecl,
|
||||
virtual nsresult GetCSSDeclaration(css::Declaration **aDecl,
|
||||
PRBool aAllocate);
|
||||
virtual nsresult GetCSSParsingEnvironment(nsIURI** aSheetURI,
|
||||
nsIURI** aBaseURI,
|
||||
@ -1047,7 +1049,7 @@ DOMCSSDeclarationImpl::DropReference(void)
|
||||
}
|
||||
|
||||
nsresult
|
||||
DOMCSSDeclarationImpl::GetCSSDeclaration(nsCSSDeclaration **aDecl,
|
||||
DOMCSSDeclarationImpl::GetCSSDeclaration(css::Declaration **aDecl,
|
||||
PRBool aAllocate)
|
||||
{
|
||||
if (mRule) {
|
||||
@ -1275,13 +1277,13 @@ class CSSStyleRuleImpl : public nsCSSRule,
|
||||
{
|
||||
public:
|
||||
CSSStyleRuleImpl(nsCSSSelectorList* aSelector,
|
||||
nsCSSDeclaration *aDeclaration);
|
||||
css::Declaration *aDeclaration);
|
||||
private:
|
||||
// for |Clone|
|
||||
CSSStyleRuleImpl(const CSSStyleRuleImpl& aCopy);
|
||||
// for |DeclarationChanged|
|
||||
CSSStyleRuleImpl(CSSStyleRuleImpl& aCopy,
|
||||
nsCSSDeclaration *aDeclaration);
|
||||
css::Declaration *aDeclaration);
|
||||
public:
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
@ -1291,7 +1293,7 @@ public:
|
||||
virtual PRUint32 GetLineNumber(void) const;
|
||||
virtual void SetLineNumber(PRUint32 aLineNumber);
|
||||
|
||||
virtual nsCSSDeclaration* GetDeclaration(void) const;
|
||||
virtual css::Declaration* GetDeclaration(void) const;
|
||||
|
||||
virtual nsIStyleRule* GetImportantRule(void);
|
||||
virtual void RuleMatched();
|
||||
@ -1332,18 +1334,18 @@ protected:
|
||||
|
||||
protected:
|
||||
nsCSSSelectorList* mSelector; // null for style attribute
|
||||
nsCSSDeclaration* mDeclaration;
|
||||
css::Declaration* mDeclaration;
|
||||
nsRefPtr<nsCSSCompressedDataBlock> mNormalBlock;
|
||||
CSSImportantRule* mImportantRule;
|
||||
DOMCSSStyleRuleImpl* mDOMRule;
|
||||
DOMCSSStyleRuleImpl* mDOMRule;
|
||||
PRUint32 mLineNumber;
|
||||
};
|
||||
|
||||
CSSStyleRuleImpl::CSSStyleRuleImpl(nsCSSSelectorList* aSelector,
|
||||
nsCSSDeclaration* aDeclaration)
|
||||
css::Declaration* aDeclaration)
|
||||
: nsCSSRule(),
|
||||
mSelector(aSelector),
|
||||
mDeclaration(aDeclaration),
|
||||
mDeclaration(aDeclaration),
|
||||
mImportantRule(nsnull),
|
||||
mDOMRule(nsnull),
|
||||
mLineNumber(0)
|
||||
@ -1367,7 +1369,7 @@ CSSStyleRuleImpl::CSSStyleRuleImpl(const CSSStyleRuleImpl& aCopy)
|
||||
|
||||
// for |DeclarationChanged|
|
||||
CSSStyleRuleImpl::CSSStyleRuleImpl(CSSStyleRuleImpl& aCopy,
|
||||
nsCSSDeclaration* aDeclaration)
|
||||
css::Declaration* aDeclaration)
|
||||
: nsCSSRule(aCopy),
|
||||
mSelector(aCopy.mSelector),
|
||||
mDeclaration(aDeclaration),
|
||||
@ -1441,7 +1443,7 @@ void CSSStyleRuleImpl::SetLineNumber(PRUint32 aLineNumber)
|
||||
mLineNumber = aLineNumber;
|
||||
}
|
||||
|
||||
nsCSSDeclaration* CSSStyleRuleImpl::GetDeclaration(void) const
|
||||
css::Declaration* CSSStyleRuleImpl::GetDeclaration(void) const
|
||||
{
|
||||
return mDeclaration;
|
||||
}
|
||||
@ -1644,7 +1646,7 @@ CSSStyleRuleImpl::SetSelectorText(const nsAString& aSelectorText)
|
||||
nsresult
|
||||
NS_NewCSSStyleRule(nsICSSStyleRule** aInstancePtrResult,
|
||||
nsCSSSelectorList* aSelector,
|
||||
nsCSSDeclaration* aDeclaration)
|
||||
css::Declaration* aDeclaration)
|
||||
{
|
||||
NS_PRECONDITION(aDeclaration, "must have a declaration");
|
||||
CSSStyleRuleImpl *it = new CSSStyleRuleImpl(aSelector, aDeclaration);
|
||||
|
@ -412,7 +412,7 @@ nsMediaQuery::AppendToString(nsAString& aString) const
|
||||
NS_ASSERTION(expr.mValue.IsLengthUnit(), "bad unit");
|
||||
// Use 'width' as a property that takes length values
|
||||
// written in the normal way.
|
||||
nsCSSDeclaration::AppendCSSValueToString(eCSSProperty_width,
|
||||
css::Declaration::AppendCSSValueToString(eCSSProperty_width,
|
||||
expr.mValue, aString);
|
||||
break;
|
||||
case nsMediaFeature::eInteger:
|
||||
@ -421,7 +421,7 @@ nsMediaQuery::AppendToString(nsAString& aString) const
|
||||
"bad unit");
|
||||
// Use 'z-index' as a property that takes integer values
|
||||
// written without anything extra.
|
||||
nsCSSDeclaration::AppendCSSValueToString(eCSSProperty_z_index,
|
||||
css::Declaration::AppendCSSValueToString(eCSSProperty_z_index,
|
||||
expr.mValue, aString);
|
||||
break;
|
||||
case nsMediaFeature::eIntRatio:
|
||||
@ -434,10 +434,10 @@ nsMediaQuery::AppendToString(nsAString& aString) const
|
||||
"bad unit");
|
||||
NS_ASSERTION(array->Item(1).GetUnit() == eCSSUnit_Integer,
|
||||
"bad unit");
|
||||
nsCSSDeclaration::AppendCSSValueToString(eCSSProperty_z_index,
|
||||
css::Declaration::AppendCSSValueToString(eCSSProperty_z_index,
|
||||
array->Item(0), aString);
|
||||
aString.AppendLiteral("/");
|
||||
nsCSSDeclaration::AppendCSSValueToString(eCSSProperty_z_index,
|
||||
css::Declaration::AppendCSSValueToString(eCSSProperty_z_index,
|
||||
array->Item(1), aString);
|
||||
}
|
||||
break;
|
||||
|
@ -411,7 +411,7 @@ nsComputedDOMStyle::GetPresShellForContent(nsIContent* aContent)
|
||||
// on a nsComputedDOMStyle object, but must be defined to avoid
|
||||
// compile errors.
|
||||
nsresult
|
||||
nsComputedDOMStyle::GetCSSDeclaration(nsCSSDeclaration**, PRBool)
|
||||
nsComputedDOMStyle::GetCSSDeclaration(css::Declaration**, PRBool)
|
||||
{
|
||||
NS_RUNTIMEABORT("called nsComputedDOMStyle::GetCSSDeclaration");
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -104,7 +104,7 @@ public:
|
||||
// nsDOMCSSDeclaration abstract methods which should never be called
|
||||
// on a nsComputedDOMStyle object, but must be defined to avoid
|
||||
// compile errors.
|
||||
virtual nsresult GetCSSDeclaration(nsCSSDeclaration**, PRBool);
|
||||
virtual nsresult GetCSSDeclaration(mozilla::css::Declaration**, PRBool);
|
||||
virtual nsresult DeclarationChanged();
|
||||
virtual nsIDocument* DocToUpdate();
|
||||
virtual nsresult GetCSSParsingEnvironment(nsIURI**, nsIURI**, nsIPrincipal**,
|
||||
|
@ -51,6 +51,8 @@
|
||||
#include "nsIPrincipal.h"
|
||||
#include "nsNodeUtils.h"
|
||||
|
||||
namespace css = mozilla::css;
|
||||
|
||||
nsDOMCSSAttributeDeclaration::nsDOMCSSAttributeDeclaration(nsIContent *aContent
|
||||
#ifdef MOZ_SMIL
|
||||
, PRBool aIsSMILOverride
|
||||
@ -127,7 +129,7 @@ nsDOMCSSAttributeDeclaration::DocToUpdate()
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsDOMCSSAttributeDeclaration::GetCSSDeclaration(nsCSSDeclaration **aDecl,
|
||||
nsDOMCSSAttributeDeclaration::GetCSSDeclaration(css::Declaration **aDecl,
|
||||
PRBool aAllocate)
|
||||
{
|
||||
nsresult result = NS_OK;
|
||||
@ -143,21 +145,21 @@ nsDOMCSSAttributeDeclaration::GetCSSDeclaration(nsCSSDeclaration **aDecl,
|
||||
*aDecl = cssRule->GetDeclaration();
|
||||
}
|
||||
else if (aAllocate) {
|
||||
nsCSSDeclaration *decl = new nsCSSDeclaration();
|
||||
css::Declaration *decl = new css::Declaration();
|
||||
if (!decl)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
if (!decl->InitializeEmpty()) {
|
||||
decl->RuleAbort();
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
|
||||
nsCOMPtr<nsICSSStyleRule> newRule;
|
||||
result = NS_NewCSSStyleRule(getter_AddRefs(newRule), nsnull, decl);
|
||||
if (NS_FAILED(result)) {
|
||||
decl->RuleAbort();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
result =
|
||||
#ifdef MOZ_SMIL
|
||||
mIsSMILOverride ?
|
||||
|
@ -69,7 +69,7 @@ public:
|
||||
|
||||
// If GetCSSDeclaration returns non-null, then the decl it returns
|
||||
// is owned by our current style rule.
|
||||
virtual nsresult GetCSSDeclaration(nsCSSDeclaration **aDecl,
|
||||
virtual nsresult GetCSSDeclaration(mozilla::css::Declaration **aDecl,
|
||||
PRBool aAllocate);
|
||||
virtual nsresult GetCSSParsingEnvironment(nsIURI** aSheetURI,
|
||||
nsIURI** aBaseURI,
|
||||
|
@ -78,8 +78,8 @@ nsDOMCSSDeclaration::GetPropertyValue(const nsCSSProperty aPropID,
|
||||
{
|
||||
NS_PRECONDITION(aPropID != eCSSProperty_UNKNOWN,
|
||||
"Should never pass eCSSProperty_UNKNOWN around");
|
||||
|
||||
nsCSSDeclaration *decl;
|
||||
|
||||
css::Declaration* decl;
|
||||
nsresult result = GetCSSDeclaration(&decl, PR_FALSE);
|
||||
|
||||
aValue.Truncate();
|
||||
@ -107,7 +107,7 @@ nsDOMCSSDeclaration::SetPropertyValue(const nsCSSProperty aPropID,
|
||||
NS_IMETHODIMP
|
||||
nsDOMCSSDeclaration::GetCssText(nsAString& aCssText)
|
||||
{
|
||||
nsCSSDeclaration* decl;
|
||||
css::Declaration* decl;
|
||||
aCssText.Truncate();
|
||||
GetCSSDeclaration(&decl, PR_FALSE);
|
||||
|
||||
@ -127,9 +127,9 @@ nsDOMCSSDeclaration::SetCssText(const nsAString& aCssText)
|
||||
NS_IMETHODIMP
|
||||
nsDOMCSSDeclaration::GetLength(PRUint32* aLength)
|
||||
{
|
||||
nsCSSDeclaration *decl;
|
||||
css::Declaration* decl;
|
||||
nsresult result = GetCSSDeclaration(&decl, PR_FALSE);
|
||||
|
||||
|
||||
if (decl) {
|
||||
*aLength = decl->Count();
|
||||
} else {
|
||||
@ -154,7 +154,7 @@ nsDOMCSSDeclaration::GetPropertyCSSValue(const nsAString& aPropertyName,
|
||||
NS_IMETHODIMP
|
||||
nsDOMCSSDeclaration::Item(PRUint32 aIndex, nsAString& aReturn)
|
||||
{
|
||||
nsCSSDeclaration *decl;
|
||||
css::Declaration* decl;
|
||||
nsresult result = GetCSSDeclaration(&decl, PR_FALSE);
|
||||
|
||||
aReturn.SetLength(0);
|
||||
@ -182,7 +182,7 @@ NS_IMETHODIMP
|
||||
nsDOMCSSDeclaration::GetPropertyPriority(const nsAString& aPropertyName,
|
||||
nsAString& aReturn)
|
||||
{
|
||||
nsCSSDeclaration *decl;
|
||||
css::Declaration* decl;
|
||||
nsresult result = GetCSSDeclaration(&decl, PR_FALSE);
|
||||
|
||||
aReturn.Truncate();
|
||||
@ -245,7 +245,7 @@ nsDOMCSSDeclaration::ParsePropertyValue(const nsCSSProperty aPropID,
|
||||
const nsAString& aPropValue,
|
||||
PRBool aIsImportant)
|
||||
{
|
||||
nsCSSDeclaration* decl;
|
||||
css::Declaration* decl;
|
||||
nsresult result = GetCSSDeclaration(&decl, PR_TRUE);
|
||||
if (!decl) {
|
||||
return result;
|
||||
@ -287,7 +287,7 @@ nsDOMCSSDeclaration::ParseDeclaration(const nsAString& aDecl,
|
||||
PRBool aParseOnlyOneDecl,
|
||||
PRBool aClearOldDecl)
|
||||
{
|
||||
nsCSSDeclaration* decl;
|
||||
css::Declaration* decl;
|
||||
nsresult result = GetCSSDeclaration(&decl, PR_TRUE);
|
||||
if (!decl) {
|
||||
return result;
|
||||
@ -331,7 +331,7 @@ nsDOMCSSDeclaration::ParseDeclaration(const nsAString& aDecl,
|
||||
nsresult
|
||||
nsDOMCSSDeclaration::RemoveProperty(const nsCSSProperty aPropID)
|
||||
{
|
||||
nsCSSDeclaration* decl;
|
||||
css::Declaration* decl;
|
||||
nsresult rv = GetCSSDeclaration(&decl, PR_FALSE);
|
||||
if (!decl) {
|
||||
return rv;
|
||||
|
@ -44,7 +44,6 @@
|
||||
#include "nsIDOMNSCSS2Properties.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
class nsCSSDeclaration;
|
||||
class nsCSSParser;
|
||||
class nsIURI;
|
||||
class nsIPrincipal;
|
||||
@ -52,6 +51,7 @@ class nsIDocument;
|
||||
|
||||
namespace mozilla {
|
||||
namespace css {
|
||||
class Declaration;
|
||||
class Loader;
|
||||
}
|
||||
}
|
||||
@ -94,7 +94,7 @@ protected:
|
||||
// Always fills in the out parameter, even on failure, and if the out
|
||||
// parameter is null the nsresult will be the correct thing to
|
||||
// propagate.
|
||||
virtual nsresult GetCSSDeclaration(nsCSSDeclaration **aDecl,
|
||||
virtual nsresult GetCSSDeclaration(mozilla::css::Declaration **aDecl,
|
||||
PRBool aAllocate) = 0;
|
||||
virtual nsresult DeclarationChanged() = 0;
|
||||
// Document that we must call BeginUpdate/EndUpdate on around the
|
||||
|
@ -54,10 +54,15 @@
|
||||
#include "nsCSSPseudoClasses.h"
|
||||
|
||||
class nsIAtom;
|
||||
class nsCSSDeclaration;
|
||||
class nsCSSStyleSheet;
|
||||
struct nsCSSSelectorList;
|
||||
|
||||
namespace mozilla {
|
||||
namespace css {
|
||||
class Declaration;
|
||||
}
|
||||
}
|
||||
|
||||
struct nsAtomList {
|
||||
public:
|
||||
nsAtomList(nsIAtom* aAtom);
|
||||
@ -303,13 +308,13 @@ public:
|
||||
virtual PRUint32 GetLineNumber(void) const = 0;
|
||||
virtual void SetLineNumber(PRUint32 aLineNumber) = 0;
|
||||
|
||||
virtual nsCSSDeclaration* GetDeclaration(void) const = 0;
|
||||
virtual mozilla::css::Declaration* GetDeclaration(void) const = 0;
|
||||
|
||||
/**
|
||||
* Return a new |nsIStyleRule| instance that replaces the current one,
|
||||
* due to a change in the |nsCSSDeclaration|. Due to the
|
||||
* |nsIStyleRule| contract of immutability, this must be called if the
|
||||
* declaration is modified.
|
||||
* due to a change in the declaration. Due to the |nsIStyleRule|
|
||||
* contract of immutability, this must be called if the declaration
|
||||
* is modified.
|
||||
*
|
||||
* |DeclarationChanged| handles replacing the object in the container
|
||||
* sheet or group rule if |aHandleContainer| is true.
|
||||
@ -337,6 +342,6 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsICSSStyleRule, NS_ICSS_STYLE_RULE_IID)
|
||||
nsresult
|
||||
NS_NewCSSStyleRule(nsICSSStyleRule** aInstancePtrResult,
|
||||
nsCSSSelectorList* aSelector,
|
||||
nsCSSDeclaration* aDeclaration);
|
||||
mozilla::css::Declaration* aDeclaration);
|
||||
|
||||
#endif /* nsICSSStyleRule_h___ */
|
||||
|
@ -48,12 +48,13 @@
|
||||
#include "nsStyleSet.h"
|
||||
#include "nsComputedDOMStyle.h"
|
||||
#include "nsCSSParser.h"
|
||||
#include "nsCSSDataBlock.h"
|
||||
#include "nsCSSDeclaration.h"
|
||||
#include "nsCSSStruct.h"
|
||||
#include "prlog.h"
|
||||
#include <math.h>
|
||||
|
||||
namespace css = mozilla::css;
|
||||
|
||||
// HELPER METHODS
|
||||
// --------------
|
||||
/*
|
||||
@ -1608,11 +1609,7 @@ BuildStyleRule(nsCSSProperty aProperty,
|
||||
PRBool aUseSVGMode)
|
||||
{
|
||||
// Set up an empty CSS Declaration
|
||||
nsCSSDeclaration* declaration = new nsCSSDeclaration();
|
||||
if (!declaration) {
|
||||
NS_WARNING("Failed to allocate nsCSSDeclaration");
|
||||
return nsnull;
|
||||
}
|
||||
css::Declaration* declaration = new css::Declaration();
|
||||
|
||||
PRBool changed; // ignored, but needed as outparam for ParseProperty
|
||||
nsIDocument* doc = aTargetElement->GetOwnerDoc();
|
||||
@ -1902,7 +1899,7 @@ nsStyleAnimation::UncomputeValue(nsCSSProperty aProperty,
|
||||
aComputedValue, storage)) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
return nsCSSDeclaration::AppendStorageToString(aProperty, storage,
|
||||
return css::Declaration::AppendStorageToString(aProperty, storage,
|
||||
aSpecifiedValue);
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,6 @@
|
||||
#include "nsCoord.h"
|
||||
#include "nsColor.h"
|
||||
|
||||
class nsCSSDeclaration;
|
||||
class nsIContent;
|
||||
class nsPresContext;
|
||||
class nsStyleContext;
|
||||
|
Loading…
Reference in New Issue
Block a user