Package com.openhtmltopdf.context
Class StyleReference
- java.lang.Object
-
- com.openhtmltopdf.context.StyleReference
-
public class StyleReference extends Object
- Author:
- Torbjoern Gannholm
-
-
Constructor Summary
Constructors Constructor Description StyleReference(UserAgentCallback userAgent)
-
Method Summary
Modifier and Type Method Description voidflushAllStyleSheets()Deprecated.voidflushStyleSheets()Deprecated.Map<String,CSSPrimitiveValue>getCascadedPropertiesMap(Element e)Deprecated.CascadedStylegetCascadedStyle(Element e, boolean restyle)Gets the CascadedStyle for an element.List<FontFaceRule>getFontFaceRules()PageInfogetPageStyle(String pageName, String pseudoPage)CascadedStylegetPseudoElementStyle(Node node, String pseudoElement)Gets the pseudoElementStyle attribute of the StyleReference objectbooleanisHoverStyled(Element e)voidremoveStyle(Element e)Deprecated.voidsetDocumentContext(SharedContext context, NamespaceHandler nsh, Document doc, UserInterface ui)Sets the documentContext attribute of the StyleReference objectvoidsetSupportCMYKColors(boolean b)voidsetUserAgentCallback(UserAgentCallback userAgentCallback)
-
-
-
Constructor Detail
-
StyleReference
public StyleReference(UserAgentCallback userAgent)
-
-
Method Detail
-
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 valuensh- The new documentContext valuedoc- The new documentContext valueui-
-
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- PARAMpseudoElement- 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 elementrestyle-- Returns:
- The style value
-
flushStyleSheets
@Deprecated public void flushStyleSheets()
Deprecated.Flushes any stylesheet associated with this stylereference (based on the user agent callback) that are in cache. Deprecated for now, until we fix caching, use a newStylesheetFactoryeach run.
-
flushAllStyleSheets
@Deprecated public void flushAllStyleSheets()
Deprecated.
-
removeStyle
@Deprecated public void removeStyle(Element e)
Deprecated.
-
getFontFaceRules
public List<FontFaceRule> getFontFaceRules()
-
setUserAgentCallback
public void setUserAgentCallback(UserAgentCallback userAgentCallback)
-
setSupportCMYKColors
public void setSupportCMYKColors(boolean b)
-
-