Interface CSSHandler
- All Known Subinterfaces:
CSSParser.DeclarationRuleHandler
- All Known Implementing Classes:
EmptyCSSHandler
Based on SAC's DocumentHandler interface by Philippe Le Hegaret.
-
Method Summary
Modifier and TypeMethodDescriptionvoidReceive notification of a comment.voidEnd of @counter-style rule.voidEnd of feature map.voidReceive notification of the end of a font face rule.voidEnd of font feature values rule.voidEnd of @keyframe.voidEnd of @keyframes rule.voidReceive notification of the end of a margin rule.voidendMedia(MediaQueryList media) Receive notification of the end of a media rule.voidReceive notification of the end of the stream being parsed.voidendPage(PageSelectorList pageSelectorList) Receive notification of the end of a page rule.voidendProperty(boolean discard) End of @property rule.voidendSelector(SelectorList selectors) Receive notification of the end of a style rule.voidendSupports(BooleanCondition condition) Receive notification of the end of a supports rule.default voidEnd of @viewport rule.voidignorableAtRule(String atRule) Receive notification of an unknown @-rule not supported by this parser.voidimportStyle(String uri, MediaQueryList media, String defaultNamespaceURI) Receive notification of a import rule in the style sheet.voidlexicalProperty(String name, LexicalUnit value, boolean important) Receive notification of a property declaration that must be processed as a lexical value.voidnamespaceDeclaration(String prefix, String uri) Receive notification of a namespace declaration.voidparseStart(ParserControl parserctl) Receive notification of the beginning of the parse process.voidproperty(String name, LexicalUnit value, boolean important) Receive notification of a property declaration.voidstartCounterStyle(String name) Start a @counter-style rule.voidstartFeatureMap(String mapName) Start a feature map.voidReceive notification of the beginning of a font face rule.voidstartFontFeatures(String[] familyName) Start a font feature values rule.voidstartKeyframe(LexicalUnit keyframeSelector) Start a @keyframe.voidstartKeyframes(String name) Start a @keyframes rule.voidstartMargin(String name) Receive notification of the beginning of a margin-box rule.voidstartMedia(MediaQueryList media) Receive notification of the beginning of a media rule.voidstartPage(PageSelectorList pageSelectorList) Receive notification of the beginning of a page rule.voidstartProperty(String name) Start a @property rule.voidstartSelector(SelectorList selectors) Receive notification of the beginning of a style rule.voidstartSupports(BooleanCondition condition) Receive notification of the beginning of a supports rule.default voidStart a @viewport rule.
-
Method Details
-
parseStart
Receive notification of the beginning of the parse process.The CSS parser will invoke this method only once, before any other methods in this interface, and only when one of the
parseStyleSheet,parseRuleorparseStyleDeclarationmethods were called.- Parameters:
parserctl- an object that allows convenient access to certain parser functionalities.
-
endOfStream
void endOfStream()Receive notification of the end of the stream being parsed.The CSS parser will invoke this method only once, and it will be the last method invoked during the parse. The parser shall not invoke this method unless it has reached the end of input.
-
comment
Receive notification of a comment. If the comment appears in a declaration (e.g. color: /* comment */ blue;), the parser notifies the comment before the declaration.- Parameters:
text- The comment.precededByLF-trueif a Line Feed character was found since the previous event.
-
ignorableAtRule
Receive notification of an unknown @-rule not supported by this parser.- Parameters:
atRule- The complete @-rule.
-
namespaceDeclaration
Receive notification of a namespace declaration.- Parameters:
prefix-nullif this is the default namespaceuri- The URI for this namespace.
-
importStyle
Receive notification of a import rule in the style sheet.- Parameters:
uri- The URI of the imported style sheet.media- The intended destination media for style information.defaultNamespaceURI- The default namespace URI for the imported style sheet.
-
startMedia
Receive notification of the beginning of a media rule.The Parser will invoke this method at the beginning of every media rule in the style sheet. There will be a corresponding
endMedia()event for everystartMedia()event.- Parameters:
media- The intended destination media for style information.
-
endMedia
Receive notification of the end of a media rule.- Parameters:
media- The intended destination media for style information.
-
startPage
Receive notification of the beginning of a page rule.The Parser will invoke this method at the beginning of every page rule in the style sheet. There will be a corresponding
endPage()event for everystartPage()event.- Parameters:
pageSelectorList- the page selector list (if any,nullotherwise)
-
endPage
Receive notification of the end of a page rule.- Parameters:
pageSelectorList- the page selector list (if any,nullotherwise)
-
startMargin
Receive notification of the beginning of a margin-box rule.The Parser will invoke this method at the beginning of every margin rule in the style sheet. There will be a corresponding
endMargin()event for everystartMargin()event.- Parameters:
name- the name of the rule.
-
endMargin
void endMargin()Receive notification of the end of a margin rule. -
startFontFace
void startFontFace()Receive notification of the beginning of a font face rule.The Parser will invoke this method at the beginning of every font face statement in the style sheet. There will be a corresponding
endFontFace()event for everystartFontFace()event. -
endFontFace
void endFontFace()Receive notification of the end of a font face rule. -
startCounterStyle
Start a @counter-style rule.- Parameters:
name- the counter-style name.
-
endCounterStyle
void endCounterStyle()End of @counter-style rule. -
startKeyframes
Start a @keyframes rule.- Parameters:
name- the keyframes name.
-
endKeyframes
void endKeyframes()End of @keyframes rule. -
startKeyframe
Start a @keyframe.- Parameters:
keyframeSelector- the keyframe selector.
-
endKeyframe
void endKeyframe()End of @keyframe. -
startFontFeatures
Start a font feature values rule.- Parameters:
familyName- the font family names.
-
endFontFeatures
void endFontFeatures()End of font feature values rule. -
startFeatureMap
Start a feature map.- Parameters:
mapName- the map name.
-
endFeatureMap
void endFeatureMap()End of feature map. -
startProperty
Start a @property rule.- Parameters:
name- the custom property name.
-
endProperty
void endProperty(boolean discard) End of @property rule.- Parameters:
discard- iftrue, the rule should be discarded.
-
startSupports
Receive notification of the beginning of a supports rule.The Parser will invoke this method at the beginning of every supports rule in the style sheet. There will be a corresponding
endSupports()event for everystartSupports()event.- Parameters:
condition- the supports condition.
-
endSupports
Receive notification of the end of a supports rule.- Parameters:
condition- the supports condition.
-
startSelector
Receive notification of the beginning of a style rule.- Parameters:
selectors- the intended selectors for next declarations.
-
endSelector
Receive notification of the end of a style rule.- Parameters:
selectors- the intended selectors for the previous declarations.
-
startViewport
default void startViewport()Start a @viewport rule.Note:
@viewportrules were removed by W3C in February 2020. -
endViewport
default void endViewport()End of @viewport rule. -
property
Receive notification of a property declaration.- Parameters:
name- the name of the property.value- the value of the property.important- is this property important ?
-
lexicalProperty
Receive notification of a property declaration that must be processed as a lexical value.- Parameters:
name- the name of the property.value- the value of the property.important- is this property important ?
-