JavaScript is disabled on your browser.
Skip navigation links
org.htmlunit.css

Class ComputedCssStyleDeclaration

    • Field Detail

      • EMPTY_FINAL

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

      • 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
      • 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
      • 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
      • 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
      • 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
      • 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
      • 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
      • 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
      • 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
Skip navigation links

Copyright © 2002–2025 Gargoyle Software Inc.. All rights reserved.

AltStyle によって変換されたページ (->オリジナル) /