Package io.sf.carte.doc.style.css
Interface DocumentCSSStyleSheet
- All Superinterfaces:
CSSStyleSheet<AbstractCSSRule>
,org.w3c.dom.css.CSSStyleSheet
,org.w3c.dom.stylesheets.StyleSheet
- All Known Implementing Classes:
BaseDocumentCSSStyleSheet
,DOMDocumentCSSStyleSheet
A style sheet that is able to take the responsibility to compute the styles associated
to document elements.
Accordingly, it has a target medium (which can be null
) and has abilities
that 'normal' style sheets do not have, like dealing with rules that have different
origins (author, user, etc).
-
Field Summary
Fields inherited from interface io.sf.carte.doc.style.css.CSSStyleSheet
COMMENTS_AUTO, COMMENTS_IGNORE, COMMENTS_PRECEDING
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Clone this style sheet.Clone this style sheet, but only preserving rules targeting the given medium.getComputedStyle
(CSSElement elm, Condition pseudoElt) Gets the computed style for the given Element and pseudo-element in the DOM Document associated to this style sheet.Gets the target medium for this sheet.void
registerProperty
(CSSPropertyDefinition definition) Registers the definition of a custom property.Methods inherited from interface io.sf.carte.doc.style.css.CSSStyleSheet
addRule, addStyleSheet, createCounterStyleRule, createFontFaceRule, createFontFeatureValuesRule, createImportRule, createKeyframesRule, createMarginRule, createMediaRule, createNamespaceRule, createPageRule, createPropertyRule, createStyleDeclaration, createStyleRule, createSupportsRule, createUnknownRule, createViewportRule, getCssRules, getErrorHandler, getMedia, getRulesForProperty, getSelectorsForProperty, getStyleSheetFactory, hasRuleErrorsOrWarnings, parseStyleSheet, parseStyleSheet
Methods inherited from interface org.w3c.dom.css.CSSStyleSheet
deleteRule, getOwnerRule, insertRule
Methods inherited from interface org.w3c.dom.stylesheets.StyleSheet
getDisabled, getHref, getOwnerNode, getParentStyleSheet, getTitle, getType, setDisabled
-
Method Details
-
getTargetMedium
String getTargetMedium()Gets the target medium for this sheet.- Returns:
- the target medium, or null if has not been set.
-
getComputedStyle
Gets the computed style for the given Element and pseudo-element in the DOM Document associated to this style sheet.- Parameters:
elm
- the element.pseudoElt
- the pseudo-element condition.- Returns:
- the computed style declaration.
-
registerProperty
Registers the definition of a custom property.- Parameters:
definition
- the definition.
-
clone
DocumentCSSStyleSheet clone()Clone this style sheet.- Specified by:
clone
in interfaceCSSStyleSheet<AbstractCSSRule>
- Returns:
- the cloned style sheet.
-
clone
Clone this style sheet, but only preserving rules targeting the given medium.- Parameters:
targetMedium
- the medium.- Returns:
- a medium-specific pseudo-clone of this sheet.
-