Class StyleReference
java.lang.Object
com.openhtmltopdf.context.StyleReference
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate SharedContextThe Context this StyleReference operates in; used for property resolution.private Documentprivate MatcherInstance of our element-styles matching class.private NamespaceHandlerprivate final StylesheetFactoryImplprivate UserAgentCallback -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.getCascadedStyle(Element e, boolean restyle) Gets the CascadedStyle for an element.Given an element, returns all selectors and their rulesets for its descendants.getPageStyle(String pageName, String pseudoPage) getPseudoElementStyle(Node node, String pseudoElement) Gets the pseudoElementStyle attribute of the StyleReference objectGets the style of the root element, should be html tag.private List<StylesheetInfo> Gets StylesheetInfos for all stylesheets and inline styles associated with the current document.booleanprivate List<Stylesheet> readAndParseAll(List<StylesheetInfo> infos, String medium) voidsetDocumentContext(SharedContext context, NamespaceHandler nsh, Document doc, UserInterface ui) Sets the documentContext attribute of the StyleReference objectvoidsetSupportCMYKColors(boolean b) voidsetUserAgentCallback(UserAgentCallback userAgentCallback)
-
Field Details
-
_context
The Context this StyleReference operates in; used for property resolution. -
_nsh
-
_doc
-
_stylesheetFactory
-
_matcher
Instance of our element-styles matching class. Will be null if new rules have been added since last match. -
_uac
-
-
Constructor Details
-
StyleReference
-
-
Method Details
-
getRootElementStyle
Gets the style of the root element, should be html tag. -
readAndParseAll
-
isHoverStyled
-
getCascadedPropertiesMap
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
Gets the pseudoElementStyle attribute of the StyleReference object- Parameters:
node- PARAMpseudoElement- PARAM- Returns:
- The pseudoElementStyle value
-
getCascadedStyle
Gets the CascadedStyle for an element. This must then be converted in the current context to a CalculatedStyle (use getDerivedStyle)- Parameters:
e- The elementrestyle-- Returns:
- The style value
-
getCSSForAllDescendants
-
getPageStyle
-
getStylesheets
Gets StylesheetInfos for all stylesheets and inline styles associated with the current document. Default (user agent) stylesheet and the inline style for the current media are loaded in the StyleSheetFactory by URI.- Returns:
- The stylesheets value
-
getFontFaceRules
-
setUserAgentCallback
-
setSupportCMYKColors
public void setSupportCMYKColors(boolean b)
-