public class WrappedCssStyleDeclaration extends AbstractCssStyleDeclaration
CSSStyleDeclarationImpl
.Constructor and Description |
---|
WrappedCssStyleDeclaration(org.htmlunit.cssparser.dom.CSSStyleDeclarationImpl cssStyleDeclarationImpl,
BrowserVersion browserVersion)
Creates an instance which wraps the specified style declaration implementation.
|
Modifier and Type | Method and Description |
---|---|
BrowserVersion |
getBrowserVersion() |
String |
getCssText()
Returns the actual text of the style.
|
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.
|
getBackgroundAttachment, getBackgroundColor, getBackgroundImage, getBackgroundPosition, getBackgroundRepeat, 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, isComputed
public WrappedCssStyleDeclaration(org.htmlunit.cssparser.dom.CSSStyleDeclarationImpl cssStyleDeclarationImpl, BrowserVersion browserVersion)
cssStyleDeclarationImpl
- the style declaration to wrapbrowserVersion
- the BrowserVersion
public String getStylePriority(String name)
getStylePriority
in class AbstractCssStyleDeclaration
name
- the name of the style attribute whose value is to be retrievedpublic String getCssText()
getCssText
in class AbstractCssStyleDeclaration
public String getStyleAttribute(String name)
getStyleAttribute
in class AbstractCssStyleDeclaration
name
- the namepublic String getStyleAttribute(StyleAttributes.Definition definition, boolean getDefaultValueIfEmpty)
ComputedCssStyleDeclaration
.getStyleAttribute
in class AbstractCssStyleDeclaration
definition
- the definitiongetDefaultValueIfEmpty
- whether to get the default value if empty or notpublic void setCssText(String value)
setCssText
in class AbstractCssStyleDeclaration
value
- the new textpublic void setStyleAttribute(String name, String newValue, String important)
setStyleAttribute
in class AbstractCssStyleDeclaration
name
- the attribute name (camel-cased)newValue
- the attribute valueimportant
- important valuepublic String removeStyleAttribute(String name)
removeStyleAttribute
in class AbstractCssStyleDeclaration
name
- the attribute name (delimiter-separated, not camel-cased)public int getLength()
length
property.getLength
in class AbstractCssStyleDeclaration
length
propertypublic String item(int index)
item
in class AbstractCssStyleDeclaration
index
- the indexpublic org.htmlunit.cssparser.dom.AbstractCSSRuleImpl getParentRule()
null
if this CSSStyleDeclaration is
not attached to a CSSRule.getParentRule
in class AbstractCssStyleDeclaration
null
if this CSSStyleDeclaration is
not attached to a CSSRulepublic StyleElement getStyleElement(String name)
getStyleElement
in class AbstractCssStyleDeclaration
name
- the name of the requested StyleElementpublic StyleElement getStyleElementCaseInSensitive(String name)
getStyleElementCaseInSensitive
in class AbstractCssStyleDeclaration
name
- the name of the requested StyleElementpublic Map<String,StyleElement> getStyleMap()
LinkedHashMap
map so that results are deterministic and are thus testable.getStyleMap
in class AbstractCssStyleDeclaration
public boolean hasFeature(BrowserVersionFeatures property)
hasFeature
in class AbstractCssStyleDeclaration
property
- the property namefalse
if this browser doesn't have this featurepublic BrowserVersion getBrowserVersion()
getBrowserVersion
in class AbstractCssStyleDeclaration
BrowserVersion
Copyright © 2002–2024 Gargoyle Software Inc.. All rights reserved.