java.lang.Object
io.sf.carte.doc.style.css.om.AbstractCSSRule
io.sf.carte.doc.style.css.om.KeyframesRule
- All Implemented Interfaces:
CSSKeyframesRule,ExtendedCSSRule,CSSRule
Implementation of CSSKeyframesRule.
-
Field Summary
Fields inherited from interface org.w3c.dom.css.CSSRule
CHARSET_RULE, FONT_FACE_RULE, IMPORT_RULE, MEDIA_RULE, PAGE_RULE, STYLE_RULE, UNKNOWN_RULEFields inherited from interface io.sf.carte.doc.style.css.ExtendedCSSRule
COUNTER_STYLE_RULE, CUSTOM_MEDIA_RULE, DOCUMENT_RULE, FONT_FEATURE_VALUES_RULE, KEYFRAME_RULE, KEYFRAMES_RULE, MARGIN_RULE, NAMESPACE_RULE, REGION_STYLE_RULE, SUPPORTS_RULE, VIEWPORT_RULE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedKeyframesRule(AbstractCSSStyleSheet parentSheet, byte origin) -
Method Summary
Modifier and TypeMethodDescriptionvoidappendRule(String rule) Appends a new rule into this keyframes rule collection.clone(AbstractCSSStyleSheet parentSheet) Obtain a clone of this rule whose parent sheet isparentSheet.protected ParservoiddeleteRule(String select) Deletes the last declaredCSSKeyframeRulematching the specified keyframe selector from thiskeyframesrule collection.voidenablePrecedingComments(int initialSize) If this rule does not contain a preceding comment list, create one with the given initial capacity.booleanThe findRule returns the last declared CSSKeyframeRule matching the specified keyframe selector.Gets the list of keyframe rules.A minified parsable textual representation of the rule.getName()Gets the name of the keyframes.byteGet the origin of this rule (user agent sheet, author, user).If this rule is contained inside another rule, return that rule.Get the style sheet that contains this rule.Get a list of the comments that preceded this rule, if any.protected StyleFormattingContextshortgetType()protected URLGets an URL for the given URI, taking into account the parent CSS Base URL if appropriate.inthashCode()voidsetCssText(String cssText) voidsetParentRule(AbstractCSSRule parent) Sets the parent CSS rule, in case this rule is contained by another.voidwriteCssText(SimpleWriter wri, StyleFormattingContext context) Write a serialization of this rule to the given simple writer, according to the given context.Methods inherited from class io.sf.carte.doc.style.css.om.AbstractCSSRule
toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.sf.carte.doc.style.css.ExtendedCSSRule
getParentRule, getParentStyleSheet
-
Constructor Details
-
KeyframesRule
-
-
Method Details
-
getName
Description copied from interface:CSSKeyframesRuleGets the name of the keyframes.- Specified by:
getNamein interfaceCSSKeyframesRule- Returns:
- the name of the keyframes.
-
getCssRules
Description copied from interface:CSSKeyframesRuleGets the list of keyframe rules.- Specified by:
getCssRulesin interfaceCSSKeyframesRule- Returns:
- the list of keyframe rules.
-
appendRule
Appends a new rule into this keyframes rule collection.According to the specification this method does not throw exceptions, but for this library's use cases it seems reasonable to check for syntax errors.
- Specified by:
appendRulein interfaceCSSKeyframesRule- Parameters:
rule- The parsable text representing the rule.- Throws:
DOMException- if there was a problem parsing the rule.
-
deleteRule
Description copied from interface:CSSKeyframesRuleDeletes the last declaredCSSKeyframeRulematching the specified keyframe selector from thiskeyframesrule collection. If no matching rule exists, the method does nothing.The number and order of the values in the specified keyframe selector must match those of the targeted keyframe rule(s). The match is not sensitive to white space around the values in the list.
- Specified by:
deleteRulein interfaceCSSKeyframesRule- Parameters:
select- The keyframe selector of the rule to be deleted: a comma-separated list of keywords or percentage values between 0% and 100%.
-
findRule
Description copied from interface:CSSKeyframesRuleThe findRule returns the last declared CSSKeyframeRule matching the specified keyframe selector. If no matching rule exists, the method does nothing.- Specified by:
findRulein interfaceCSSKeyframesRule- Parameters:
select- The keyframe selector of the rule to be deleted: a comma-separated list of keywords or percentage values between 0% and 100%.- Returns:
- the found rule, or null if no rule was found.
- Throws:
DOMException
-
getCssText
- Specified by:
getCssTextin interfaceCSSRule- Specified by:
getCssTextin classAbstractCSSRule
-
getMinifiedCssText
Description copied from class:AbstractCSSRuleA minified parsable textual representation of the rule. This reflects the current state of the rule and not its initial value.- Specified by:
getMinifiedCssTextin interfaceExtendedCSSRule- Returns:
- the minified textual representation of the rule.
-
writeCssText
Description copied from interface:ExtendedCSSRuleWrite a serialization of this rule to the given simple writer, according to the given context.- Specified by:
writeCssTextin interfaceExtendedCSSRule- Specified by:
writeCssTextin classAbstractCSSRule- Parameters:
wri- the simple writer object.context- the formatting context.- Throws:
IOException- if an error happened while writing.
-
setCssText
- Specified by:
setCssTextin interfaceCSSRule- Overrides:
setCssTextin classAbstractCSSRule- Throws:
DOMException
-
hashCode
public int hashCode() -
equals
-
clone
Description copied from class:AbstractCSSRuleObtain a clone of this rule whose parent sheet isparentSheet.- Specified by:
clonein interfaceExtendedCSSRule- Specified by:
clonein classAbstractCSSRule- Parameters:
parentSheet- the parent sheet for the new rule.- Returns:
- a clone of this rule with the given parent sheet.
-
getType
public short getType()- Specified by:
getTypein interfaceCSSRule- Specified by:
getTypein classAbstractCSSRule
-
getParentStyleSheet
Description copied from interface:ExtendedCSSRuleGet the style sheet that contains this rule.- Specified by:
getParentStyleSheetin interfaceCSSRule- Specified by:
getParentStyleSheetin interfaceExtendedCSSRule- Specified by:
getParentStyleSheetin classAbstractCSSRule- Returns:
- the style sheet, or null if no sheet contains this rule.
-
createSACParser
- Throws:
DOMException
-
getParentRule
Description copied from interface:ExtendedCSSRuleIf this rule is contained inside another rule, return that rule. If it is not nested inside any other rules, returnnull.- Specified by:
getParentRulein interfaceCSSRule- Specified by:
getParentRulein interfaceExtendedCSSRule- Specified by:
getParentRulein classAbstractCSSRule- Returns:
- the containing rule, if any, otherwise
null.
-
setParentRule
Sets the parent CSS rule, in case this rule is contained by another.- Specified by:
setParentRulein classAbstractCSSRule- Parameters:
parent- the parent rule.
-
getOrigin
public byte getOrigin()Description copied from class:AbstractCSSRuleGet the origin of this rule (user agent sheet, author, user).- Specified by:
getOriginin classAbstractCSSRule- Returns:
- the origin of this rule.
-
enablePrecedingComments
public void enablePrecedingComments(int initialSize) Description copied from class:AbstractCSSRuleIf this rule does not contain a preceding comment list, create one with the given initial capacity.If this rule already has a comment list, does nothing.
- Specified by:
enablePrecedingCommentsin classAbstractCSSRule- Parameters:
initialSize- the initial capacity.
-
getPrecedingComments
Description copied from class:AbstractCSSRuleGet a list of the comments that preceded this rule, if any.- Specified by:
getPrecedingCommentsin classAbstractCSSRule- Returns:
- the list of comments, or
nullif there were no preceding comments or the parsing was specified to ignore comments. - See Also:
-
getStyleFormattingContext
-
getURL
Gets an URL for the given URI, taking into account the parent CSS Base URL if appropriate.- Parameters:
uri- the uri.- Returns:
- the absolute URL.
- Throws:
MalformedURLException- if the uri was wrong.
-