- All Superinterfaces:
- CSSStyleDeclaration
- All Known Implementing Classes:
- CSSOMComputedStyle,- CSSOMStoredStyleDeclaration,- CSSOMStyleDeclaration,- CSSOMSVGComputedStyle,- CSSOMSVGStyleDeclaration,- SVGStylableElement.OverrideStyleDeclaration,- SVGStylableElement.StyleDeclaration
CSS style declaration.
- 
Method SummaryModifier and TypeMethodDescriptiondefault CSSStyleValuegetCSSStyleValue(String propertyName) Gets the object representation of the value of a CSS property if it has been explicitly set for this declaration block.A parsable serialization of the declaration.intThe number of properties in this declaration.Retrieves the CSS rule that contains this declaration block.default CSSValuegetPropertyCSSValue(String propertyName) Gives the legacy object representation of the value of a CSS property if it has been explicitly set within this declaration block.getPropertyPriority(String propertyName) Get the priority that was set to the given property in this declaration.getPropertyValue(String propertyName) Gets the text value of a CSS property if it has been explicitly set within this declaration block.item(int index) The name of the property at indexindexin this declaration.removeProperty(String propertyName) Remove the given property from this declaration.voidsetCssText(String cssText) Parse the given text, and set the contents of this declaration according to it.voidsetProperty(String propertyName, String value, String priority) Set the value of a property in this declaration, with the given priority.
- 
Method Details- 
getCssTextString getCssText()A parsable serialization of the declaration.- Specified by:
- getCssTextin interface- CSSStyleDeclaration
- Returns:
- the textual representation of the declaration.
 
- 
setCssTextParse the given text, and set the contents of this declaration according to it.- Specified by:
- setCssTextin interface- CSSStyleDeclaration
- Parameters:
- cssText- the serialized style declaration.
- Throws:
- DOMException
 
- 
removePropertyRemove the given property from this declaration.- Specified by:
- removePropertyin interface- CSSStyleDeclaration
- Parameters:
- propertyName- the name of the property to remove.
- Returns:
- the value of the removed property, or the empty string if that property was not explicitly set in this declaration.
- Throws:
- DOMException
 
- 
getPropertyPriorityGet the priority that was set to the given property in this declaration.- Specified by:
- getPropertyPriorityin interface- CSSStyleDeclaration
- Parameters:
- propertyName- the name of the property.
- Returns:
- the priority string, or the empty string if no priority was set.
 
- 
setPropertySet the value of a property in this declaration, with the given priority.- Specified by:
- setPropertyin interface- CSSStyleDeclaration
- Parameters:
- propertyName- the name of the property.
- value- the property value.
- priority- the priority.
- Throws:
- DOMException
 
- 
getLengthint getLength()The number of properties in this declaration.- Specified by:
- getLengthin interface- CSSStyleDeclaration
- Returns:
- the number of properties in this declaration.
 
- 
itemThe name of the property at indexindexin this declaration.- Specified by:
- itemin interface- CSSStyleDeclaration
- Parameters:
- index- the index.
- Returns:
- the name of the property at the given index, or null if the index is less than zero, or greater or equal to the length of this declaration.
 
- 
getPropertyCSSValueGives the legacy object representation of the value of a CSS property if it has been explicitly set within this declaration block.This method returns nullif the property is a shorthand property. Shorthand property values can only be accessed and modified as strings, using thegetPropertyValueandsetPropertymethods.- Specified by:
- getPropertyCSSValuein interface- CSSStyleDeclaration
- Parameters:
- propertyName- The name of the CSS property.
- Returns:
- the value of the property if it has been explicitly set for this
         declaration block. Returns nullif the property has not been set, or the implementation does not support legacy object values.
 
- 
getCSSStyleValueGets the object representation of the value of a CSS property if it has been explicitly set for this declaration block.If the declaration was created by a factory with the IEVALUESflag enabled, the compatibility values shall appear in the cssText serializations, but its value won't be returned by this method unless no other valid value was previously specified for the property.- Parameters:
- propertyName- The name of the CSS property.
- Returns:
- the value of the property if it has been explicitly set for this
         declaration block. Returns nullif the property has not been set, is a shorthand or this implementation does not support it.
 
- 
getPropertyValueGets the text value of a CSS property if it has been explicitly set within this declaration block.If the declaration was created by a factory with the IEVALUESflag enabled, the compatibility values shall appear in the cssText serializations, but its value won't be returned by this method unless no other valid value was previously specified for the property.- Specified by:
- getPropertyValuein interface- CSSStyleDeclaration
- Parameters:
- propertyName- The name of the CSS property.
- Returns:
- the value of the property if it has been explicitly set for this declaration block, or the empty string if the property has not been set or is a shorthand that could not be serialized.
 
- 
getParentRuleCSSRule getParentRule()Retrieves the CSS rule that contains this declaration block.- Specified by:
- getParentRulein interface- CSSStyleDeclaration
- Returns:
- the CSS rule that contains this declaration block or nullif thisCSSStyleDeclarationis not attached to aCSSRule.
 
 
-