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_KEYWORDS
private static java.util.Set<java.lang.String>
LENGTH_PROPERTIES_FFFF
private static java.util.Set<java.lang.String>
LENGTH_PROPERTIES_FTFF
private static java.util.Set<java.lang.String>
LENGTH_PROPERTIES_TTFF
private AbstractCssStyleDeclaration
styleDeclaration_
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.Object
get(int index, org.htmlunit.corejs.javascript.Scriptable start)
java.lang.Object
get(java.lang.String name, org.htmlunit.corejs.javascript.Scriptable start)
Gets a named property from the object.java.lang.String
getBackgroundAttachment()
Gets thebackgroundAttachment
style attribute.java.lang.String
getBackgroundColor()
Gets thebackgroundColor
style attribute.java.lang.String
getBackgroundImage()
Gets thebackgroundImage
style attribute.java.lang.String
getBackgroundPosition()
Gets thebackgroundPosition
style attribute.java.lang.String
getBackgroundRepeat()
Gets thebackgroundRepeat
style attribute.java.lang.String
getBorderBottomColor()
Gets theborderBottomColor
style attribute.java.lang.String
getBorderBottomStyle()
Gets theborderBottomStyle
style attribute.java.lang.String
getBorderBottomWidth()
Gets theborderBottomWidth
style attribute.java.lang.String
getBorderLeftColor()
Gets theborderLeftColor
style attribute.java.lang.String
getBorderLeftStyle()
Gets theborderLeftStyle
style attribute.java.lang.String
getBorderLeftWidth()
Gets theborderLeftWidth
style attribute.java.lang.String
getBorderRightColor()
Gets theborderRightColor
style attribute.java.lang.String
getBorderRightStyle()
Gets theborderRightStyle
style attribute.java.lang.String
getBorderRightWidth()
Gets theborderRightWidth
style attribute.java.lang.String
getBorderTop()
Gets theborderTop
style attribute.java.lang.String
getBorderTopColor()
Gets theborderTopColor
style attribute.java.lang.String
getBorderTopStyle()
Gets theborderTopStyle
style attribute.java.lang.String
getBorderTopWidth()
Gets theborderTopWidth
style attribute.java.lang.String
getBottom()
Gets thebottom
style attribute.java.lang.String
getColor()
Gets thecolor
style attribute.java.lang.String
getCssFloat()
Gets thecssFloat
style attribute.protected AbstractCssStyleDeclaration
getCssStyleDeclaration()
java.lang.String
getCssText()
Returns the actual text of the style.java.lang.String
getDisplay()
Gets thedisplay
style attribute.java.lang.String
getFont()
Gets thefont
style attribute.java.lang.String
getFontFamily()
Gets thefontFamily
style attribute.java.lang.String
getFontSize()
Gets thefontSize
style attribute.java.lang.String
getHeight()
Gets theheight
style attribute.java.lang.Object[]
getIds()
java.lang.String
getLeft()
Gets theleft
style attribute.int
getLength()
Returns thelength
property.java.lang.String
getLetterSpacing()
Gets theletterSpacing
style attribute.java.lang.String
getLineHeight()
Gets thelineHeight
style attribute.java.lang.String
getMargin()
Gets themargin
style attribute.java.lang.String
getMarginBottom()
Gets themarginBottom
style attribute.java.lang.String
getMarginLeft()
Gets themarginLeft
style attribute.java.lang.String
getMarginRight()
Gets themarginRight
style attribute.java.lang.String
getMarginTop()
Gets themarginTop
style attribute.java.lang.String
getMaxHeight()
Gets themaxHeight
style attribute.java.lang.String
getMaxWidth()
Gets themaxWidth
style attribute.java.lang.String
getMinHeight()
Gets theminHeight
style attribute.java.lang.String
getMinWidth()
Gets theminWidth
style attribute.java.lang.String
getOpacity()
Gets theopacity
style attribute.java.lang.String
getOrphans()
Gets theorphans
style attribute.java.lang.String
getOutline()
Gets theoutline
style attribute.java.lang.String
getOutlineWidth()
Gets theoutlineWidth
style attribute.java.lang.String
getPadding()
Gets thepadding
style attribute.java.lang.String
getPaddingBottom()
Gets thepaddingBottom
style attribute.java.lang.String
getPaddingLeft()
Gets thepaddingLeft
style attribute.java.lang.String
getPaddingRight()
Gets thepaddingRight
style attribute.java.lang.String
getPaddingTop()
Gets thepaddingTop
style attribute.CSSRule
getParentRule()
Returns the CSSRule that is the parent of this style block ornull
if this CSSStyleDeclaration is not attached to a CSSRule.java.lang.String
getPosition()
Gets theposition
style attribute.java.lang.String
getPropertyPriority(java.lang.String name)
Gets the value of the specified property of the style.java.lang.String
getPropertyValue(java.lang.String name)
Gets the value of the specified property of the style.java.lang.String
getRight()
Gets theright
style attribute.java.lang.String
getRubyAlign()
Gets therubyAlign
style attribute.java.lang.String
getSize()
Gets thesize
style attribute.java.lang.String
getStyleAttribute(StyleAttributes.Definition definition)
Get the value for the style attribute.java.lang.String
getStyleAttribute(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.String
getStylePriority(java.lang.String name)
Returns the priority of the named style attribute, or an empty string if it is not found.java.lang.String
getTextIndent()
Gets thetextIndent
style attribute.java.lang.String
getTop()
Gets thetop
style attribute.java.lang.String
getVerticalAlign()
Gets theverticalAlign
style attribute.java.lang.String
getWidows()
Gets thewidows
style attribute.java.lang.String
getWidth()
Gets thewidth
style attribute.java.lang.String
getWordSpacing()
Gets thewordSpacing
style attribute.java.lang.Object
getZIndex()
Gets thezIndex
style attribute.boolean
has(java.lang.String name, org.htmlunit.corejs.javascript.Scriptable start)
(package private) static boolean
isLength(java.lang.String token)
Returns if the specified token is a length.java.lang.Object
item(int index)
Returns the item in the given index.void
jsConstructor(java.lang.String type, org.htmlunit.corejs.javascript.ScriptableObject details)
JavaScript constructor.void
put(java.lang.String name, org.htmlunit.corejs.javascript.Scriptable start, java.lang.Object value)
java.lang.String
removeProperty(java.lang.Object name)
Removes the named property.private java.lang.String
removeStyleAttribute(java.lang.String name)
Removes the specified style attribute, returning the value of the removed attribute.void
setBackgroundAttachment(java.lang.String backgroundAttachment)
Sets thebackgroundAttachment
style attribute.void
setBackgroundColor(java.lang.String backgroundColor)
Sets thebackgroundColor
style attribute.void
setBackgroundImage(java.lang.String backgroundImage)
Sets thebackgroundImage
style attribute.void
setBackgroundPosition(java.lang.String backgroundPosition)
Sets thebackgroundPosition
style attribute.void
setBackgroundRepeat(java.lang.String backgroundRepeat)
Sets thebackgroundRepeat
style attribute.void
setBorderBottomColor(java.lang.String borderBottomColor)
Sets theborderBottomColor
style attribute.void
setBorderBottomStyle(java.lang.String borderBottomStyle)
Sets theborderBottomStyle
style attribute.void
setBorderBottomWidth(java.lang.Object borderBottomWidth)
Sets theborderBottomWidth
style attribute.void
setBorderLeftColor(java.lang.String borderLeftColor)
Sets theborderLeftColor
style attribute.void
setBorderLeftStyle(java.lang.String borderLeftStyle)
Sets theborderLeftStyle
style attribute.void
setBorderLeftWidth(java.lang.Object borderLeftWidth)
Sets theborderLeftWidth
style attribute.void
setBorderRightColor(java.lang.String borderRightColor)
Sets theborderRightColor
style attribute.void
setBorderRightStyle(java.lang.String borderRightStyle)
Sets theborderRightStyle
style attribute.void
setBorderRightWidth(java.lang.Object borderRightWidth)
Sets theborderRightWidth
style attribute.void
setBorderTop(java.lang.String borderTop)
Sets theborderTop
style attribute.void
setBorderTopColor(java.lang.String borderTopColor)
Sets theborderTopColor
style attribute.void
setBorderTopStyle(java.lang.String borderTopStyle)
Sets theborderTopStyle
style attribute.void
setBorderTopWidth(java.lang.Object borderTopWidth)
Sets theborderTopWidth
style attribute.void
setBottom(java.lang.Object bottom)
Sets thebottom
style attribute.void
setColor(java.lang.String color)
Sets thecolor
style attribute.void
setCssFloat(java.lang.String value)
Sets thecssFloat
style attribute.void
setCssText(java.lang.String value)
Sets the actual text of the style.void
setDisplay(java.lang.String display)
Sets thedisplay
style attribute.void
setFont(java.lang.String font)
Sets thefont
style attribute.void
setFontFamily(java.lang.String fontFamily)
Sets thefontFamily
style attribute.void
setFontSize(java.lang.Object fontSize)
Sets thefontSize
style attribute.void
setHeight(java.lang.Object height)
Sets theheight
style attribute.void
setLeft(java.lang.Object left)
Sets theleft
style attribute.void
setLetterSpacing(java.lang.Object letterSpacing)
Sets theletterSpacing
style attribute.void
setLineHeight(java.lang.String lineHeight)
Sets thelineHeight
style attribute.void
setMargin(java.lang.String margin)
Sets themargin
style attribute.void
setMarginBottom(java.lang.Object marginBottom)
Sets themarginBottom
style attribute.void
setMarginLeft(java.lang.Object marginLeft)
Sets themarginLeft
style attribute.void
setMarginRight(java.lang.Object marginRight)
Sets themarginRight
style attribute.void
setMarginTop(java.lang.Object marginTop)
Sets themarginTop
style attribute.void
setMaxHeight(java.lang.Object maxHeight)
Sets themaxHeight
style attribute.void
setMaxWidth(java.lang.Object maxWidth)
Sets themaxWidth
style attribute.void
setMinHeight(java.lang.Object minHeight)
Sets theminHeight
style attribute.void
setMinWidth(java.lang.Object minWidth)
Sets theminWidth
style attribute.void
setOpacity(java.lang.Object opacity)
Sets theopacity
style attribute.void
setOrphans(java.lang.String orphans)
Sets theorphans
style attribute.void
setOutline(java.lang.String outline)
Sets theoutline
style attribute.void
setOutlineWidth(java.lang.Object outlineWidth)
Sets theoutlineWidth
style attribute.void
setPadding(java.lang.String padding)
Sets thepadding
style attribute.void
setPaddingBottom(java.lang.Object paddingBottom)
Sets thepaddingBottom
style attribute.void
setPaddingLeft(java.lang.Object paddingLeft)
Sets thepaddingLeft
style attribute.void
setPaddingRight(java.lang.Object paddingRight)
Sets thepaddingRight
style attribute.void
setPaddingTop(java.lang.Object paddingTop)
Sets thepaddingTop
style attribute.void
setParentRule(CSSRule parentRule)
Nothing.void
setPosition(java.lang.String position)
Sets theposition
style attribute.void
setProperty(java.lang.String name, java.lang.Object value, java.lang.String important)
Sets the value of the specified property.void
setRight(java.lang.Object right)
Sets theright
style attribute.void
setRubyAlign(java.lang.String rubyAlign)
Sets therubyAlign
style attribute.void
setSize(java.lang.String size)
Sets thesize
style attribute.protected void
setStyleAttribute(java.lang.String name, java.lang.String newValue)
Sets the specified style attribute.protected void
setStyleAttribute(java.lang.String name, java.lang.String newValue, java.lang.String important)
Sets the specified style attribute.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.void
setTextIndent(java.lang.Object textIndent)
Sets thetextIndent
style attribute.void
setTop(java.lang.Object top)
Sets thetop
style attribute.void
setVerticalAlign(java.lang.Object verticalAlign)
Sets theverticalAlign
style attribute.void
setWidows(java.lang.String widows)
Sets thewidows
style attribute.void
setWidth(java.lang.Object width)
Sets thewidth
style attribute.void
setWordSpacing(java.lang.Object wordSpacing)
Sets thewordSpacing
style attribute.void
setZIndex(java.lang.Object zIndex)
Sets thezIndex
style attribute.java.lang.String
toString()
private void
updateFont(java.lang.String font, boolean force)
org.htmlunit.corejs.javascript.Scriptable
values()
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 parentCSSStyleSheet
to 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 aLinkedHashMap
map 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 thebackgroundAttachment
style attribute.- Returns:
- the style attribute
-
setBackgroundAttachment
public void setBackgroundAttachment(java.lang.String backgroundAttachment)
Sets thebackgroundAttachment
style attribute.- Parameters:
backgroundAttachment
- the new attribute
-
getBackgroundColor
public java.lang.String getBackgroundColor()
Gets thebackgroundColor
style attribute.- Returns:
- the style attribute
-
setBackgroundColor
public void setBackgroundColor(java.lang.String backgroundColor)
Sets thebackgroundColor
style attribute.- Parameters:
backgroundColor
- the new attribute
-
getBackgroundImage
public java.lang.String getBackgroundImage()
Gets thebackgroundImage
style attribute.- Returns:
- the style attribute
-
setBackgroundImage
public void setBackgroundImage(java.lang.String backgroundImage)
Sets thebackgroundImage
style attribute.- Parameters:
backgroundImage
- the new attribute
-
getBackgroundPosition
public java.lang.String getBackgroundPosition()
Gets thebackgroundPosition
style attribute.- Returns:
- the style attribute
-
setBackgroundPosition
public void setBackgroundPosition(java.lang.String backgroundPosition)
Sets thebackgroundPosition
style attribute.- Parameters:
backgroundPosition
- the new attribute
-
getBackgroundRepeat
public java.lang.String getBackgroundRepeat()
Gets thebackgroundRepeat
style attribute.- Returns:
- the style attribute
-
setBackgroundRepeat
public void setBackgroundRepeat(java.lang.String backgroundRepeat)
Sets thebackgroundRepeat
style attribute.- Parameters:
backgroundRepeat
- the new attribute
-
getBorderBottomColor
public java.lang.String getBorderBottomColor()
Gets theborderBottomColor
style attribute.- Returns:
- the style attribute
-
setBorderBottomColor
public void setBorderBottomColor(java.lang.String borderBottomColor)
Sets theborderBottomColor
style attribute.- Parameters:
borderBottomColor
- the new attribute
-
getBorderBottomStyle
public java.lang.String getBorderBottomStyle()
Gets theborderBottomStyle
style attribute.- Returns:
- the style attribute
-
setBorderBottomStyle
public void setBorderBottomStyle(java.lang.String borderBottomStyle)
Sets theborderBottomStyle
style attribute.- Parameters:
borderBottomStyle
- the new attribute
-
getBorderBottomWidth
public java.lang.String getBorderBottomWidth()
Gets theborderBottomWidth
style attribute.- Returns:
- the style attribute
-
setBorderBottomWidth
public void setBorderBottomWidth(java.lang.Object borderBottomWidth)
Sets theborderBottomWidth
style attribute.- Parameters:
borderBottomWidth
- the new attribute
-
getBorderLeftColor
public java.lang.String getBorderLeftColor()
Gets theborderLeftColor
style attribute.- Returns:
- the style attribute
-
setBorderLeftColor
public void setBorderLeftColor(java.lang.String borderLeftColor)
Sets theborderLeftColor
style attribute.- Parameters:
borderLeftColor
- the new attribute
-
getBorderLeftStyle
public java.lang.String getBorderLeftStyle()
Gets theborderLeftStyle
style attribute.- Returns:
- the style attribute
-
setBorderLeftStyle
public void setBorderLeftStyle(java.lang.String borderLeftStyle)
Sets theborderLeftStyle
style attribute.- Parameters:
borderLeftStyle
- the new attribute
-
getBorderLeftWidth
public java.lang.String getBorderLeftWidth()
Gets theborderLeftWidth
style attribute.- Returns:
- the style attribute
-
setBorderLeftWidth
public void setBorderLeftWidth(java.lang.Object borderLeftWidth)
Sets theborderLeftWidth
style attribute.- Parameters:
borderLeftWidth
- the new attribute
-
getBorderRightColor
public java.lang.String getBorderRightColor()
Gets theborderRightColor
style attribute.- Returns:
- the style attribute
-
setBorderRightColor
public void setBorderRightColor(java.lang.String borderRightColor)
Sets theborderRightColor
style attribute.- Parameters:
borderRightColor
- the new attribute
-
getBorderRightStyle
public java.lang.String getBorderRightStyle()
Gets theborderRightStyle
style attribute.- Returns:
- the style attribute
-
setBorderRightStyle
public void setBorderRightStyle(java.lang.String borderRightStyle)
Sets theborderRightStyle
style attribute.- Parameters:
borderRightStyle
- the new attribute
-
getBorderRightWidth
public java.lang.String getBorderRightWidth()
Gets theborderRightWidth
style attribute.- Returns:
- the style attribute
-
setBorderRightWidth
public void setBorderRightWidth(java.lang.Object borderRightWidth)
Sets theborderRightWidth
style attribute.- Parameters:
borderRightWidth
- the new attribute
-
getBorderTop
public java.lang.String getBorderTop()
Gets theborderTop
style attribute.- Returns:
- the style attribute
-
setBorderTop
public void setBorderTop(java.lang.String borderTop)
Sets theborderTop
style attribute.- Parameters:
borderTop
- the new attribute
-
getBorderTopColor
public java.lang.String getBorderTopColor()
Gets theborderTopColor
style attribute.- Returns:
- the style attribute
-
setBorderTopColor
public void setBorderTopColor(java.lang.String borderTopColor)
Sets theborderTopColor
style attribute.- Parameters:
borderTopColor
- the new attribute
-
getBorderTopStyle
public java.lang.String getBorderTopStyle()
Gets theborderTopStyle
style attribute.- Returns:
- the style attribute
-
setBorderTopStyle
public void setBorderTopStyle(java.lang.String borderTopStyle)
Sets theborderTopStyle
style attribute.- Parameters:
borderTopStyle
- the new attribute
-
getBorderTopWidth
public java.lang.String getBorderTopWidth()
Gets theborderTopWidth
style attribute.- Returns:
- the style attribute
-
setBorderTopWidth
public void setBorderTopWidth(java.lang.Object borderTopWidth)
Sets theborderTopWidth
style attribute.- Parameters:
borderTopWidth
- the new attribute
-
getBottom
public java.lang.String getBottom()
Gets thebottom
style attribute.- Returns:
- the style attribute
-
setBottom
public void setBottom(java.lang.Object bottom)
Sets thebottom
style attribute.- Parameters:
bottom
- the new attribute
-
getColor
public java.lang.String getColor()
Gets thecolor
style attribute.- Returns:
- the style attribute
-
setColor
public void setColor(java.lang.String color)
Sets thecolor
style attribute.- Parameters:
color
- the new attribute
-
getCssFloat
public java.lang.String getCssFloat()
Gets thecssFloat
style attribute.- Returns:
- the style attribute
-
setCssFloat
public void setCssFloat(java.lang.String value)
Sets thecssFloat
style 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 thedisplay
style attribute.- Returns:
- the style attribute
-
setDisplay
public void setDisplay(java.lang.String display)
Sets thedisplay
style attribute.- Parameters:
display
- the new attribute
-
getFontSize
public java.lang.String getFontSize()
Gets thefontSize
style attribute.- Returns:
- the style attribute
-
setFontSize
public void setFontSize(java.lang.Object fontSize)
Sets thefontSize
style attribute.- Parameters:
fontSize
- the new attribute
-
getLineHeight
public java.lang.String getLineHeight()
Gets thelineHeight
style attribute.- Returns:
- the style attribute
-
setLineHeight
public void setLineHeight(java.lang.String lineHeight)
Sets thelineHeight
style attribute.- Parameters:
lineHeight
- the new attribute
-
getFontFamily
public java.lang.String getFontFamily()
Gets thefontFamily
style attribute.- Returns:
- the style attribute
-
setFontFamily
public void setFontFamily(java.lang.String fontFamily)
Sets thefontFamily
style attribute.- Parameters:
fontFamily
- the new attribute
-
updateFont
private void updateFont(java.lang.String font, boolean force)
-
getFont
public java.lang.String getFont()
Gets thefont
style attribute.- Returns:
- the style attribute
-
setFont
public void setFont(java.lang.String font)
Sets thefont
style attribute.- Parameters:
font
- the new attribute
-
getHeight
public java.lang.String getHeight()
Gets theheight
style attribute.- Returns:
- the style attribute
-
setHeight
public void setHeight(java.lang.Object height)
Sets theheight
style attribute.- Parameters:
height
- the new attribute
-
getLeft
public java.lang.String getLeft()
Gets theleft
style attribute.- Returns:
- the style attribute
-
setLeft
public void setLeft(java.lang.Object left)
Sets theleft
style attribute.- Parameters:
left
- the new attribute
-
getLength
public int getLength()
Returns thelength
property.- Returns:
- the
length
property
-
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 theletterSpacing
style attribute.- Returns:
- the style attribute
-
setLetterSpacing
public void setLetterSpacing(java.lang.Object letterSpacing)
Sets theletterSpacing
style attribute.- Parameters:
letterSpacing
- the new attribute
-
getMargin
public java.lang.String getMargin()
Gets themargin
style attribute.- Returns:
- the style attribute
-
setMargin
public void setMargin(java.lang.String margin)
Sets themargin
style attribute.- Parameters:
margin
- the new attribute
-
getMarginBottom
public java.lang.String getMarginBottom()
Gets themarginBottom
style attribute.- Returns:
- the style attribute
-
setMarginBottom
public void setMarginBottom(java.lang.Object marginBottom)
Sets themarginBottom
style attribute.- Parameters:
marginBottom
- the new attribute
-
getMarginLeft
public java.lang.String getMarginLeft()
Gets themarginLeft
style attribute.- Returns:
- the style attribute
-
setMarginLeft
public void setMarginLeft(java.lang.Object marginLeft)
Sets themarginLeft
style attribute.- Parameters:
marginLeft
- the new attribute
-
getMarginRight
public java.lang.String getMarginRight()
Gets themarginRight
style attribute.- Returns:
- the style attribute
-
setMarginRight
public void setMarginRight(java.lang.Object marginRight)
Sets themarginRight
style attribute.- Parameters:
marginRight
- the new attribute
-
getMarginTop
public java.lang.String getMarginTop()
Gets themarginTop
style attribute.- Returns:
- the style attribute
-
setMarginTop
public void setMarginTop(java.lang.Object marginTop)
Sets themarginTop
style attribute.- Parameters:
marginTop
- the new attribute
-
getMaxHeight
public java.lang.String getMaxHeight()
Gets themaxHeight
style attribute.- Returns:
- the style attribute
-
setMaxHeight
public void setMaxHeight(java.lang.Object maxHeight)
Sets themaxHeight
style attribute.- Parameters:
maxHeight
- the new attribute
-
getMaxWidth
public java.lang.String getMaxWidth()
Gets themaxWidth
style attribute.- Returns:
- the style attribute
-
setMaxWidth
public void setMaxWidth(java.lang.Object maxWidth)
Sets themaxWidth
style attribute.- Parameters:
maxWidth
- the new attribute
-
getMinHeight
public java.lang.String getMinHeight()
Gets theminHeight
style attribute.- Returns:
- the style attribute
-
setMinHeight
public void setMinHeight(java.lang.Object minHeight)
Sets theminHeight
style attribute.- Parameters:
minHeight
- the new attribute
-
getMinWidth
public java.lang.String getMinWidth()
Gets theminWidth
style attribute.- Returns:
- the style attribute
-
setMinWidth
public void setMinWidth(java.lang.Object minWidth)
Sets theminWidth
style 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:
get
in interfaceorg.htmlunit.corejs.javascript.Scriptable
- Overrides:
get
in classHtmlUnitScriptable
-
get
public java.lang.Object get(int index, org.htmlunit.corejs.javascript.Scriptable start)
- Specified by:
get
in interfaceorg.htmlunit.corejs.javascript.Scriptable
- Overrides:
get
in 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:
put
in interfaceorg.htmlunit.corejs.javascript.Scriptable
- Overrides:
put
in classHtmlUnitScriptable
-
has
public boolean has(java.lang.String name, org.htmlunit.corejs.javascript.Scriptable start)
- Specified by:
has
in interfaceorg.htmlunit.corejs.javascript.Scriptable
- Overrides:
has
in classorg.htmlunit.corejs.javascript.ScriptableObject
-
getIds
public java.lang.Object[] getIds()
- Specified by:
getIds
in interfaceorg.htmlunit.corejs.javascript.Scriptable
- Overrides:
getIds
in classorg.htmlunit.corejs.javascript.ScriptableObject
-
getOpacity
public java.lang.String getOpacity()
Gets theopacity
style attribute.- Returns:
- the style attribute
-
setOpacity
public void setOpacity(java.lang.Object opacity)
Sets theopacity
style attribute.- Parameters:
opacity
- the new attribute
-
getOutline
public java.lang.String getOutline()
Gets theoutline
style attribute.- Returns:
- the style attribute
-
setOutline
public void setOutline(java.lang.String outline)
Sets theoutline
style attribute.- Parameters:
outline
- the new attribute
-
getOutlineWidth
public java.lang.String getOutlineWidth()
Gets theoutlineWidth
style attribute.- Returns:
- the style attribute
-
setOutlineWidth
public void setOutlineWidth(java.lang.Object outlineWidth)
Sets theoutlineWidth
style attribute.- Parameters:
outlineWidth
- the new attribute
-
getPadding
public java.lang.String getPadding()
Gets thepadding
style attribute.- Returns:
- the style attribute
-
setPadding
public void setPadding(java.lang.String padding)
Sets thepadding
style attribute.- Parameters:
padding
- the new attribute
-
getPaddingBottom
public java.lang.String getPaddingBottom()
Gets thepaddingBottom
style attribute.- Returns:
- the style attribute
-
setPaddingBottom
public void setPaddingBottom(java.lang.Object paddingBottom)
Sets thepaddingBottom
style attribute.- Parameters:
paddingBottom
- the new attribute
-
getPaddingLeft
public java.lang.String getPaddingLeft()
Gets thepaddingLeft
style attribute.- Returns:
- the style attribute
-
setPaddingLeft
public void setPaddingLeft(java.lang.Object paddingLeft)
Sets thepaddingLeft
style attribute.- Parameters:
paddingLeft
- the new attribute
-
getPaddingRight
public java.lang.String getPaddingRight()
Gets thepaddingRight
style attribute.- Returns:
- the style attribute
-
setPaddingRight
public void setPaddingRight(java.lang.Object paddingRight)
Sets thepaddingRight
style attribute.- Parameters:
paddingRight
- the new attribute
-
getPaddingTop
public java.lang.String getPaddingTop()
Gets thepaddingTop
style attribute.- Returns:
- the style attribute
-
setPaddingTop
public void setPaddingTop(java.lang.Object paddingTop)
Sets thepaddingTop
style attribute.- Parameters:
paddingTop
- the new attribute
-
getParentRule
public CSSRule getParentRule()
Returns the CSSRule that is the parent of this style block ornull
if this CSSStyleDeclaration is not attached to a CSSRule.- Returns:
- the CSSRule that is the parent of this style block or
null
if 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 theright
style attribute.- Returns:
- the style attribute
-
setRight
public void setRight(java.lang.Object right)
Sets theright
style attribute.- Parameters:
right
- the new attribute
-
getRubyAlign
public java.lang.String getRubyAlign()
Gets therubyAlign
style attribute.- Returns:
- the style attribute
-
setRubyAlign
public void setRubyAlign(java.lang.String rubyAlign)
Sets therubyAlign
style attribute.- Parameters:
rubyAlign
- the new attribute
-
getSize
public java.lang.String getSize()
Gets thesize
style attribute.- Returns:
- the style attribute
-
setSize
public void setSize(java.lang.String size)
Sets thesize
style attribute.- Parameters:
size
- the new attribute
-
getTextIndent
public java.lang.String getTextIndent()
Gets thetextIndent
style attribute.- Returns:
- the style attribute
-
setTextIndent
public void setTextIndent(java.lang.Object textIndent)
Sets thetextIndent
style attribute.- Parameters:
textIndent
- the new attribute
-
getTop
public java.lang.String getTop()
Gets thetop
style attribute.- Returns:
- the style attribute
-
setTop
public void setTop(java.lang.Object top)
Sets thetop
style attribute.- Parameters:
top
- the new attribute
-
getVerticalAlign
public java.lang.String getVerticalAlign()
Gets theverticalAlign
style attribute.- Returns:
- the style attribute
-
setVerticalAlign
public void setVerticalAlign(java.lang.Object verticalAlign)
Sets theverticalAlign
style attribute.- Parameters:
verticalAlign
- the new attribute
-
getWidth
public java.lang.String getWidth()
Gets thewidth
style attribute.- Returns:
- the style attribute
-
setWidth
public void setWidth(java.lang.Object width)
Sets thewidth
style attribute.- Parameters:
width
- the new attribute
-
getWidows
public java.lang.String getWidows()
Gets thewidows
style attribute.- Returns:
- the style attribute
-
setWidows
public void setWidows(java.lang.String widows)
Sets thewidows
style attribute.- Parameters:
widows
- the new attribute
-
getOrphans
public java.lang.String getOrphans()
Gets theorphans
style attribute.- Returns:
- the style attribute
-
setOrphans
public void setOrphans(java.lang.String orphans)
Sets theorphans
style attribute.- Parameters:
orphans
- the new attribute
-
getPosition
public java.lang.String getPosition()
Gets theposition
style attribute.- Returns:
- the style attribute
-
setPosition
public void setPosition(java.lang.String position)
Sets theposition
style attribute.- Parameters:
position
- the new attribute
-
getWordSpacing
public java.lang.String getWordSpacing()
Gets thewordSpacing
style attribute.- Returns:
- the style attribute
-
setWordSpacing
public void setWordSpacing(java.lang.Object wordSpacing)
Sets thewordSpacing
style attribute.- Parameters:
wordSpacing
- the new attribute
-
getZIndex
public java.lang.Object getZIndex()
Gets thezIndex
style attribute.- Returns:
- the style attribute
-
setZIndex
public void setZIndex(java.lang.Object zIndex)
Sets thezIndex
style 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:
toString
in 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
-
-