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.
See Also:
  • Field Details

    • INHERITABLE_DEFINITIONS

      private static final Set<StyleAttributes.Definition> INHERITABLE_DEFINITIONS
      The set of 'inheritable' definitions.
    • EMPTY_FINAL

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

      private Integer width_
      The computed, cached width of the element to which this computed style belongs (no padding, borders, etc.).
    • height_

      private Integer height_
      The computed, cached height of the element to which this computed style belongs (no padding, borders, etc.), taking child elements into account.
    • height2_

      private Integer height2_
      The computed, cached height of the element to which this computed style belongs (no padding, borders, etc.), not taking child elements into account.
    • paddingHorizontal_

      private Integer paddingHorizontal_
      The computed, cached horizontal padding (left + right) of the element to which this computed style belongs.
    • paddingVertical_

      private Integer paddingVertical_
      The computed, cached vertical padding (top + bottom) of the element to which this computed style belongs.
    • borderHorizontal_

      private Integer borderHorizontal_
      The computed, cached horizontal border (left + right) of the element to which this computed style belongs.
    • borderVertical_

      private Integer borderVertical_
      The computed, cached vertical border (top + bottom) of the element to which this computed style belongs.
    • top_

      private Integer top_
      The computed, cached top of the element to which this computed style belongs.
    • localModifications_

      private final SortedMap<String,StyleElement> localModifications_
      Local modifications maintained here rather than in the element. We use a sorted map so that results are deterministic and thus easily testable.
    • elementStyleDeclaration_

      private ElementCssStyleDeclaration elementStyleDeclaration_
      The wrapped CSSStyleDeclaration
  • 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 a 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
    • getStyleAttributeWorker

      private static String getStyleAttributeWorker(StyleAttributes.Definition definition, boolean getDefaultValueIfEmpty, BrowserVersion browserVersion, boolean feature, boolean isDefInheritable, ComputedCssStyleDeclaration[] queue)
    • getStyleAttribute

      private String getStyleAttribute(StyleAttributes.Definition definition, String toReturnIfEmptyOrDefault, String defaultValue)
      Parameters:
      toReturnIfEmptyOrDefault - the value to return if empty or equals the defaultValue
      defaultValue - the default value of the string
      Returns:
      the string, or toReturnIfEmptyOrDefault
    • 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()
      Overrides:
      getWidth in class AbstractCssStyleDeclaration
      Returns:
      the width
    • item

      public Object item(int index)
      Returns the item in the given index.
      Specified by:
      item in class AbstractCssStyleDeclaration
      Parameters:
      index - the index
      Returns:
      the item in the given 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()
    • 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
    • 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()
      Description copied from class: AbstractCssStyleDeclaration
      Gets the bottom style attribute.
      Overrides:
      getBottom in class AbstractCssStyleDeclaration
      Returns:
      the bottom setting
    • getColor

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

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

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

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

      public String getFontFamily()
      Description copied from class: AbstractCssStyleDeclaration
      Gets the fontFamily style attribute.
      Overrides:
      getFontFamily in class AbstractCssStyleDeclaration
      Returns:
      the font family setting
    • getFontSize

      public String getFontSize()
      Description copied from class: AbstractCssStyleDeclaration
      Gets the fontSize style attribute.
      Overrides:
      getFontSize in class AbstractCssStyleDeclaration
      Returns:
      the font size setting
    • getLineHeight

      public String getLineHeight()
      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()
      Overrides:
      getLeft in class AbstractCssStyleDeclaration
      Returns:
      the style attribute left
    • getLetterSpacing

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

      public String getMargin()
      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
    • getMarginX

      private String getMarginX(String superMarginX, StyleAttributes.Definition definition)
    • getMarginTop

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

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

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

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

      public String getMinWidth()
      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()
      Overrides:
      getOrphans in class AbstractCssStyleDeclaration
      Returns:
      the style attribute orphans
    • getOutlineWidth

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

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

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

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

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

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

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

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

      public String getTop()
      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
    • isBlock

      private static boolean isBlock(String display)
    • 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()
      Overrides:
      getVerticalAlign in class AbstractCssStyleDeclaration
      Returns:
      the style attribute verticalAlign
    • getWidows

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

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

      public Object 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()
      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
    • getTopForAbsolutePositionWithInheritance

      private int getTopForAbsolutePositionWithInheritance()
    • 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
    • getCalculatedHeight

      private int getCalculatedHeight()
      Returns the element's calculated height, taking both relevant CSS and the element's children into account.
      Returns:
      the element's calculated height, taking both relevant CSS and the element's children into account
    • 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

      private int getCalculatedWidth()
    • getContentWidth

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

      private int getEmptyHeight()
      Returns the element's calculated height taking relevant CSS into account, but not the element's child elements.
      Returns:
      the element's calculated height taking relevant CSS into account, but not the element's child elements
    • 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
    • isScrollable

      private boolean isScrollable(boolean horizontal, boolean ignoreSize)
      Parameters:
      ignoreSize - whether to consider the content/calculated width/height
    • getBorderHorizontal

      private int getBorderHorizontal()
    • getBorderVertical

      private int getBorderVertical()
    • 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
    • getPaddingHorizontal

      private int getPaddingHorizontal()
    • getPaddingVertical

      private int getPaddingVertical()
    • 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
    • setCachedWidth

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

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

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

      public Integer getCachedHeight2()
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Returns:
      the cached height2
    • setCachedHeight2

      public int setCachedHeight2(int height)
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Parameters:
      height - the new value
      Returns:
      the param height2
    • 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
    • setCachedPaddingHorizontal

      public int setCachedPaddingHorizontal(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
    • setCachedPaddingVertical

      public int setCachedPaddingVertical(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
    • setCachedBorderHorizontal

      public int setCachedBorderHorizontal(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
    • setCachedBorderVertical

      public int setCachedBorderVertical(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
    • applyLocalStyleAttribute

      private void applyLocalStyleAttribute(String name, String newValue, String priority, org.htmlunit.cssparser.parser.selector.SelectorSpecificity specificity)
    • 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()
      Specified by:
      getBrowserVersion in class AbstractCssStyleDeclaration
      Returns:
      the BrowserVersion
    • isComputed

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

      public String toString()
      Overrides:
      toString in class Object
    • defaultIfEmpty

      private String defaultIfEmpty(String str, StyleAttributes.Definition definition)
    • defaultIfEmpty

      private String defaultIfEmpty(String str, StyleAttributes.Definition definition, boolean isPixel)
    • defaultIfEmpty

      private String defaultIfEmpty(String str, String toReturnIfEmptyOrDefault, String defaultValue)
      Parameters:
      toReturnIfEmptyOrDefault - the value to return if empty or equals the defaultValue
      defaultValue - the default value of the string
      Returns:
      the string, or toReturnIfEmptyOrDefault
    • pixelString

      private static String pixelString(String value)
      Returns the specified length value as a pixel length value. This method does NOT handle percentages correctly; use
      invalid reference
      #pixelValue(Element, CssValue)
      if you need percentage support).
      Parameters:
      value - the length value to convert to a pixel length value
      Returns:
      the specified length value as a pixel length value
      See Also:
      • invalid reference
        #pixelString(Element, CSSStyleDeclaration.CssValue)