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 TypeMethodDescriptionvoid
Receive notification of a comment.void
End of @counter-style rule.void
End of feature map.void
Receive notification of the end of a font face rule.void
End of font feature values rule.void
End of @keyframe.void
End of @keyframes rule.void
Receive notification of the end of a margin rule.void
endMedia
(MediaQueryList media) Receive notification of the end of a media rule.void
Receive notification of the end of the stream being parsed.void
endPage
(PageSelectorList pageSelectorList) Receive notification of the end of a page rule.void
endProperty
(boolean discard) End of @property rule.void
endSelector
(SelectorList selectors) Receive notification of the end of a style rule.void
endSupports
(BooleanCondition condition) Receive notification of the end of a supports rule.default void
End of @viewport rule.void
ignorableAtRule
(String atRule) Receive notification of an unknown @-rule not supported by this parser.void
importStyle
(String uri, MediaQueryList media, String defaultNamespaceURI) Receive notification of a import rule in the style sheet.void
lexicalProperty
(String name, LexicalUnit value, boolean important) Receive notification of a property declaration that must be processed as a lexical value.void
namespaceDeclaration
(String prefix, String uri) Receive notification of a namespace declaration.void
parseStart
(ParserControl parserctl) Receive notification of the beginning of the parse process.void
property
(String name, LexicalUnit value, boolean important) Receive notification of a property declaration.void
startCounterStyle
(String name) Start a @counter-style rule.void
startFeatureMap
(String mapName) Start a feature map.void
Receive notification of the beginning of a font face rule.void
startFontFeatures
(String[] familyName) Start a font feature values rule.void
startKeyframe
(LexicalUnit keyframeSelector) Start a @keyframe.void
startKeyframes
(String name) Start a @keyframes rule.void
startMargin
(String name) Receive notification of the beginning of a margin-box rule.void
startMedia
(MediaQueryList media) Receive notification of the beginning of a media rule.void
startPage
(PageSelectorList pageSelectorList) Receive notification of the beginning of a page rule.void
startProperty
(String name) Start a @property rule.void
startSelector
(SelectorList selectors) Receive notification of the beginning of a style rule.void
startSupports
(BooleanCondition condition) Receive notification of the beginning of a supports rule.default void
Start 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
,parseRule
orparseStyleDeclaration
methods 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
-true
if 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
-null
if 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,null
otherwise)
-
endPage
Receive notification of the end of a page rule.- Parameters:
pageSelectorList
- the page selector list (if any,null
otherwise)
-
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:
@viewport
rules 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 ?
-