Class StyleReference


  • public class StyleReference
    extends Object
    Author:
    Torbjoern Gannholm
    • Method Detail

      • getRootElementStyle

        public CalculatedStyle getRootElementStyle()
        Gets the style of the root element, should be html tag.
      • setDocumentContext

        public void setDocumentContext​(SharedContext context,
                                       NamespaceHandler nsh,
                                       Document doc,
                                       UserInterface ui)
        Sets the documentContext attribute of the StyleReference object
        Parameters:
        context - The new documentContext value
        nsh - The new documentContext value
        doc - The new documentContext value
        ui -
      • isHoverStyled

        public boolean isHoverStyled​(Element e)
      • getCascadedPropertiesMap

        @Deprecated
        public Map<String,​CSSPrimitiveValue> getCascadedPropertiesMap​(Element e)
        Deprecated.
        Returns a Map keyed by CSS property names (e.g. 'border-width'), and the assigned value as a SAC CSSValue instance. The properties should have been matched to the element when the Context was established for this StyleReference on the Document to which the Element belongs. Only used by broken DOM inspector.
        Parameters:
        e - The DOM Element for which to find properties
        Returns:
        Map of CSS property names to CSSValue instance assigned to it.
      • getPseudoElementStyle

        public CascadedStyle getPseudoElementStyle​(Node node,
                                                   String pseudoElement)
        Gets the pseudoElementStyle attribute of the StyleReference object
        Parameters:
        node - PARAM
        pseudoElement - PARAM
        Returns:
        The pseudoElementStyle value
      • getCascadedStyle

        public CascadedStyle getCascadedStyle​(Element e,
                                              boolean restyle)
        Gets the CascadedStyle for an element. This must then be converted in the current context to a CalculatedStyle (use getDerivedStyle)
        Parameters:
        e - The element
        restyle -
        Returns:
        The style value
      • getCSSForAllDescendants

        public String getCSSForAllDescendants​(Element e)
        Given an element, returns all selectors and their rulesets for its descendants. Useful for getting the styles that should be applied to SVG, etc.
      • setUserAgentCallback

        public void setUserAgentCallback​(UserAgentCallback userAgentCallback)
      • setSupportCMYKColors

        public void setSupportCMYKColors​(boolean b)