Public Member Functions

mozilla::css::Declaration Class Reference

#include <Declaration.h>

Collaboration diagram for mozilla::css::Declaration:

List of all members.

Public Member Functions

 Declaration ()
 Construct an |Declaration| that is in an invalid state (null |mData|) and cannot be used until its |CompressFrom| method or |InitializeEmpty| method is called.
 Declaration (const Declaration &aCopy)
 ~Declaration ()
void ValueAppended (nsCSSProperty aProperty)
 |ValueAppended| must be called to maintain this declaration's |mOrder| whenever a property is parsed into an expanded data block for this declaration.
void RemoveProperty (nsCSSProperty aProperty)
PRBool HasProperty (nsCSSProperty aProperty) const
void GetValue (nsCSSProperty aProperty, nsAString &aValue) const
PRBool HasImportantData () const
PRBool GetValueIsImportant (nsCSSProperty aProperty) const
PRBool GetValueIsImportant (const nsAString &aProperty) const
PRUint32 Count () const
void GetNthProperty (PRUint32 aIndex, nsAString &aReturn) const
void ToString (nsAString &aString) const
nsCSSCompressedDataBlock * GetNormalBlock () const
nsCSSCompressedDataBlock * GetImportantBlock () const
void InitializeEmpty ()
 Initialize this declaration as holding no data.
void CompressFrom (nsCSSExpandedDataBlock *aExpandedData)
 Transfer all of the state from |aExpandedData| into this declaration.
void ExpandTo (nsCSSExpandedDataBlock *aExpandedData)
 Transfer all of the state from this declaration into |aExpandedData| and put this declaration temporarily into an invalid state (ended by |CompressFrom| or |InitializeEmpty|) that should last only during parsing.
void MapNormalRuleInfoInto (nsRuleData *aRuleData) const
 Do what |nsIStyleRuleMapRuleInfoInto| needs to do for a style rule using this declaration for storage.
void MapImportantRuleInfoInto (nsRuleData *aRuleData) const
PRBool TryReplaceValue (nsCSSProperty aProperty, PRBool aIsImportant, nsCSSExpandedDataBlock &aFromBlock, PRBool *aChanged)
 Attempt to replace the value for |aProperty| stored in this declaration with the matching value from |aFromBlock|.
PRBool HasNonImportantValueFor (nsCSSProperty aProperty) const
bool IsMutable () const
 Return whether |this| may be modified.
DeclarationEnsureMutable ()
 Copy |this|, if necessary to ensure that it can be modified.
void AssertMutable () const
 Crash if |this| cannot be modified.
void SetImmutable () const
 Mark this declaration as unmodifiable.
void ClearData ()
 Clear the data, in preparation for its replacement with entirely new data by a call to |CompressFrom|.

Constructor & Destructor Documentation

mozilla::css::Declaration::Declaration (  ) 

Construct an |Declaration| that is in an invalid state (null |mData|) and cannot be used until its |CompressFrom| method or |InitializeEmpty| method is called.

mozilla::css::Declaration::Declaration ( const Declaration aCopy  ) 
mozilla::css::Declaration::~Declaration (  ) 

Member Function Documentation

void mozilla::css::Declaration::AssertMutable (  )  const [inline]

Crash if |this| cannot be modified.

void mozilla::css::Declaration::ClearData (  )  [inline]

Clear the data, in preparation for its replacement with entirely new data by a call to |CompressFrom|.

void mozilla::css::Declaration::CompressFrom ( nsCSSExpandedDataBlock *  aExpandedData  )  [inline]

Transfer all of the state from |aExpandedData| into this declaration.

After calling, |aExpandedData| should be in its initial state.

PRUint32 mozilla::css::Declaration::Count (  )  const [inline]
Declaration* mozilla::css::Declaration::EnsureMutable (  ) 

Copy |this|, if necessary to ensure that it can be modified.

void mozilla::css::Declaration::ExpandTo ( nsCSSExpandedDataBlock *  aExpandedData  )  [inline]

Transfer all of the state from this declaration into |aExpandedData| and put this declaration temporarily into an invalid state (ended by |CompressFrom| or |InitializeEmpty|) that should last only during parsing.

During this time only |ValueAppended| should be called.

nsCSSCompressedDataBlock* mozilla::css::Declaration::GetImportantBlock (  )  const [inline]
nsCSSCompressedDataBlock* mozilla::css::Declaration::GetNormalBlock (  )  const [inline]
void mozilla::css::Declaration::GetNthProperty ( PRUint32  aIndex,
nsAString aReturn 
) const
void mozilla::css::Declaration::GetValue ( nsCSSProperty  aProperty,
nsAString aValue 
) const
PRBool mozilla::css::Declaration::GetValueIsImportant ( nsCSSProperty  aProperty  )  const
PRBool mozilla::css::Declaration::GetValueIsImportant ( const nsAString aProperty  )  const
PRBool mozilla::css::Declaration::HasImportantData (  )  const [inline]
PRBool mozilla::css::Declaration::HasNonImportantValueFor ( nsCSSProperty  aProperty  )  const [inline]
PRBool mozilla::css::Declaration::HasProperty ( nsCSSProperty  aProperty  )  const
void mozilla::css::Declaration::InitializeEmpty (  ) 

Initialize this declaration as holding no data.

Cannot fail.

bool mozilla::css::Declaration::IsMutable (  )  const [inline]

Return whether |this| may be modified.

void mozilla::css::Declaration::MapImportantRuleInfoInto ( nsRuleData aRuleData  )  const [inline]
void mozilla::css::Declaration::MapNormalRuleInfoInto ( nsRuleData aRuleData  )  const [inline]

Do what |nsIStyleRuleMapRuleInfoInto| needs to do for a style rule using this declaration for storage.

void mozilla::css::Declaration::RemoveProperty ( nsCSSProperty  aProperty  ) 
void mozilla::css::Declaration::SetImmutable (  )  const [inline]

Mark this declaration as unmodifiable.

It's 'const' so it can be called from ToString.

void mozilla::css::Declaration::ToString ( nsAString aString  )  const
PRBool mozilla::css::Declaration::TryReplaceValue ( nsCSSProperty  aProperty,
PRBool  aIsImportant,
nsCSSExpandedDataBlock &  aFromBlock,
PRBool aChanged 
) [inline]

Attempt to replace the value for |aProperty| stored in this declaration with the matching value from |aFromBlock|.

This method may only be called on a mutable declaration. It will fail (returning PR_FALSE) if |aProperty| is shorthand, is not already in this declaration, or does not have the indicated importance level. If it returns PR_TRUE, it erases the value in |aFromBlock|. |aChanged| is set to PR_TRUE if the declaration changed as a result of the call, and to PR_FALSE otherwise.

void mozilla::css::Declaration::ValueAppended ( nsCSSProperty  aProperty  ) 

|ValueAppended| must be called to maintain this declaration's |mOrder| whenever a property is parsed into an expanded data block for this declaration.

aProperty must not be a shorthand.


The documentation for this class was generated from the following file: