Package io.sf.carte.doc.style.css.om
Class BaseDocumentCSSStyleSheet
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:
CSSStyleSheet<AbstractCSSRule>,DocumentCSSStyleSheet,Serializable,Cloneable,org.w3c.dom.css.CSSStyleSheet,org.w3c.dom.stylesheets.StyleSheet
- Direct Known Subclasses:
DOMDocumentCSSStyleSheet
public abstract class BaseDocumentCSSStyleSheet
extends BaseCSSStyleSheet
implements DocumentCSSStyleSheet, Cloneable
Base implementation for
DocumentCSSStyleSheet.- See Also:
-
Field Summary
Fields inherited from interface io.sf.carte.doc.style.css.CSSStyleSheet
COMMENTS_AUTO, COMMENTS_IGNORE, COMMENTS_PRECEDING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddLocalRule(CSSRule rule) Inserts a local rule in the current insertion point (generally after the last rule).abstract BaseDocumentCSSStyleSheetclone()Clone this style sheet.abstract BaseDocumentCSSStyleSheetClone this style sheet, but only preserving rules targeting the given medium.protected ComputedCSSStylecomputeRevertedStyle(ComputedCSSStyle style, SelectorMatcher matcher, Condition pseudoElt, BaseCSSStyleDeclaration inlineStyle, byte origin) protected ComputedCSSStylecomputeStyle(ComputedCSSStyle style, SelectorMatcher matcher, Condition pseudoElt, InlineStyle inlineStyle) Compute the style for an element.protected voidprotected abstract ComputedCSSStyleabstract ComputedCSSStylegetComputedStyle(CSSElement elm, Condition pseudoElt) Gets the computed style for the given element and pseudo-element.getHref()abstract CSSDocumentGets the target medium for this sheet.voidregisterProperty(CSSPropertyDefinition definition) Registers the definition of a custom property.voidabstract voidsetOwnerDocument(CSSDocument ownerNode) Methods inherited from class io.sf.carte.doc.style.css.om.BaseCSSStyleSheet
acceptDeclarationRuleVisitor, acceptDescriptorRuleVisitor, acceptStyleRuleVisitor, addRule, addStyleSheet, copyAllTo, copyFieldsTo, copyRulesTo, createCounterStyleRule, createFontFaceRule, createFontFeatureValuesRule, createImportRule, createKeyframesRule, createMarginRule, createMediaRule, createNamespaceRule, createPageRule, createPropertyRule, createStyleDeclaration, createStyleDeclaration, createStyleRule, createSupportsRule, createUnknownRule, createViewportRule, deleteRule, getCssRules, getDisabled, getDocumentErrorHandler, getErrorHandler, getFirstStyleRule, getMedia, getNamespacePrefix, getOrigin, getOwnerRule, getParentStyleSheet, getRulesForProperty, getSelectorsForProperty, getSelectorsForPropertyValue, getStyleRules, getStyleSheetFactory, getType, hasDefaultNamespace, hasRuleErrorsOrWarnings, insertRule, loadStyleSheet, parseStyleSheet, parseStyleSheet, registerNamespace, setDisabled, setMedia, setParentStyleSheet, toMinifiedString, toString, toStyleString, unregisterNamespaceMethods inherited from class io.sf.carte.doc.style.css.om.AbstractCSSStyleSheet
openConnection, parseRelAttributeMethods inherited from class io.sf.carte.doc.style.css.om.AbstractStyleSheet
getTitle, setTitleMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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, parseStyleSheetMethods inherited from interface org.w3c.dom.css.CSSStyleSheet
deleteRule, getOwnerRule, insertRuleMethods inherited from interface org.w3c.dom.stylesheets.StyleSheet
getDisabled, getParentStyleSheet, getTitle, getType, setDisabled
-
Constructor Details
-
BaseDocumentCSSStyleSheet
-
-
Method Details
-
setHref
- Overrides:
setHrefin classBaseCSSStyleSheet
-
getHref
- Specified by:
getHrefin interfaceorg.w3c.dom.stylesheets.StyleSheet- Overrides:
getHrefin classBaseCSSStyleSheet
-
getOwnerNode
- Specified by:
getOwnerNodein interfaceorg.w3c.dom.stylesheets.StyleSheet- Overrides:
getOwnerNodein classBaseCSSStyleSheet
-
setOwnerDocument
-
copyToTarget
-
addLocalRule
Description copied from class:BaseCSSStyleSheetInserts a local rule in the current insertion point (generally after the last rule).- Overrides:
addLocalRulein classBaseCSSStyleSheet- Parameters:
rule- the rule to be inserted.
-
getTargetMedium
Gets the target medium for this sheet.- Specified by:
getTargetMediumin interfaceDocumentCSSStyleSheet- Overrides:
getTargetMediumin 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:
getComputedStylein interfaceDocumentCSSStyleSheet- Parameters:
elm- the element.pseudoElt- the pseudo-element condition.- Returns:
- the computed style declaration.
-
createComputedCSSStyle
-
clone
Clone this style sheet.- Specified by:
clonein interfaceCSSStyleSheet<AbstractCSSRule>- Specified by:
clonein interfaceDocumentCSSStyleSheet- Specified by:
clonein classAbstractCSSStyleSheet- Returns:
- the cloned style sheet.
-
clone
Clone this style sheet, but only preserving rules targeting the given medium.- Specified by:
clonein interfaceDocumentCSSStyleSheet- Parameters:
targetMedium- the medium.- Returns:
- a medium-specific pseudo-clone of this sheet.
-
registerProperty
Registers the definition of a custom property.- Specified by:
registerPropertyin interfaceDocumentCSSStyleSheet- Parameters:
definition- the definition.
-
computeStyle
protected ComputedCSSStyle computeStyle(ComputedCSSStyle style, SelectorMatcher matcher, Condition 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.
-
computeRevertedStyle
protected ComputedCSSStyle computeRevertedStyle(ComputedCSSStyle style, SelectorMatcher matcher, Condition pseudoElt, BaseCSSStyleDeclaration inlineStyle, byte origin)
-