C# Class SharpVectors.Dom.Css.CssStyleDeclaration

The CSSStyleDeclaration interface represents a single CSS declaration block. This interface may be used to determine the style properties currently set in a block or to set style properties explicitly within the block. While an implementation may not recognize all CSS properties within a CSS declaration block, it is expected to provide access to all specified properties in the style sheet through the CSSStyleDeclaration interface. Furthermore, implementations that support a specific level of CSS should correctly handle CSS shorthand properties for that level. For a further discussion of shorthand properties, see the CSS2Properties interface. This interface is also used to provide a read-only access to the computed values of an element. See also the ViewCSS interface. Note: The CSS Object Model doesn't provide an access to the specified or actual values of the CSS cascade
Inheritance: ICssStyleDeclaration
显示文件 Open project: codebutler/savagesvg Class Usage Examples

Public Methods

Method Description
CssStyleDeclaration ( string &css, CssRule parentRule, bool readOnly, CssStyleSheetType origin ) : System

The constructor for CssStyleDeclaration

GetPropertyCssValue ( string propertyName ) : ICssValue

Used to retrieve the object representation of the value of a CSS property if it has been explicitly set within this declaration block. This method returns null if the property is a shorthand property. Shorthand property values can only be accessed and modified as strings, using the getPropertyValue and setProperty methods.

GetPropertyPriority ( string propertyName ) : string

Used to retrieve the priority of a CSS property (e.g. the "important" qualifier) if the property has been explicitly set in this declaration block.

GetPropertyValue ( string propertyName ) : string

Used to retrieve the value of a CSS property if it has been explicitly set within this declaration block.

RemoveProperty ( string propertyName ) : string

Used to remove a CSS property if it has been explicitly set within this declaration block.

SetProperty ( string propertyName, string value, string priority ) : void

Used to set a property value and priority within this declaration block

this ( ulong index ) : string

Used to retrieve the properties that have been explicitly set in this declaration block. The order of the properties retrieved using this method does not have to be the order in which they were set. This method can be used to iterate over all properties in this declaration block. The name of the property at this ordinal position. The empty string if no property exists at this position.

Private Methods

Method Description
CssStyleDeclaration ( ) : System

The constructor used internally when collecting styles for a specified element

GetStylesForElement ( CssCollectedStyleDeclaration csd, int specificity ) : void

Used to find matching style rules in the cascading order

parseString ( string cssText ) : string

Method Details

CssStyleDeclaration() public method

The constructor for CssStyleDeclaration
public CssStyleDeclaration ( string &css, CssRule parentRule, bool readOnly, CssStyleSheetType origin ) : System
css string The string to parse for CSS
parentRule CssRule The parent rule or parent stylesheet
readOnly bool True if this instance is readonly
origin CssStyleSheetType The type of CssStyleSheet
return System

GetPropertyCssValue() public method

Used to retrieve the object representation of the value of a CSS property if it has been explicitly set within this declaration block. This method returns null if the property is a shorthand property. Shorthand property values can only be accessed and modified as strings, using the getPropertyValue and setProperty methods.
public GetPropertyCssValue ( string propertyName ) : ICssValue
propertyName string The name of the CSS property. See the CSS property index.
return ICssValue

GetPropertyPriority() public method

Used to retrieve the priority of a CSS property (e.g. the "important" qualifier) if the property has been explicitly set in this declaration block.
public GetPropertyPriority ( string propertyName ) : string
propertyName string The name of the CSS property. See the CSS property index.
return string

GetPropertyValue() public method

Used to retrieve the value of a CSS property if it has been explicitly set within this declaration block.
public GetPropertyValue ( string propertyName ) : string
propertyName string The name of the CSS property. See the CSS property index.
return string

RemoveProperty() public method

Used to remove a CSS property if it has been explicitly set within this declaration block.
NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration is readonly or the property is readonly.
public RemoveProperty ( string propertyName ) : string
propertyName string The name of the CSS property. See the CSS property index.
return string

SetProperty() public method

Used to set a property value and priority within this declaration block
SYNTAX_ERR: Raised if the specified value has a syntax error and is unparsable. NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration is readonly or the property is readonly.
public SetProperty ( string propertyName, string value, string priority ) : void
propertyName string The name of the CSS property. See the CSS property index.
value string The new value of the property.
priority string The new priority of the property (e.g. "important").
return void

this() public method

Used to retrieve the properties that have been explicitly set in this declaration block. The order of the properties retrieved using this method does not have to be the order in which they were set. This method can be used to iterate over all properties in this declaration block. The name of the property at this ordinal position. The empty string if no property exists at this position.
public this ( ulong index ) : string
index ulong
return string