- All Known Subinterfaces:
CSSConditionRule
,CSSMediaRule
,CSSSupportsRule
- All Known Implementing Classes:
GroupingRule
,MediaRule
,SupportsRule
Represents an at-rule that contains other rules nested inside itself.
-
Field Summary
Fields inherited from interface io.sf.carte.doc.style.css.CSSRule
COUNTER_STYLE_RULE, CUSTOM_MEDIA_RULE, DOCUMENT_RULE, FONT_FACE_RULE, FONT_FEATURE_VALUES_RULE, IMPORT_RULE, KEYFRAME_RULE, KEYFRAMES_RULE, MARGIN_RULE, MEDIA_RULE, NAMESPACE_RULE, PAGE_RULE, PROPERTY_RULE, REGION_STYLE_RULE, STYLE_RULE, SUPPORTS_RULE, UNKNOWN_RULE, VIEWPORT_RULE
Fields inherited from interface org.w3c.dom.css.CSSRule
CHARSET_RULE
-
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteRule
(int index) Removes a CSS rule from the CSS rule list returned bygetCssRules()
atindex
.CSSRuleList
<? extends CSSRule> Get the list of CSS rules nested inside the grouping rule.int
insertRule
(String rule, int index) Inserts a new rule into this grouping rule collection.Methods inherited from interface io.sf.carte.doc.style.css.CSSRule
getMinifiedCssText, getParentRule, getParentStyleSheet, getPrecedingComments, getTrailingComments, writeCssText
Methods inherited from interface org.w3c.dom.css.CSSRule
getCssText, getType, setCssText
-
Method Details
-
getCssRules
CSSRuleList<? extends CSSRule> getCssRules()Get the list of CSS rules nested inside the grouping rule.- Returns:
- a CSSRuleList object for the list of CSS rules nested inside the grouping rule.
-
insertRule
Inserts a new rule into this grouping rule collection.- Parameters:
rule
- The parsable text representing the rule.index
- The index within the collection of the rule before which to insert the specified rule. If the specified index is equal to the length of the rule collection, the rule will be added to its end.- Returns:
- the index at which the rule was inserted.
- Throws:
DOMException
- if the index is out of bounds or there was a problem parsing the rule.
-
deleteRule
Removes a CSS rule from the CSS rule list returned bygetCssRules()
atindex
.- Parameters:
index
- the rule list index at which the rule must be removed.- Throws:
DOMException
- INDEX_SIZE_ERR ifindex
is greater than or equal togetCssRules()
.getLength().
-