- All Superinterfaces:
CSSStyleDeclaration
- All Known Subinterfaces:
CSSComputedProperties
,NodeStyleDeclaration
- All Known Implementing Classes:
AbstractCSSStyleDeclaration
,AnonymousStyleDeclaration
,BaseCSSStyleDeclaration
,CompatInlineStyle
,ComputedCSSStyle
,DOMComputedStyle
,InlineStyle
Extended CSS style declaration.
-
Method Summary
Modifier and TypeMethodDescriptionA minified parsable textual representation of the declaration.Retrieves the CSS rule that contains this declaration block.getPropertyCSSValue
(String propertyName) Gets the object representation of the value of a CSS property if it has been explicitly set for this declaration block.getPropertyValue
(String propertyName) Gets the text value of a CSS property if it has been explicitly set within this declaration block.void
writeCssText
(SimpleWriter wri, StyleFormattingContext context) Writes a textual representation of the declaration block (excluding the surrounding curly braces) to aSimpleWriter
, and according to aStyleFormattingContext
.Methods inherited from interface org.w3c.dom.css.CSSStyleDeclaration
getCssText, getLength, getPropertyPriority, item, removeProperty, setCssText, setProperty
-
Method Details
-
getPropertyCSSValue
Gets 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
IEVALUES
flag 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:
getPropertyCSSValue
in interfaceCSSStyleDeclaration
- 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
null
if the property has not been set or is a shorthand.
-
getPropertyValue
Gets 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
IEVALUES
flag 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:
getPropertyValue
in interfaceCSSStyleDeclaration
- 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.
-
getParentRule
CSSDeclarationRule getParentRule()Retrieves the CSS rule that contains this declaration block.- Specified by:
getParentRule
in interfaceCSSStyleDeclaration
- Returns:
- the CSS rule that contains this declaration block or
null
if thisCSSStyleDeclaration
is not attached to aCSSRule
.
-
getMinifiedCssText
String getMinifiedCssText()A minified parsable textual representation of the declaration. This reflects the current state of the declaration and not its initial value.- Returns:
- the minified textual representation of the declaration.
-
writeCssText
Writes a textual representation of the declaration block (excluding the surrounding curly braces) to aSimpleWriter
, and according to aStyleFormattingContext
.- Parameters:
wri
- the simple writer to write to.context
- the style formatting context.- Throws:
IOException
- if a problem occurs while writing the text.
-