Module org.htmlunit

Class ComputedCssStyleDeclaration

java.lang.Object
org.htmlunit.css.AbstractCssStyleDeclaration
org.htmlunit.css.ComputedCssStyleDeclaration
All Implemented Interfaces:
Serializable

public class ComputedCssStyleDeclaration extends AbstractCssStyleDeclaration
An object for a CSSStyleDeclaration, which is computed.
Author:
Ahmed Ashour, Marc Guillemot, Ronald Brill, Frank Danek, Alex Gorbatovsky, cd alexndr
See Also:
  • Field Details

    • EMPTY_FINAL

      public static final String EMPTY_FINAL
      Denotes a value which should be returned as is.
  • Constructor Details

  • Method Details

    • getStylePriority

      public String getStylePriority(String name)
      Returns the priority of the named style attribute, or an empty string if it is not found.
      Specified by:
      getStylePriority in class AbstractCssStyleDeclaration
      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
    • getCssText

      public String getCssText()
      Returns the actual text of the style.
      Specified by:
      getCssText in class AbstractCssStyleDeclaration
      Returns:
      the actual text of the style
    • getStyleAttribute

      public String getStyleAttribute(String name)
      Get the value for the style attribute.
      Specified by:
      getStyleAttribute in class AbstractCssStyleDeclaration
      Parameters:
      name - the name
      Returns:
      the value
    • getStyleAttribute

      public String getStyleAttribute(StyleAttributes.Definition definition, boolean getDefaultValueIfEmpty)
      Get the value for the style attribute. This impl ignores the default getDefaultValueIfEmpty flag, but there is an overload in ComputedCssStyleDeclaration.
      Specified by:
      getStyleAttribute in class AbstractCssStyleDeclaration
      Parameters:
      definition - the definition
      getDefaultValueIfEmpty - whether to get the default value if empty or not
      Returns:
      the value
    • setCssText

      public void setCssText(String value)
      Sets the actual text of the style.
      Specified by:
      setCssText in class AbstractCssStyleDeclaration
      Parameters:
      value - the new text
    • setStyleAttribute

      public void setStyleAttribute(String name, String newValue, String important)
      Sets the specified style attribute.
      Specified by:
      setStyleAttribute in class AbstractCssStyleDeclaration
      Parameters:
      name - the attribute name (camel-cased)
      newValue - the attribute value
      important - important value
    • removeStyleAttribute

      public String removeStyleAttribute(String name)
      Removes the specified style attribute, returning the value of the removed attribute.
      Specified by:
      removeStyleAttribute in class AbstractCssStyleDeclaration
      Parameters:
      name - the attribute name (delimiter-separated, not camel-cased)
      Returns:
      the removed value
    • getLength

      public int getLength()
      Returns the length property.
      Specified by:
      getLength in class AbstractCssStyleDeclaration
      Returns:
      the length property
    • getWidth

      public String getWidth()
      Returns the width.
      Overrides:
      getWidth in class AbstractCssStyleDeclaration
      Returns:
      the width
    • item

      public String item(int index)
      Returns the name of the CSS property at the specified index.
      Specified by:
      item in class AbstractCssStyleDeclaration
      Parameters:
      index - the index
      Returns:
      the name of the CSS property at the specified index
    • getParentRule

      public 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.
      Specified by:
      getParentRule in class AbstractCssStyleDeclaration
      Returns:
      the CSSRule that is the parent of this style block or null if this CSSStyleDeclaration is not attached to a CSSRule
    • getStyleElement

      public StyleElement getStyleElement(String name)
      Determines the StyleElement for the given name.
      Specified by:
      getStyleElement in class AbstractCssStyleDeclaration
      Parameters:
      name - the name of the requested StyleElement
      Returns:
      the StyleElement or null if not found
    • getStyleElementCaseInSensitive

      public StyleElement getStyleElementCaseInSensitive(String name)
      Determines the StyleElement for the given name. This ignores the case of the name.
      Specified by:
      getStyleElementCaseInSensitive in class AbstractCssStyleDeclaration
      Parameters:
      name - the name of the requested StyleElement
      Returns:
      the StyleElement or null if not found
    • getStyleMap

      public Map<String,StyleElement> getStyleMap()
      Returns a sorted map containing style elements, keyed on style element name. We use a LinkedHashMap map so that results are deterministic and are thus testable.
      Specified by:
      getStyleMap in class AbstractCssStyleDeclaration
      Returns:
      a sorted map containing style elements, keyed on style element name
    • getDomElement

      public DomElement getDomElement()
      Returns the DomElement the backing ElementCssStyleDeclaration is associated with.
      Returns:
      the DomElement the backing ElementCssStyleDeclaration is associated with
    • getBackgroundAttachment

      public String getBackgroundAttachment()
      Gets the backgroundAttachment style attribute.
      Overrides:
      getBackgroundAttachment in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getBackgroundColor

      public String getBackgroundColor()
      Gets the backgroundColor style attribute.
      Overrides:
      getBackgroundColor in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getBackgroundImage

      public String getBackgroundImage()
      Gets the backgroundImage style attribute.
      Overrides:
      getBackgroundImage in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getBackgroundPosition

      public String getBackgroundPosition()
      Gets the backgroundPosition style attribute.
      Overrides:
      getBackgroundPosition in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getBackgroundRepeat

      public String getBackgroundRepeat()
      Gets the backgroundRepeat style attribute.
      Overrides:
      getBackgroundRepeat in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getBlockSize

      public String getBlockSize()
      Gets the blockSize style attribute.
      Overrides:
      getBlockSize in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getBorderBottomColor

      public String getBorderBottomColor()
      Gets the borderBottomColor style attribute.
      Overrides:
      getBorderBottomColor in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getBorderBottomStyle

      public String getBorderBottomStyle()
      Gets the borderBottomStyle style attribute.
      Overrides:
      getBorderBottomStyle in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getBorderBottomWidth

      public String getBorderBottomWidth()
      Gets the borderBottomWidth style attribute.
      Overrides:
      getBorderBottomWidth in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getBorderLeftColor

      public String getBorderLeftColor()
      Gets the borderLeftColor style attribute.
      Overrides:
      getBorderLeftColor in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getBorderLeftStyle

      public String getBorderLeftStyle()
      Gets the borderLeftStyle style attribute.
      Overrides:
      getBorderLeftStyle in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getBorderLeftWidth

      public String getBorderLeftWidth()
      Gets the borderLeftWidth style attribute.
      Overrides:
      getBorderLeftWidth in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getBorderRightColor

      public String getBorderRightColor()
      Gets the borderRightColor style attribute.
      Overrides:
      getBorderRightColor in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getBorderRightStyle

      public String getBorderRightStyle()
      Gets the borderRightStyle style attribute.
      Overrides:
      getBorderRightStyle in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getBorderRightWidth

      public String getBorderRightWidth()
      Gets the borderRightWidth style attribute.
      Overrides:
      getBorderRightWidth in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getBorderTopColor

      public String getBorderTopColor()
      Gets the borderTopColor style attribute.
      Overrides:
      getBorderTopColor in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getBorderTopStyle

      public String getBorderTopStyle()
      Gets the borderTopStyle style attribute.
      Overrides:
      getBorderTopStyle in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getBorderTopWidth

      public String getBorderTopWidth()
      Gets the borderTopWidth style attribute.
      Overrides:
      getBorderTopWidth in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getBottom

      public String getBottom()
      Gets the bottom style attribute.
      Overrides:
      getBottom in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getColor

      public String getColor()
      Gets the color style attribute.
      Overrides:
      getColor in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getCssFloat

      public String getCssFloat()
      Gets the cssFloat style attribute.
      Overrides:
      getCssFloat in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getDisplay

      public String getDisplay()
      Gets the display style attribute.
      Overrides:
      getDisplay in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getFont

      public String getFont()
      Gets the font style attribute.
      Overrides:
      getFont in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getFontFamily

      public String getFontFamily()
      Gets the fontFamily style attribute.
      Overrides:
      getFontFamily in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getFontSize

      public String getFontSize()
      Gets the fontSize style attribute.
      Overrides:
      getFontSize in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getLineHeight

      public String getLineHeight()
      Returns the style attribute letterSpacing.
      Overrides:
      getLineHeight in class AbstractCssStyleDeclaration
      Returns:
      the style attribute lineHeight
    • getHeight

      public String getHeight()
      Gets the height style attribute.
      Overrides:
      getHeight in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getLeft

      public String getLeft()
      Returns the style attribute left.
      Overrides:
      getLeft in class AbstractCssStyleDeclaration
      Returns:
      the style attribute left
    • getLetterSpacing

      public String getLetterSpacing()
      Returns the style attribute letterSpacing.
      Overrides:
      getLetterSpacing in class AbstractCssStyleDeclaration
      Returns:
      the style attribute letterSpacing
    • getMargin

      public String getMargin()
      Gets the margin style attribute.
      Overrides:
      getMargin in class AbstractCssStyleDeclaration
      Returns:
      the style attribute margin
    • getMarginBottom

      public String getMarginBottom()
      Gets the marginBottom style attribute.
      Overrides:
      getMarginBottom in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getMarginLeft

      public String getMarginLeft()
      Gets the marginLeft style attribute.
      Overrides:
      getMarginLeft in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getMarginRight

      public String getMarginRight()
      Gets the marginRight style attribute.
      Overrides:
      getMarginRight in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getMarginTop

      public String getMarginTop()
      Gets the marginTop style attribute.
      Overrides:
      getMarginTop in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getMaxHeight

      public String getMaxHeight()
      Gets the maxHeight style attribute.
      Overrides:
      getMaxHeight in class AbstractCssStyleDeclaration
      Returns:
      the style attribute maxHeight
    • getMaxWidth

      public String getMaxWidth()
      Gets the maxWidth style attribute.
      Overrides:
      getMaxWidth in class AbstractCssStyleDeclaration
      Returns:
      the style attribute maxWidth
    • getMinHeight

      public String getMinHeight()
      Gets the minHeight style attribute.
      Overrides:
      getMinHeight in class AbstractCssStyleDeclaration
      Returns:
      the style attribute minHeight
    • getMinWidth

      public String getMinWidth()
      Gets the minWidth style attribute.
      Overrides:
      getMinWidth in class AbstractCssStyleDeclaration
      Returns:
      the style attribute minWidth
    • getOpacity

      public String getOpacity()
      Gets the opacity style attribute.
      Overrides:
      getOpacity in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getOrphans

      public String getOrphans()
      Gets the orphans style attribute.
      Overrides:
      getOrphans in class AbstractCssStyleDeclaration
      Returns:
      the style attribute orphans
    • getOutlineWidth

      public String getOutlineWidth()
      Gets the outlineWidth style attribute.
      Overrides:
      getOutlineWidth in class AbstractCssStyleDeclaration
      Returns:
      the style attribute outlineWidth
    • getPadding

      public String getPadding()
      Gets the padding style attribute.
      Overrides:
      getPadding in class AbstractCssStyleDeclaration
      Returns:
      the style attribute padding
    • getPaddingBottom

      public String getPaddingBottom()
      Gets the paddingBottom style attribute.
      Overrides:
      getPaddingBottom in class AbstractCssStyleDeclaration
      Returns:
      the style attribute paddingBottom
    • getPaddingLeft

      public String getPaddingLeft()
      Gets the paddingLeft style attribute.
      Overrides:
      getPaddingLeft in class AbstractCssStyleDeclaration
      Returns:
      the style attribute paddingLeft
    • getPaddingRight

      public String getPaddingRight()
      Gets the paddingRight style attribute.
      Overrides:
      getPaddingRight in class AbstractCssStyleDeclaration
      Returns:
      the style attribute paddingRight
    • getPaddingTop

      public String getPaddingTop()
      Gets the paddingTop style attribute.
      Overrides:
      getPaddingTop in class AbstractCssStyleDeclaration
      Returns:
      the style attribute paddingTop
    • getRight

      public String getRight()
      Gets the right style attribute.
      Overrides:
      getRight in class AbstractCssStyleDeclaration
      Returns:
      the style attribute right
    • getTextIndent

      public String getTextIndent()
      Gets the textIndent style attribute.
      Overrides:
      getTextIndent in class AbstractCssStyleDeclaration
      Returns:
      the style attribute textIndent
    • getTop

      public String getTop()
      Gets the top style attribute.
      Overrides:
      getTop in class AbstractCssStyleDeclaration
      Returns:
      the style attribute top
    • getTop

      public int getTop(boolean includeMargin, boolean includeBorder, boolean includePadding)
      Returns the computed top (Y coordinate), relative to the node's parent's top edge.
      Parameters:
      includeMargin - whether or not to take the margin into account in the calculation
      includeBorder - whether or not to take the border into account in the calculation
      includePadding - whether or not to take the padding into account in the calculation
      Returns:
      the computed top (Y coordinate), relative to the node's parent's top edge
    • getTopWithInheritance

      public String getTopWithInheritance()
      Returns the CSS top attribute, replacing inherited values with the actual parent values.
      Returns:
      the CSS top attribute, replacing inherited values with the actual parent values
    • getBottomWithInheritance

      public String getBottomWithInheritance()
      Returns the CSS bottom attribute, replacing inherited values with the actual parent values.
      Returns:
      the CSS bottom attribute, replacing inherited values with the actual parent values
    • getVerticalAlign

      public String getVerticalAlign()
      Gets the verticalAlign style attribute.
      Overrides:
      getVerticalAlign in class AbstractCssStyleDeclaration
      Returns:
      the style attribute verticalAlign
    • getWidows

      public String getWidows()
      Gets the widows style attribute.
      Overrides:
      getWidows in class AbstractCssStyleDeclaration
      Returns:
      the style attribute widows
    • getWordSpacing

      public String getWordSpacing()
      Gets the wordSpacing style attribute.
      Overrides:
      getWordSpacing in class AbstractCssStyleDeclaration
      Returns:
      the style attribute wordSpacing
    • getZIndex

      public String getZIndex()
      Gets the zIndex style attribute.
      Overrides:
      getZIndex in class AbstractCssStyleDeclaration
      Returns:
      the style attribute
    • getMarginLeftValue

      public int getMarginLeftValue()
      Gets the left margin of the element.
      Returns:
      the value in pixels
    • getMarginRightValue

      public int getMarginRightValue()
      Gets the right margin of the element.
      Returns:
      the value in pixels
    • getMarginTopValue

      public int getMarginTopValue()
      Gets the top margin of the element.
      Returns:
      the value in pixels
    • getMarginBottomValue

      public int getMarginBottomValue()
      Gets the bottom margin of the element.
      Returns:
      the value in pixels
    • getLeft

      public int getLeft(boolean includeMargin, boolean includeBorder, boolean includePadding)
      Returns the computed left (X coordinate), relative to the node's parent's left edge.
      Parameters:
      includeMargin - whether or not to take the margin into account in the calculation
      includeBorder - whether or not to take the border into account in the calculation
      includePadding - whether or not to take the padding into account in the calculation
      Returns:
      the computed left (X coordinate), relative to the node's parent's left edge
    • getPosition

      public String getPosition()
      Gets the position style attribute.
      Overrides:
      getPosition in class AbstractCssStyleDeclaration
      Returns:
      the style attribute position
    • getPositionWithInheritance

      public String getPositionWithInheritance()
      Returns the CSS position attribute, replacing inherited values with the actual parent values.
      Returns:
      the CSS position attribute, replacing inherited values with the actual parent values
    • getLeftWithInheritance

      public String getLeftWithInheritance()
      Returns the CSS left attribute, replacing inherited values with the actual parent values.
      Returns:
      the CSS left attribute, replacing inherited values with the actual parent values
    • getRightWithInheritance

      public String getRightWithInheritance()
      Returns the CSS right attribute, replacing inherited values with the actual parent values.
      Returns:
      the CSS right attribute, replacing inherited values with the actual parent values
    • getCalculatedHeight

      public int getCalculatedHeight(boolean includeBorder, boolean includePadding)
      Returns the element's height, possibly including its padding and border.
      Parameters:
      includeBorder - whether or not to include the border height in the returned value
      includePadding - whether or not to include the padding height in the returned value
      Returns:
      the element's height, possibly including its padding and border
    • getCalculatedWidth

      public int getCalculatedWidth(boolean includeBorder, boolean includePadding)
      Returns the element's width in pixels, possibly including its padding and border.
      Parameters:
      includeBorder - whether or not to include the border width in the returned value
      includePadding - whether or not to include the padding width in the returned value
      Returns:
      the element's width in pixels, possibly including its padding and border
    • getCalculatedWidth

      public int getCalculatedWidth(boolean includeBorder, boolean includePadding, boolean shrinkWrapBlock)
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.

      Returns the calculated width of this element in pixels.

      This method is the primary entry point for width calculation and is used by both offsetWidth/clientWidth and getBoundingClientRect(). The shrinkWrapBlock flag controls how block elements with no explicit width are sized:

      • false (normal flow): block elements fill their containing block's width, matching the behaviour of offsetWidth and clientWidth.
      • true (shrink-wrap): block elements that contain only inline/text children shrink to their content width instead of filling the parent. This is used by getBoundingClientRect() to approximate the visual bounding box of elements such as a plain <div>HelloWorld</div>, where the rendered width is the text width rather than the viewport width.

      Note that shrink-wrapping is only applied when shrinkWrapBlock is true AND the element has exclusively inline or text-node children (hasOnlyInlineOrTextChildren(org.htmlunit.html.DomElement)). Elements with block-level children always fill the parent width regardless of this flag, because their children may themselves expand to fill the available space.

      The includeBorder and includePadding flags control whether the element's border and padding are added to the returned value, corresponding to the difference between clientWidth (padding included, border excluded) and offsetWidth (both included).

      Parameters:
      includeBorder - true to add horizontal border widths to the result
      includePadding - true to add horizontal padding to the result
      shrinkWrapBlock - true to shrink-wrap block elements to their content width when they contain only inline/text children; false for normal block flow where block elements fill the containing block width
      Returns:
      the calculated width in pixels
    • getContentWidth

      public int getContentWidth()
      Returns the total width of the element's children.
      Returns:
      the total width of the element's children
    • getContentHeight

      public int getContentHeight()
      Returns the total height of the element's children.
      Returns:
      the total height of the element's children
    • isScrollable

      public boolean isScrollable(boolean horizontal)
      Returns true if the element is scrollable along the specified axis.
      Parameters:
      horizontal - if true, the caller is interested in scrollability along the x-axis; if false, the caller is interested in scrollability along the y-axis
      Returns:
      true if the element is scrollable along the specified axis
    • getBorderLeftValue

      public int getBorderLeftValue()
      Gets the size of the left border of the element.
      Returns:
      the value in pixels
    • getBorderRightValue

      public int getBorderRightValue()
      Gets the size of the right border of the element.
      Returns:
      the value in pixels
    • getBorderTopValue

      public int getBorderTopValue()
      Gets the size of the top border of the element.
      Returns:
      the value in pixels
    • getBorderBottomValue

      public int getBorderBottomValue()
      Gets the size of the bottom border of the element.
      Returns:
      the value in pixels
    • getPaddingLeftValue

      public int getPaddingLeftValue()
      Gets the left padding of the element.
      Returns:
      the value in pixels
    • getPaddingRightValue

      public int getPaddingRightValue()
      Gets the right padding of the element.
      Returns:
      the value in pixels
    • getPaddingTopValue

      public int getPaddingTopValue()
      Gets the top padding of the element.
      Returns:
      the value in pixels
    • getPaddingBottomValue

      public int getPaddingBottomValue()
      Gets the bottom padding of the element.
      Returns:
      the value in pixels
    • getCachedWidth

      public Integer getCachedWidth()
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Returns:
      the cached width
    • updateCachedWidth

      public int updateCachedWidth(int width)
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Parameters:
      width - the new value
      Returns:
      the param width
    • getCachedShrinkWrapWidth

      public Integer getCachedShrinkWrapWidth()
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Returns:
      the cached width
    • updateCachedShrinkWrapWidth

      public int updateCachedShrinkWrapWidth(int width)
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Parameters:
      width - the new value
      Returns:
      the param width
    • getCachedContentWidth

      public Integer getCachedContentWidth()
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Returns:
      the cached content width
    • updateCachedContentWidth

      public int updateCachedContentWidth(int contentWidth)
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Parameters:
      contentWidth - the new value
      Returns:
      the param contentWidth
    • getCachedHeight

      public Integer getCachedHeight()
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Returns:
      the cached height
    • updateCachedHeight

      public int updateCachedHeight(int height)
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Parameters:
      height - the new value
      Returns:
      the param height
    • getCachedEmptyHeight

      public Integer getCachedEmptyHeight()
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Returns:
      the cached emptyHeight
    • updateCachedEmptyHeight

      public int updateCachedEmptyHeight(int emptyHeight)
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Parameters:
      emptyHeight - the new value
      Returns:
      the param emptyHeight
    • getCachedTop

      public Integer getCachedTop()
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Returns:
      the cached top
    • setCachedTop

      public void setCachedTop(Integer top)
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Parameters:
      top - the new value
    • getCachedPaddingHorizontal

      public Integer getCachedPaddingHorizontal()
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Returns:
      the cached padding horizontal
    • updateCachedPaddingHorizontal

      public int updateCachedPaddingHorizontal(int paddingHorizontal)
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Parameters:
      paddingHorizontal - the new value
      Returns:
      the param paddingHorizontal
    • getCachedPaddingVertical

      public Integer getCachedPaddingVertical()
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Returns:
      the cached padding vertical
    • updateCachedPaddingVertical

      public int updateCachedPaddingVertical(int paddingVertical)
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Parameters:
      paddingVertical - the new value
      Returns:
      the param paddingVertical
    • getCachedBorderHorizontal

      public Integer getCachedBorderHorizontal()
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Returns:
      the cached border horizontal
    • updateCachedBorderHorizontal

      public int updateCachedBorderHorizontal(int borderHorizontal)
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Parameters:
      borderHorizontal - the new value
      Returns:
      the param borderHorizontal
    • getCachedBorderVertical

      public Integer getCachedBorderVertical()
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Returns:
      the cached border vertical
    • updateCachedBorderVertical

      public int updateCachedBorderVertical(int borderVertical)
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Parameters:
      borderVertical - the new value
      Returns:
      the param borderVertical
    • applyStyleFromSelector

      public void applyStyleFromSelector(org.htmlunit.cssparser.dom.CSSStyleDeclarationImpl declaration, org.htmlunit.cssparser.parser.selector.Selector selector)
      Makes a local, "computed", modification to this CSS style.
      Parameters:
      declaration - the style declaration
      selector - the selector determining that the style applies to this element
    • setDefaultLocalStyleAttribute

      public void setDefaultLocalStyleAttribute(String name, String newValue)
      Makes a local, "computed", modification to this CSS style that won't override other style attributes of the same name. This method should be used to set default values for style attributes.
      Parameters:
      name - the name of the style attribute to set
      newValue - the value of the style attribute to set
    • hasFeature

      public boolean hasFeature(BrowserVersionFeatures property)
      Indicates if the browser this is associated with has the feature.
      Specified by:
      hasFeature in class AbstractCssStyleDeclaration
      Parameters:
      property - the property name
      Returns:
      false if this browser doesn't have this feature
    • getBrowserVersion

      public BrowserVersion getBrowserVersion()
      Returns the the BrowserVersion.
      Specified by:
      getBrowserVersion in class AbstractCssStyleDeclaration
      Returns:
      the BrowserVersion
    • isComputed

      public boolean isComputed()
      Returns true if this is a computed style declaration.
      Overrides:
      isComputed in class AbstractCssStyleDeclaration
      Returns:
      true if this is a computed style declaration
    • toString

      public String toString()
      Overrides:
      toString in class Object