public class ElementCssStyleDeclaration extends AbstractCssStyleDeclaration
DomElement.| Constructor and Description |
|---|
ElementCssStyleDeclaration(DomElement domElement)
Creates an instance which backed by the given dom element.
|
| Modifier and Type | Method and Description |
|---|---|
BrowserVersion |
getBrowserVersion() |
String |
getCssText()
Returns the actual text of the style.
|
DomElement |
getDomElement() |
int |
getLength()
Returns the
length property. |
org.htmlunit.cssparser.dom.AbstractCSSRuleImpl |
getParentRule()
Returns the CSSRule that is the parent of this style block or
null if this CSSStyleDeclaration is
not attached to a CSSRule. |
String |
getStyleAttribute(String name)
Get the value for the style attribute.
|
String |
getStyleAttribute(StyleAttributes.Definition definition,
boolean getDefaultValueIfEmpty)
Get the value for the style attribute.
|
StyleElement |
getStyleElement(String name)
Determines the StyleElement for the given name.
|
StyleElement |
getStyleElementCaseInSensitive(String name)
Determines the StyleElement for the given name.
|
Map<String,StyleElement> |
getStyleMap()
Returns a sorted map containing style elements, keyed on style element name.
|
String |
getStylePriority(String name)
Returns the priority of the named style attribute, or an empty string if it is not found.
|
boolean |
hasFeature(BrowserVersionFeatures property)
Indicates if the browser this is associated with has the feature.
|
String |
item(int index) |
String |
removeStyleAttribute(String name)
Removes the specified style attribute, returning the value of the removed attribute.
|
void |
setCssText(String value)
Sets the actual text of the style.
|
void |
setStyleAttribute(String name,
String newValue,
String important)
Sets the specified style attribute.
|
String |
toString() |
getBackgroundAttachment, getBackgroundColor, getBackgroundImage, getBackgroundPosition, getBackgroundRepeat, getBlockSize, getBorderBottomColor, getBorderBottomStyle, getBorderBottomWidth, getBorderLeftColor, getBorderLeftStyle, getBorderLeftWidth, getBorderRightColor, getBorderRightStyle, getBorderRightWidth, getBorderTop, getBorderTopColor, getBorderTopStyle, getBorderTopWidth, getBottom, getColor, getCssFloat, getDisplay, getFont, getFontFamily, getFontSize, getHeight, getLeft, getLetterSpacing, getLineHeight, getMargin, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpacity, getOrphans, getOutline, getOutlineWidth, getPadding, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getPosition, getRight, getRubyAlign, getSize, getStyleAttribute, getTextIndent, getTop, getVerticalAlign, getWidows, getWidth, getWordSpacing, getZIndex, isComputedpublic ElementCssStyleDeclaration(DomElement domElement)
domElement - the dom element this is based onpublic String getStylePriority(String name)
getStylePriority in class AbstractCssStyleDeclarationname - the name of the style attribute whose value is to be retrievedpublic String getCssText()
getCssText in class AbstractCssStyleDeclarationpublic String getStyleAttribute(String name)
getStyleAttribute in class AbstractCssStyleDeclarationname - the namepublic String getStyleAttribute(StyleAttributes.Definition definition, boolean getDefaultValueIfEmpty)
ComputedCssStyleDeclaration.getStyleAttribute in class AbstractCssStyleDeclarationdefinition - the definitiongetDefaultValueIfEmpty - whether to get the default value if empty or notpublic void setCssText(String value)
setCssText in class AbstractCssStyleDeclarationvalue - the new textpublic void setStyleAttribute(String name, String newValue, String important)
setStyleAttribute in class AbstractCssStyleDeclarationname - the attribute name (camel-cased)newValue - the attribute valueimportant - important valuepublic String removeStyleAttribute(String name)
removeStyleAttribute in class AbstractCssStyleDeclarationname - the attribute name (delimiter-separated, not camel-cased)public int getLength()
length property.getLength in class AbstractCssStyleDeclarationlength propertypublic String item(int index)
item in class AbstractCssStyleDeclarationindex - the indexpublic org.htmlunit.cssparser.dom.AbstractCSSRuleImpl getParentRule()
null if this CSSStyleDeclaration is
not attached to a CSSRule.getParentRule in class AbstractCssStyleDeclarationnull if this CSSStyleDeclaration is
not attached to a CSSRulepublic StyleElement getStyleElement(String name)
getStyleElement in class AbstractCssStyleDeclarationname - the name of the requested StyleElementpublic StyleElement getStyleElementCaseInSensitive(String name)
getStyleElementCaseInSensitive in class AbstractCssStyleDeclarationname - the name of the requested StyleElementpublic Map<String,StyleElement> getStyleMap()
LinkedHashMap map so that results are deterministic and are thus testable.getStyleMap in class AbstractCssStyleDeclarationpublic DomElement getDomElement()
DomElement associated with thispublic boolean hasFeature(BrowserVersionFeatures property)
hasFeature in class AbstractCssStyleDeclarationproperty - the property namefalse if this browser doesn't have this featurepublic BrowserVersion getBrowserVersion()
getBrowserVersion in class AbstractCssStyleDeclarationBrowserVersionCopyright © 2002–2025 Gargoyle Software Inc.. All rights reserved.