java.lang.Object
io.sf.carte.doc.style.css.om.AbstractStyleSheet
io.sf.carte.doc.style.css.om.AbstractCSSStyleSheet
io.sf.carte.doc.style.css.om.BaseCSSStyleSheet
io.sf.carte.doc.style.css.om.BaseDocumentCSSStyleSheet
- All Implemented Interfaces:
DocumentCSSStyleSheet
,ExtendedCSSStyleSheet<AbstractCSSRule>
,Cloneable
,CSSStyleSheet
,StyleSheet
- Direct Known Subclasses:
DOMDocumentCSSStyleSheet
public abstract class BaseDocumentCSSStyleSheet
extends BaseCSSStyleSheet
implements DocumentCSSStyleSheet, Cloneable
Base implementation for
DocumentCSSStyleSheet
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract BaseDocumentCSSStyleSheet
clone()
Clone this style sheet.abstract BaseDocumentCSSStyleSheet
Clone this style sheet, but only preserving rules targeting the given medium.protected ComputedCSSStyle
computeStyle
(ComputedCSSStyle style, SelectorMatcher matcher, String pseudoElt, InlineStyle inlineStyle) Compute the style for an element.protected void
abstract ComputedCSSStyle
getComputedStyle
(CSSElement elm, String pseudoElt) Gets the computed style for the given element and pseudo-element.getHref()
abstract CSSDocument
Gets the target medium for this sheet.void
abstract void
setOwnerDocument
(CSSDocument ownerNode) Methods inherited from class io.sf.carte.doc.style.css.om.BaseCSSStyleSheet
addLocalRule, addRule, addStyleSheet, copyAllTo, copyFieldsTo, copyRulesTo, createCounterStyleRule, createFontFaceRule, createFontFeatureValuesRule, createImportRule, createKeyframesRule, createMarginRule, createMediaRule, createNamespaceRule, createPageRule, createStyleDeclaration, createStyleDeclaration, createStyleRule, createSupportsRule, createUnknownRule, createViewportRule, deleteRule, getCssRules, getDisabled, getDocumentErrorHandler, getErrorHandler, getMedia, getNamespacePrefix, getOrigin, getOwnerRule, getParentStyleSheet, getRulesForProperty, getSelectorsForProperty, getSelectorsForPropertyValue, getStyleSheetFactory, getType, hasDefaultNamespace, hasRuleErrorsOrWarnings, insertRule, loadStyleSheet, parseStyleSheet, parseStyleSheet, registerNamespace, setDisabled, setMedia, setParentStyleSheet, toMinifiedString, toString, toStyleString, unregisterNamespace
Methods inherited from class io.sf.carte.doc.style.css.om.AbstractCSSStyleSheet
openConnection, parseRelAttribute
Methods inherited from class io.sf.carte.doc.style.css.om.AbstractStyleSheet
getTitle, setTitle
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.w3c.dom.css.CSSStyleSheet
deleteRule, getOwnerRule, insertRule
Methods inherited from interface io.sf.carte.doc.style.css.ExtendedCSSStyleSheet
addRule, addStyleSheet, createCounterStyleRule, createFontFaceRule, createFontFeatureValuesRule, createImportRule, createKeyframesRule, createMarginRule, createMediaRule, createNamespaceRule, createPageRule, createStyleDeclaration, createStyleRule, createSupportsRule, createUnknownRule, createViewportRule, getCssRules, getErrorHandler, getMedia, getRulesForProperty, getSelectorsForProperty, getStyleSheetFactory, hasRuleErrorsOrWarnings, parseStyleSheet, parseStyleSheet
Methods inherited from interface org.w3c.dom.stylesheets.StyleSheet
getDisabled, getParentStyleSheet, getTitle, getType, setDisabled
-
Constructor Details
-
BaseDocumentCSSStyleSheet
-
-
Method Details
-
setHref
- Overrides:
setHref
in classBaseCSSStyleSheet
-
getHref
- Specified by:
getHref
in interfaceStyleSheet
- Overrides:
getHref
in classBaseCSSStyleSheet
-
getOwnerNode
- Specified by:
getOwnerNode
in interfaceStyleSheet
- Overrides:
getOwnerNode
in classBaseCSSStyleSheet
-
setOwnerDocument
-
copyToTarget
-
getTargetMedium
Gets the target medium for this sheet.- Specified by:
getTargetMedium
in interfaceDocumentCSSStyleSheet
- Overrides:
getTargetMedium
in classBaseCSSStyleSheet
- Returns:
- the target medium, or null if is for all media.
-
getComputedStyle
Gets the computed style for the given element and pseudo-element.- Specified by:
getComputedStyle
in interfaceDocumentCSSStyleSheet
- Parameters:
elm
- the element.pseudoElt
- the pseudo-element.- Returns:
- the computed style declaration.
-
clone
Clone this style sheet.- Specified by:
clone
in interfaceDocumentCSSStyleSheet
- Specified by:
clone
in interfaceExtendedCSSStyleSheet<AbstractCSSRule>
- Specified by:
clone
in classAbstractCSSStyleSheet
- Returns:
- the cloned style sheet.
-
clone
Clone this style sheet, but only preserving rules targeting the given medium.- Specified by:
clone
in interfaceDocumentCSSStyleSheet
- Parameters:
targetMedium
- the medium.- Returns:
- a medium-specific pseudo-clone of this sheet.
-
computeStyle
protected ComputedCSSStyle computeStyle(ComputedCSSStyle style, SelectorMatcher matcher, String pseudoElt, InlineStyle inlineStyle) Compute the style for an element.- Parameters:
style
- a base, empty style to be filled with the computed style.matcher
- the selector matcher.pseudoElt
- the pseudo-element.inlineStyle
- the inline style for the element.- Returns:
- the computed CSS style, or an empty style declaration if none applied or the sheet is disabled.
-