Package org.htmlunit.javascript.host.css
Class CSSStyleDeclaration
- java.lang.Object
-
- org.htmlunit.corejs.javascript.ScriptableObject
-
- org.htmlunit.javascript.HtmlUnitScriptable
-
- org.htmlunit.javascript.host.css.CSSStyleDeclaration
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,org.htmlunit.corejs.javascript.ConstProperties,org.htmlunit.corejs.javascript.debug.DebuggableObject,org.htmlunit.corejs.javascript.Scriptable,org.htmlunit.corejs.javascript.SymbolScriptable
- Direct Known Subclasses:
ComputedCSSStyleDeclaration
public class CSSStyleDeclaration extends HtmlUnitScriptable
A JavaScript object forCSSStyleDeclaration.- See Also:
- MDN doc, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String[]ALIGN_KEYWORDSprivate static java.util.Set<java.lang.String>LENGTH_PROPERTIES_FFFFprivate static java.util.Set<java.lang.String>LENGTH_PROPERTIES_FTFFprivate static java.util.Set<java.lang.String>LENGTH_PROPERTIES_TTFFprivate AbstractCssStyleDeclarationstyleDeclaration_The wrapped CSSStyleDeclarationprivate static java.lang.String[]THIN_MED_THICK
-
Constructor Summary
Constructors Constructor Description CSSStyleDeclaration()Creates an instance.CSSStyleDeclaration(CSSStyleSheet parentStyleSheet, WrappedCssStyleDeclaration styleDeclaration)Creates an instance which wraps the specified style declaration.CSSStyleDeclaration(Element element, AbstractCssStyleDeclaration styleDeclaration)Creates an instance and sets its parent scope to the one of the provided element.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectget(int index, org.htmlunit.corejs.javascript.Scriptable start)java.lang.Objectget(java.lang.String name, org.htmlunit.corejs.javascript.Scriptable start)Gets a named property from the object.java.lang.StringgetBackgroundAttachment()Gets thebackgroundAttachmentstyle attribute.java.lang.StringgetBackgroundColor()Gets thebackgroundColorstyle attribute.java.lang.StringgetBackgroundImage()Gets thebackgroundImagestyle attribute.java.lang.StringgetBackgroundPosition()Gets thebackgroundPositionstyle attribute.java.lang.StringgetBackgroundRepeat()Gets thebackgroundRepeatstyle attribute.java.lang.StringgetBorderBottomColor()Gets theborderBottomColorstyle attribute.java.lang.StringgetBorderBottomStyle()Gets theborderBottomStylestyle attribute.java.lang.StringgetBorderBottomWidth()Gets theborderBottomWidthstyle attribute.java.lang.StringgetBorderLeftColor()Gets theborderLeftColorstyle attribute.java.lang.StringgetBorderLeftStyle()Gets theborderLeftStylestyle attribute.java.lang.StringgetBorderLeftWidth()Gets theborderLeftWidthstyle attribute.java.lang.StringgetBorderRightColor()Gets theborderRightColorstyle attribute.java.lang.StringgetBorderRightStyle()Gets theborderRightStylestyle attribute.java.lang.StringgetBorderRightWidth()Gets theborderRightWidthstyle attribute.java.lang.StringgetBorderTop()Gets theborderTopstyle attribute.java.lang.StringgetBorderTopColor()Gets theborderTopColorstyle attribute.java.lang.StringgetBorderTopStyle()Gets theborderTopStylestyle attribute.java.lang.StringgetBorderTopWidth()Gets theborderTopWidthstyle attribute.java.lang.StringgetBottom()Gets thebottomstyle attribute.java.lang.StringgetColor()Gets thecolorstyle attribute.java.lang.StringgetCssFloat()Gets thecssFloatstyle attribute.protected AbstractCssStyleDeclarationgetCssStyleDeclaration()java.lang.StringgetCssText()Returns the actual text of the style.java.lang.StringgetDisplay()Gets thedisplaystyle attribute.java.lang.StringgetFont()Gets thefontstyle attribute.java.lang.StringgetFontFamily()Gets thefontFamilystyle attribute.java.lang.StringgetFontSize()Gets thefontSizestyle attribute.java.lang.StringgetHeight()Gets theheightstyle attribute.java.lang.Object[]getIds()java.lang.StringgetLeft()Gets theleftstyle attribute.intgetLength()Returns thelengthproperty.java.lang.StringgetLetterSpacing()Gets theletterSpacingstyle attribute.java.lang.StringgetLineHeight()Gets thelineHeightstyle attribute.java.lang.StringgetMargin()Gets themarginstyle attribute.java.lang.StringgetMarginBottom()Gets themarginBottomstyle attribute.java.lang.StringgetMarginLeft()Gets themarginLeftstyle attribute.java.lang.StringgetMarginRight()Gets themarginRightstyle attribute.java.lang.StringgetMarginTop()Gets themarginTopstyle attribute.java.lang.StringgetMaxHeight()Gets themaxHeightstyle attribute.java.lang.StringgetMaxWidth()Gets themaxWidthstyle attribute.java.lang.StringgetMinHeight()Gets theminHeightstyle attribute.java.lang.StringgetMinWidth()Gets theminWidthstyle attribute.java.lang.StringgetOpacity()Gets theopacitystyle attribute.java.lang.StringgetOrphans()Gets theorphansstyle attribute.java.lang.StringgetOutline()Gets theoutlinestyle attribute.java.lang.StringgetOutlineWidth()Gets theoutlineWidthstyle attribute.java.lang.StringgetPadding()Gets thepaddingstyle attribute.java.lang.StringgetPaddingBottom()Gets thepaddingBottomstyle attribute.java.lang.StringgetPaddingLeft()Gets thepaddingLeftstyle attribute.java.lang.StringgetPaddingRight()Gets thepaddingRightstyle attribute.java.lang.StringgetPaddingTop()Gets thepaddingTopstyle attribute.CSSRulegetParentRule()Returns the CSSRule that is the parent of this style block ornullif this CSSStyleDeclaration is not attached to a CSSRule.java.lang.StringgetPosition()Gets thepositionstyle attribute.java.lang.StringgetPropertyPriority(java.lang.String name)Gets the value of the specified property of the style.java.lang.StringgetPropertyValue(java.lang.String name)Gets the value of the specified property of the style.java.lang.StringgetRight()Gets therightstyle attribute.java.lang.StringgetRubyAlign()Gets therubyAlignstyle attribute.java.lang.StringgetSize()Gets thesizestyle attribute.java.lang.StringgetStyleAttribute(StyleAttributes.Definition definition)Get the value for the style attribute.java.lang.StringgetStyleAttribute(StyleAttributes.Definition definition, boolean getDefaultValueIfEmpty)Get the value for the style attribute.private java.util.Map<java.lang.String,StyleElement>getStyleMap()Returns a sorted map containing style elements, keyed on style element name.protected java.lang.StringgetStylePriority(java.lang.String name)Returns the priority of the named style attribute, or an empty string if it is not found.java.lang.StringgetTextIndent()Gets thetextIndentstyle attribute.java.lang.StringgetTop()Gets thetopstyle attribute.java.lang.StringgetVerticalAlign()Gets theverticalAlignstyle attribute.java.lang.StringgetWidows()Gets thewidowsstyle attribute.java.lang.StringgetWidth()Gets thewidthstyle attribute.java.lang.StringgetWordSpacing()Gets thewordSpacingstyle attribute.java.lang.ObjectgetZIndex()Gets thezIndexstyle attribute.booleanhas(java.lang.String name, org.htmlunit.corejs.javascript.Scriptable start)(package private) static booleanisLength(java.lang.String token)Returns if the specified token is a length.java.lang.Objectitem(int index)Returns the item in the given index.voidjsConstructor(java.lang.String type, org.htmlunit.corejs.javascript.ScriptableObject details)JavaScript constructor.voidput(java.lang.String name, org.htmlunit.corejs.javascript.Scriptable start, java.lang.Object value)java.lang.StringremoveProperty(java.lang.Object name)Removes the named property.private java.lang.StringremoveStyleAttribute(java.lang.String name)Removes the specified style attribute, returning the value of the removed attribute.voidsetBackgroundAttachment(java.lang.String backgroundAttachment)Sets thebackgroundAttachmentstyle attribute.voidsetBackgroundColor(java.lang.String backgroundColor)Sets thebackgroundColorstyle attribute.voidsetBackgroundImage(java.lang.String backgroundImage)Sets thebackgroundImagestyle attribute.voidsetBackgroundPosition(java.lang.String backgroundPosition)Sets thebackgroundPositionstyle attribute.voidsetBackgroundRepeat(java.lang.String backgroundRepeat)Sets thebackgroundRepeatstyle attribute.voidsetBorderBottomColor(java.lang.String borderBottomColor)Sets theborderBottomColorstyle attribute.voidsetBorderBottomStyle(java.lang.String borderBottomStyle)Sets theborderBottomStylestyle attribute.voidsetBorderBottomWidth(java.lang.Object borderBottomWidth)Sets theborderBottomWidthstyle attribute.voidsetBorderLeftColor(java.lang.String borderLeftColor)Sets theborderLeftColorstyle attribute.voidsetBorderLeftStyle(java.lang.String borderLeftStyle)Sets theborderLeftStylestyle attribute.voidsetBorderLeftWidth(java.lang.Object borderLeftWidth)Sets theborderLeftWidthstyle attribute.voidsetBorderRightColor(java.lang.String borderRightColor)Sets theborderRightColorstyle attribute.voidsetBorderRightStyle(java.lang.String borderRightStyle)Sets theborderRightStylestyle attribute.voidsetBorderRightWidth(java.lang.Object borderRightWidth)Sets theborderRightWidthstyle attribute.voidsetBorderTop(java.lang.String borderTop)Sets theborderTopstyle attribute.voidsetBorderTopColor(java.lang.String borderTopColor)Sets theborderTopColorstyle attribute.voidsetBorderTopStyle(java.lang.String borderTopStyle)Sets theborderTopStylestyle attribute.voidsetBorderTopWidth(java.lang.Object borderTopWidth)Sets theborderTopWidthstyle attribute.voidsetBottom(java.lang.Object bottom)Sets thebottomstyle attribute.voidsetColor(java.lang.String color)Sets thecolorstyle attribute.voidsetCssFloat(java.lang.String value)Sets thecssFloatstyle attribute.voidsetCssText(java.lang.String value)Sets the actual text of the style.voidsetDisplay(java.lang.String display)Sets thedisplaystyle attribute.voidsetFont(java.lang.String font)Sets thefontstyle attribute.voidsetFontFamily(java.lang.String fontFamily)Sets thefontFamilystyle attribute.voidsetFontSize(java.lang.Object fontSize)Sets thefontSizestyle attribute.voidsetHeight(java.lang.Object height)Sets theheightstyle attribute.voidsetLeft(java.lang.Object left)Sets theleftstyle attribute.voidsetLetterSpacing(java.lang.Object letterSpacing)Sets theletterSpacingstyle attribute.voidsetLineHeight(java.lang.String lineHeight)Sets thelineHeightstyle attribute.voidsetMargin(java.lang.String margin)Sets themarginstyle attribute.voidsetMarginBottom(java.lang.Object marginBottom)Sets themarginBottomstyle attribute.voidsetMarginLeft(java.lang.Object marginLeft)Sets themarginLeftstyle attribute.voidsetMarginRight(java.lang.Object marginRight)Sets themarginRightstyle attribute.voidsetMarginTop(java.lang.Object marginTop)Sets themarginTopstyle attribute.voidsetMaxHeight(java.lang.Object maxHeight)Sets themaxHeightstyle attribute.voidsetMaxWidth(java.lang.Object maxWidth)Sets themaxWidthstyle attribute.voidsetMinHeight(java.lang.Object minHeight)Sets theminHeightstyle attribute.voidsetMinWidth(java.lang.Object minWidth)Sets theminWidthstyle attribute.voidsetOpacity(java.lang.Object opacity)Sets theopacitystyle attribute.voidsetOrphans(java.lang.String orphans)Sets theorphansstyle attribute.voidsetOutline(java.lang.String outline)Sets theoutlinestyle attribute.voidsetOutlineWidth(java.lang.Object outlineWidth)Sets theoutlineWidthstyle attribute.voidsetPadding(java.lang.String padding)Sets thepaddingstyle attribute.voidsetPaddingBottom(java.lang.Object paddingBottom)Sets thepaddingBottomstyle attribute.voidsetPaddingLeft(java.lang.Object paddingLeft)Sets thepaddingLeftstyle attribute.voidsetPaddingRight(java.lang.Object paddingRight)Sets thepaddingRightstyle attribute.voidsetPaddingTop(java.lang.Object paddingTop)Sets thepaddingTopstyle attribute.voidsetParentRule(CSSRule parentRule)Nothing.voidsetPosition(java.lang.String position)Sets thepositionstyle attribute.voidsetProperty(java.lang.String name, java.lang.Object value, java.lang.String important)Sets the value of the specified property.voidsetRight(java.lang.Object right)Sets therightstyle attribute.voidsetRubyAlign(java.lang.String rubyAlign)Sets therubyAlignstyle attribute.voidsetSize(java.lang.String size)Sets thesizestyle attribute.protected voidsetStyleAttribute(java.lang.String name, java.lang.String newValue)Sets the specified style attribute.protected voidsetStyleAttribute(java.lang.String name, java.lang.String newValue, java.lang.String important)Sets the specified style attribute.private voidsetStyleLengthAttribute(java.lang.String name, java.lang.Object value, java.lang.String important, boolean auto, boolean percent, boolean unitRequired, java.lang.String[] validValues)Sets the style attribute which should be treated as an integer in pixels.voidsetTextIndent(java.lang.Object textIndent)Sets thetextIndentstyle attribute.voidsetTop(java.lang.Object top)Sets thetopstyle attribute.voidsetVerticalAlign(java.lang.Object verticalAlign)Sets theverticalAlignstyle attribute.voidsetWidows(java.lang.String widows)Sets thewidowsstyle attribute.voidsetWidth(java.lang.Object width)Sets thewidthstyle attribute.voidsetWordSpacing(java.lang.Object wordSpacing)Sets thewordSpacingstyle attribute.voidsetZIndex(java.lang.Object zIndex)Sets thezIndexstyle attribute.java.lang.StringtoString()private voidupdateFont(java.lang.String font, boolean force)org.htmlunit.corejs.javascript.Scriptablevalues()Returns an Iterator allowing to go through all keys contained in this object.-
Methods inherited from class org.htmlunit.javascript.HtmlUnitScriptable
clone, equivalentValues, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getWindow, getWindow, getWithPreemption, has, hasInstance, initParentScope, makeScriptableFor, setClassName, setDomNode, setDomNode, setParentScope, setupPromise, setupRejectedPromise
-
Methods inherited from class org.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setPrototype, size
-
-
-
-
Field Detail
-
LENGTH_PROPERTIES_FFFF
private static final java.util.Set<java.lang.String> LENGTH_PROPERTIES_FFFF
-
LENGTH_PROPERTIES_TTFF
private static final java.util.Set<java.lang.String> LENGTH_PROPERTIES_TTFF
-
LENGTH_PROPERTIES_FTFF
private static final java.util.Set<java.lang.String> LENGTH_PROPERTIES_FTFF
-
THIN_MED_THICK
private static final java.lang.String[] THIN_MED_THICK
-
ALIGN_KEYWORDS
private static final java.lang.String[] ALIGN_KEYWORDS
-
styleDeclaration_
private AbstractCssStyleDeclaration styleDeclaration_
The wrapped CSSStyleDeclaration
-
-
Constructor Detail
-
CSSStyleDeclaration
public CSSStyleDeclaration()
Creates an instance.
-
CSSStyleDeclaration
public CSSStyleDeclaration(Element element, AbstractCssStyleDeclaration styleDeclaration)
Creates an instance and sets its parent scope to the one of the provided element.- Parameters:
element- the element to which this style is boundstyleDeclaration- the style declaration to be based on
-
CSSStyleDeclaration
CSSStyleDeclaration(CSSStyleSheet parentStyleSheet, WrappedCssStyleDeclaration styleDeclaration)
Creates an instance which wraps the specified style declaration.- Parameters:
parentStyleSheet- the parentCSSStyleSheetto usestyleDeclaration- the style declaration to wrap
-
-
Method Detail
-
jsConstructor
public void jsConstructor(java.lang.String type, org.htmlunit.corejs.javascript.ScriptableObject details)JavaScript constructor.- Parameters:
type- the event typedetails- the event details (optional)
-
getCssStyleDeclaration
protected AbstractCssStyleDeclaration getCssStyleDeclaration()
-
getStylePriority
protected java.lang.String getStylePriority(java.lang.String name)
Returns the priority of the named style attribute, or an empty string if it is not found.- Parameters:
name- the name of the style attribute whose value is to be retrieved- Returns:
- the named style attribute value, or an empty string if it is not found
-
setStyleAttribute
protected void setStyleAttribute(java.lang.String name, java.lang.String newValue)Sets the specified style attribute.- Parameters:
name- the attribute name (camel-cased)newValue- the attribute value
-
setStyleAttribute
protected void setStyleAttribute(java.lang.String name, java.lang.String newValue, java.lang.String important)Sets the specified style attribute.- Parameters:
name- the attribute name (camel-cased)newValue- the attribute valueimportant- important value
-
removeStyleAttribute
private java.lang.String removeStyleAttribute(java.lang.String name)
Removes the specified style attribute, returning the value of the removed attribute.- Parameters:
name- the attribute name (delimiter-separated, not camel-cased)
-
getStyleMap
private java.util.Map<java.lang.String,StyleElement> getStyleMap()
Returns a sorted map containing style elements, keyed on style element name. We use aLinkedHashMapmap so that results are deterministic and are thus testable.- Returns:
- a sorted map containing style elements, keyed on style element name
-
getBackgroundAttachment
public java.lang.String getBackgroundAttachment()
Gets thebackgroundAttachmentstyle attribute.- Returns:
- the style attribute
-
setBackgroundAttachment
public void setBackgroundAttachment(java.lang.String backgroundAttachment)
Sets thebackgroundAttachmentstyle attribute.- Parameters:
backgroundAttachment- the new attribute
-
getBackgroundColor
public java.lang.String getBackgroundColor()
Gets thebackgroundColorstyle attribute.- Returns:
- the style attribute
-
setBackgroundColor
public void setBackgroundColor(java.lang.String backgroundColor)
Sets thebackgroundColorstyle attribute.- Parameters:
backgroundColor- the new attribute
-
getBackgroundImage
public java.lang.String getBackgroundImage()
Gets thebackgroundImagestyle attribute.- Returns:
- the style attribute
-
setBackgroundImage
public void setBackgroundImage(java.lang.String backgroundImage)
Sets thebackgroundImagestyle attribute.- Parameters:
backgroundImage- the new attribute
-
getBackgroundPosition
public java.lang.String getBackgroundPosition()
Gets thebackgroundPositionstyle attribute.- Returns:
- the style attribute
-
setBackgroundPosition
public void setBackgroundPosition(java.lang.String backgroundPosition)
Sets thebackgroundPositionstyle attribute.- Parameters:
backgroundPosition- the new attribute
-
getBackgroundRepeat
public java.lang.String getBackgroundRepeat()
Gets thebackgroundRepeatstyle attribute.- Returns:
- the style attribute
-
setBackgroundRepeat
public void setBackgroundRepeat(java.lang.String backgroundRepeat)
Sets thebackgroundRepeatstyle attribute.- Parameters:
backgroundRepeat- the new attribute
-
getBorderBottomColor
public java.lang.String getBorderBottomColor()
Gets theborderBottomColorstyle attribute.- Returns:
- the style attribute
-
setBorderBottomColor
public void setBorderBottomColor(java.lang.String borderBottomColor)
Sets theborderBottomColorstyle attribute.- Parameters:
borderBottomColor- the new attribute
-
getBorderBottomStyle
public java.lang.String getBorderBottomStyle()
Gets theborderBottomStylestyle attribute.- Returns:
- the style attribute
-
setBorderBottomStyle
public void setBorderBottomStyle(java.lang.String borderBottomStyle)
Sets theborderBottomStylestyle attribute.- Parameters:
borderBottomStyle- the new attribute
-
getBorderBottomWidth
public java.lang.String getBorderBottomWidth()
Gets theborderBottomWidthstyle attribute.- Returns:
- the style attribute
-
setBorderBottomWidth
public void setBorderBottomWidth(java.lang.Object borderBottomWidth)
Sets theborderBottomWidthstyle attribute.- Parameters:
borderBottomWidth- the new attribute
-
getBorderLeftColor
public java.lang.String getBorderLeftColor()
Gets theborderLeftColorstyle attribute.- Returns:
- the style attribute
-
setBorderLeftColor
public void setBorderLeftColor(java.lang.String borderLeftColor)
Sets theborderLeftColorstyle attribute.- Parameters:
borderLeftColor- the new attribute
-
getBorderLeftStyle
public java.lang.String getBorderLeftStyle()
Gets theborderLeftStylestyle attribute.- Returns:
- the style attribute
-
setBorderLeftStyle
public void setBorderLeftStyle(java.lang.String borderLeftStyle)
Sets theborderLeftStylestyle attribute.- Parameters:
borderLeftStyle- the new attribute
-
getBorderLeftWidth
public java.lang.String getBorderLeftWidth()
Gets theborderLeftWidthstyle attribute.- Returns:
- the style attribute
-
setBorderLeftWidth
public void setBorderLeftWidth(java.lang.Object borderLeftWidth)
Sets theborderLeftWidthstyle attribute.- Parameters:
borderLeftWidth- the new attribute
-
getBorderRightColor
public java.lang.String getBorderRightColor()
Gets theborderRightColorstyle attribute.- Returns:
- the style attribute
-
setBorderRightColor
public void setBorderRightColor(java.lang.String borderRightColor)
Sets theborderRightColorstyle attribute.- Parameters:
borderRightColor- the new attribute
-
getBorderRightStyle
public java.lang.String getBorderRightStyle()
Gets theborderRightStylestyle attribute.- Returns:
- the style attribute
-
setBorderRightStyle
public void setBorderRightStyle(java.lang.String borderRightStyle)
Sets theborderRightStylestyle attribute.- Parameters:
borderRightStyle- the new attribute
-
getBorderRightWidth
public java.lang.String getBorderRightWidth()
Gets theborderRightWidthstyle attribute.- Returns:
- the style attribute
-
setBorderRightWidth
public void setBorderRightWidth(java.lang.Object borderRightWidth)
Sets theborderRightWidthstyle attribute.- Parameters:
borderRightWidth- the new attribute
-
getBorderTop
public java.lang.String getBorderTop()
Gets theborderTopstyle attribute.- Returns:
- the style attribute
-
setBorderTop
public void setBorderTop(java.lang.String borderTop)
Sets theborderTopstyle attribute.- Parameters:
borderTop- the new attribute
-
getBorderTopColor
public java.lang.String getBorderTopColor()
Gets theborderTopColorstyle attribute.- Returns:
- the style attribute
-
setBorderTopColor
public void setBorderTopColor(java.lang.String borderTopColor)
Sets theborderTopColorstyle attribute.- Parameters:
borderTopColor- the new attribute
-
getBorderTopStyle
public java.lang.String getBorderTopStyle()
Gets theborderTopStylestyle attribute.- Returns:
- the style attribute
-
setBorderTopStyle
public void setBorderTopStyle(java.lang.String borderTopStyle)
Sets theborderTopStylestyle attribute.- Parameters:
borderTopStyle- the new attribute
-
getBorderTopWidth
public java.lang.String getBorderTopWidth()
Gets theborderTopWidthstyle attribute.- Returns:
- the style attribute
-
setBorderTopWidth
public void setBorderTopWidth(java.lang.Object borderTopWidth)
Sets theborderTopWidthstyle attribute.- Parameters:
borderTopWidth- the new attribute
-
getBottom
public java.lang.String getBottom()
Gets thebottomstyle attribute.- Returns:
- the style attribute
-
setBottom
public void setBottom(java.lang.Object bottom)
Sets thebottomstyle attribute.- Parameters:
bottom- the new attribute
-
getColor
public java.lang.String getColor()
Gets thecolorstyle attribute.- Returns:
- the style attribute
-
setColor
public void setColor(java.lang.String color)
Sets thecolorstyle attribute.- Parameters:
color- the new attribute
-
getCssFloat
public java.lang.String getCssFloat()
Gets thecssFloatstyle attribute.- Returns:
- the style attribute
-
setCssFloat
public void setCssFloat(java.lang.String value)
Sets thecssFloatstyle attribute.- Parameters:
value- the new attribute
-
getCssText
public java.lang.String getCssText()
Returns the actual text of the style.- Returns:
- the actual text of the style
-
setCssText
public void setCssText(java.lang.String value)
Sets the actual text of the style.- Parameters:
value- the new text
-
getDisplay
public java.lang.String getDisplay()
Gets thedisplaystyle attribute.- Returns:
- the style attribute
-
setDisplay
public void setDisplay(java.lang.String display)
Sets thedisplaystyle attribute.- Parameters:
display- the new attribute
-
getFontSize
public java.lang.String getFontSize()
Gets thefontSizestyle attribute.- Returns:
- the style attribute
-
setFontSize
public void setFontSize(java.lang.Object fontSize)
Sets thefontSizestyle attribute.- Parameters:
fontSize- the new attribute
-
getLineHeight
public java.lang.String getLineHeight()
Gets thelineHeightstyle attribute.- Returns:
- the style attribute
-
setLineHeight
public void setLineHeight(java.lang.String lineHeight)
Sets thelineHeightstyle attribute.- Parameters:
lineHeight- the new attribute
-
getFontFamily
public java.lang.String getFontFamily()
Gets thefontFamilystyle attribute.- Returns:
- the style attribute
-
setFontFamily
public void setFontFamily(java.lang.String fontFamily)
Sets thefontFamilystyle attribute.- Parameters:
fontFamily- the new attribute
-
updateFont
private void updateFont(java.lang.String font, boolean force)
-
getFont
public java.lang.String getFont()
Gets thefontstyle attribute.- Returns:
- the style attribute
-
setFont
public void setFont(java.lang.String font)
Sets thefontstyle attribute.- Parameters:
font- the new attribute
-
getHeight
public java.lang.String getHeight()
Gets theheightstyle attribute.- Returns:
- the style attribute
-
setHeight
public void setHeight(java.lang.Object height)
Sets theheightstyle attribute.- Parameters:
height- the new attribute
-
getLeft
public java.lang.String getLeft()
Gets theleftstyle attribute.- Returns:
- the style attribute
-
setLeft
public void setLeft(java.lang.Object left)
Sets theleftstyle attribute.- Parameters:
left- the new attribute
-
getLength
public int getLength()
Returns thelengthproperty.- Returns:
- the
lengthproperty
-
item
public java.lang.Object item(int index)
Returns the item in the given index.- Parameters:
index- the index- Returns:
- the item in the given index
-
values
public org.htmlunit.corejs.javascript.Scriptable values()
Returns an Iterator allowing to go through all keys contained in this object.- Returns:
- a NativeArrayIterator
-
getLetterSpacing
public java.lang.String getLetterSpacing()
Gets theletterSpacingstyle attribute.- Returns:
- the style attribute
-
setLetterSpacing
public void setLetterSpacing(java.lang.Object letterSpacing)
Sets theletterSpacingstyle attribute.- Parameters:
letterSpacing- the new attribute
-
getMargin
public java.lang.String getMargin()
Gets themarginstyle attribute.- Returns:
- the style attribute
-
setMargin
public void setMargin(java.lang.String margin)
Sets themarginstyle attribute.- Parameters:
margin- the new attribute
-
getMarginBottom
public java.lang.String getMarginBottom()
Gets themarginBottomstyle attribute.- Returns:
- the style attribute
-
setMarginBottom
public void setMarginBottom(java.lang.Object marginBottom)
Sets themarginBottomstyle attribute.- Parameters:
marginBottom- the new attribute
-
getMarginLeft
public java.lang.String getMarginLeft()
Gets themarginLeftstyle attribute.- Returns:
- the style attribute
-
setMarginLeft
public void setMarginLeft(java.lang.Object marginLeft)
Sets themarginLeftstyle attribute.- Parameters:
marginLeft- the new attribute
-
getMarginRight
public java.lang.String getMarginRight()
Gets themarginRightstyle attribute.- Returns:
- the style attribute
-
setMarginRight
public void setMarginRight(java.lang.Object marginRight)
Sets themarginRightstyle attribute.- Parameters:
marginRight- the new attribute
-
getMarginTop
public java.lang.String getMarginTop()
Gets themarginTopstyle attribute.- Returns:
- the style attribute
-
setMarginTop
public void setMarginTop(java.lang.Object marginTop)
Sets themarginTopstyle attribute.- Parameters:
marginTop- the new attribute
-
getMaxHeight
public java.lang.String getMaxHeight()
Gets themaxHeightstyle attribute.- Returns:
- the style attribute
-
setMaxHeight
public void setMaxHeight(java.lang.Object maxHeight)
Sets themaxHeightstyle attribute.- Parameters:
maxHeight- the new attribute
-
getMaxWidth
public java.lang.String getMaxWidth()
Gets themaxWidthstyle attribute.- Returns:
- the style attribute
-
setMaxWidth
public void setMaxWidth(java.lang.Object maxWidth)
Sets themaxWidthstyle attribute.- Parameters:
maxWidth- the new attribute
-
getMinHeight
public java.lang.String getMinHeight()
Gets theminHeightstyle attribute.- Returns:
- the style attribute
-
setMinHeight
public void setMinHeight(java.lang.Object minHeight)
Sets theminHeightstyle attribute.- Parameters:
minHeight- the new attribute
-
getMinWidth
public java.lang.String getMinWidth()
Gets theminWidthstyle attribute.- Returns:
- the style attribute
-
setMinWidth
public void setMinWidth(java.lang.Object minWidth)
Sets theminWidthstyle attribute.- Parameters:
minWidth- the new attribute
-
get
public java.lang.Object get(java.lang.String name, org.htmlunit.corejs.javascript.Scriptable start)Gets a named property from the object. Normally HtmlUnit objects don't need to overwrite this method as properties are defined on the prototypes from the XML configuration. In some cases where "content" of object has priority compared to the properties consider using utilityHtmlUnitScriptable.getWithPreemption(String).- Specified by:
getin interfaceorg.htmlunit.corejs.javascript.Scriptable- Overrides:
getin classHtmlUnitScriptable
-
get
public java.lang.Object get(int index, org.htmlunit.corejs.javascript.Scriptable start)- Specified by:
getin interfaceorg.htmlunit.corejs.javascript.Scriptable- Overrides:
getin classorg.htmlunit.corejs.javascript.ScriptableObject
-
getStyleAttribute
public final java.lang.String getStyleAttribute(StyleAttributes.Definition definition)
Get the value for the style attribute.- Parameters:
definition- the definition- Returns:
- the value
-
getStyleAttribute
public java.lang.String getStyleAttribute(StyleAttributes.Definition definition, boolean getDefaultValueIfEmpty)
Get the value for the style attribute. This impl ignores the default getDefaultValueIfEmpty flag, but there is a overload inComputedCSSStyleDeclaration.- Parameters:
definition- the definitiongetDefaultValueIfEmpty- whether to get the default value if empty or not- Returns:
- the value
-
put
public void put(java.lang.String name, org.htmlunit.corejs.javascript.Scriptable start, java.lang.Object value)Description copied from class:HtmlUnitScriptable- Specified by:
putin interfaceorg.htmlunit.corejs.javascript.Scriptable- Overrides:
putin classHtmlUnitScriptable
-
has
public boolean has(java.lang.String name, org.htmlunit.corejs.javascript.Scriptable start)- Specified by:
hasin interfaceorg.htmlunit.corejs.javascript.Scriptable- Overrides:
hasin classorg.htmlunit.corejs.javascript.ScriptableObject
-
getIds
public java.lang.Object[] getIds()
- Specified by:
getIdsin interfaceorg.htmlunit.corejs.javascript.Scriptable- Overrides:
getIdsin classorg.htmlunit.corejs.javascript.ScriptableObject
-
getOpacity
public java.lang.String getOpacity()
Gets theopacitystyle attribute.- Returns:
- the style attribute
-
setOpacity
public void setOpacity(java.lang.Object opacity)
Sets theopacitystyle attribute.- Parameters:
opacity- the new attribute
-
getOutline
public java.lang.String getOutline()
Gets theoutlinestyle attribute.- Returns:
- the style attribute
-
setOutline
public void setOutline(java.lang.String outline)
Sets theoutlinestyle attribute.- Parameters:
outline- the new attribute
-
getOutlineWidth
public java.lang.String getOutlineWidth()
Gets theoutlineWidthstyle attribute.- Returns:
- the style attribute
-
setOutlineWidth
public void setOutlineWidth(java.lang.Object outlineWidth)
Sets theoutlineWidthstyle attribute.- Parameters:
outlineWidth- the new attribute
-
getPadding
public java.lang.String getPadding()
Gets thepaddingstyle attribute.- Returns:
- the style attribute
-
setPadding
public void setPadding(java.lang.String padding)
Sets thepaddingstyle attribute.- Parameters:
padding- the new attribute
-
getPaddingBottom
public java.lang.String getPaddingBottom()
Gets thepaddingBottomstyle attribute.- Returns:
- the style attribute
-
setPaddingBottom
public void setPaddingBottom(java.lang.Object paddingBottom)
Sets thepaddingBottomstyle attribute.- Parameters:
paddingBottom- the new attribute
-
getPaddingLeft
public java.lang.String getPaddingLeft()
Gets thepaddingLeftstyle attribute.- Returns:
- the style attribute
-
setPaddingLeft
public void setPaddingLeft(java.lang.Object paddingLeft)
Sets thepaddingLeftstyle attribute.- Parameters:
paddingLeft- the new attribute
-
getPaddingRight
public java.lang.String getPaddingRight()
Gets thepaddingRightstyle attribute.- Returns:
- the style attribute
-
setPaddingRight
public void setPaddingRight(java.lang.Object paddingRight)
Sets thepaddingRightstyle attribute.- Parameters:
paddingRight- the new attribute
-
getPaddingTop
public java.lang.String getPaddingTop()
Gets thepaddingTopstyle attribute.- Returns:
- the style attribute
-
setPaddingTop
public void setPaddingTop(java.lang.Object paddingTop)
Sets thepaddingTopstyle attribute.- Parameters:
paddingTop- the new attribute
-
getParentRule
public CSSRule getParentRule()
Returns the CSSRule that is the parent of this style block ornullif this CSSStyleDeclaration is not attached to a CSSRule.- Returns:
- the CSSRule that is the parent of this style block or
nullif this CSSStyleDeclaration is not attached to a CSSRule
-
setParentRule
public void setParentRule(CSSRule parentRule)
Nothing.- Parameters:
parentRule- ignored
-
getRight
public java.lang.String getRight()
Gets therightstyle attribute.- Returns:
- the style attribute
-
setRight
public void setRight(java.lang.Object right)
Sets therightstyle attribute.- Parameters:
right- the new attribute
-
getRubyAlign
public java.lang.String getRubyAlign()
Gets therubyAlignstyle attribute.- Returns:
- the style attribute
-
setRubyAlign
public void setRubyAlign(java.lang.String rubyAlign)
Sets therubyAlignstyle attribute.- Parameters:
rubyAlign- the new attribute
-
getSize
public java.lang.String getSize()
Gets thesizestyle attribute.- Returns:
- the style attribute
-
setSize
public void setSize(java.lang.String size)
Sets thesizestyle attribute.- Parameters:
size- the new attribute
-
getTextIndent
public java.lang.String getTextIndent()
Gets thetextIndentstyle attribute.- Returns:
- the style attribute
-
setTextIndent
public void setTextIndent(java.lang.Object textIndent)
Sets thetextIndentstyle attribute.- Parameters:
textIndent- the new attribute
-
getTop
public java.lang.String getTop()
Gets thetopstyle attribute.- Returns:
- the style attribute
-
setTop
public void setTop(java.lang.Object top)
Sets thetopstyle attribute.- Parameters:
top- the new attribute
-
getVerticalAlign
public java.lang.String getVerticalAlign()
Gets theverticalAlignstyle attribute.- Returns:
- the style attribute
-
setVerticalAlign
public void setVerticalAlign(java.lang.Object verticalAlign)
Sets theverticalAlignstyle attribute.- Parameters:
verticalAlign- the new attribute
-
getWidth
public java.lang.String getWidth()
Gets thewidthstyle attribute.- Returns:
- the style attribute
-
setWidth
public void setWidth(java.lang.Object width)
Sets thewidthstyle attribute.- Parameters:
width- the new attribute
-
getWidows
public java.lang.String getWidows()
Gets thewidowsstyle attribute.- Returns:
- the style attribute
-
setWidows
public void setWidows(java.lang.String widows)
Sets thewidowsstyle attribute.- Parameters:
widows- the new attribute
-
getOrphans
public java.lang.String getOrphans()
Gets theorphansstyle attribute.- Returns:
- the style attribute
-
setOrphans
public void setOrphans(java.lang.String orphans)
Sets theorphansstyle attribute.- Parameters:
orphans- the new attribute
-
getPosition
public java.lang.String getPosition()
Gets thepositionstyle attribute.- Returns:
- the style attribute
-
setPosition
public void setPosition(java.lang.String position)
Sets thepositionstyle attribute.- Parameters:
position- the new attribute
-
getWordSpacing
public java.lang.String getWordSpacing()
Gets thewordSpacingstyle attribute.- Returns:
- the style attribute
-
setWordSpacing
public void setWordSpacing(java.lang.Object wordSpacing)
Sets thewordSpacingstyle attribute.- Parameters:
wordSpacing- the new attribute
-
getZIndex
public java.lang.Object getZIndex()
Gets thezIndexstyle attribute.- Returns:
- the style attribute
-
setZIndex
public void setZIndex(java.lang.Object zIndex)
Sets thezIndexstyle attribute.- Parameters:
zIndex- the new attribute
-
getPropertyValue
public java.lang.String getPropertyValue(java.lang.String name)
Gets the value of the specified property of the style.- Parameters:
name- the style property name- Returns:
- empty string if nothing found
-
getPropertyPriority
public java.lang.String getPropertyPriority(java.lang.String name)
Gets the value of the specified property of the style.- Parameters:
name- the style property name- Returns:
- empty string if nothing found
-
setProperty
public void setProperty(java.lang.String name, java.lang.Object value, java.lang.String important)Sets the value of the specified property.- Parameters:
name- the name of the attributevalue- the value to assign to the attributeimportant- may be null
-
removeProperty
public java.lang.String removeProperty(java.lang.Object name)
Removes the named property.- Parameters:
name- the name of the property to remove- Returns:
- the value deleted
-
isLength
static boolean isLength(java.lang.String token)
Returns if the specified token is a length.- Parameters:
token- the token to check- Returns:
- whether the token is a length or not
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
setStyleLengthAttribute
private void setStyleLengthAttribute(java.lang.String name, java.lang.Object value, java.lang.String important, boolean auto, boolean percent, boolean unitRequired, java.lang.String[] validValues)Sets the style attribute which should be treated as an integer in pixels.- Parameters:
name- the attribute namevalue- the attribute valueimportant- important valueauto- true if auto is supportedpercent- true if percent is supportedunitRequired- unit is requiredvalidValues- valid values
-
-