Definition
CSS Object Model (CSSOM) defines CSSRule
[Exposed=Window]
interface CSSRule {
attribute CSSOMString cssText;
readonly attribute CSSRule? parentRule;
readonly attribute CSSStyleSheet? parentStyleSheet;
// the following attribute and constants are historical
readonly attribute unsigned short type;
const unsigned short STYLE_RULE = 1;
const unsigned short CHARSET_RULE = 2;
const unsigned short IMPORT_RULE = 3;
const unsigned short MEDIA_RULE = 4;
const unsigned short FONT_FACE_RULE = 5;
const unsigned short PAGE_RULE = 6;
const unsigned short MARGIN_RULE = 9;
const unsigned short NAMESPACE_RULE = 10;
};
This interface is extended in the following specifications:
- CSS Animations Level 1
partial interface CSSRule { const unsigned short KEYFRAMES_RULE = 7; const unsigned short KEYFRAME_RULE = 8; };
- CSS Conditional Rules Module Level 3
partial interface CSSRule { const unsigned short SUPPORTS_RULE = 12; };
- CSS Counter Styles Level 3
partial interface CSSRule { const unsigned short COUNTER_STYLE_RULE = 11; };
- CSS Fonts Module Level 4
partial interface CSSRule { const unsigned short FONT_FEATURE_VALUES_RULE = 14; };
Consolidated IDL (across mixin and partials)
[Exposed=Window]
interface CSSRule {
attribute CSSOMString cssText;
readonly attribute CSSRule? parentRule;
readonly attribute CSSStyleSheet? parentStyleSheet;
// the following attribute and constants are historical
readonly attribute unsigned short type;
const unsigned short STYLE_RULE = 1;
const unsigned short CHARSET_RULE = 2;
const unsigned short IMPORT_RULE = 3;
const unsigned short MEDIA_RULE = 4;
const unsigned short FONT_FACE_RULE = 5;
const unsigned short PAGE_RULE = 6;
const unsigned short MARGIN_RULE = 9;
const unsigned short NAMESPACE_RULE = 10;
const unsigned short KEYFRAMES_RULE = 7;
const unsigned short KEYFRAME_RULE = 8;
const unsigned short SUPPORTS_RULE = 12;
const unsigned short COUNTER_STYLE_RULE = 11; const unsigned short FONT_FEATURE_VALUES_RULE = 14;
};
Methods and attributes that return objects implementing CSSRule
Referring IDL interfaces/dictionaries
CSSColorProfileRule
CSSCounterStyleRule
CSSFontFaceRule
CSSFontFeatureValuesRule
CSSFontPaletteValuesRule
CSSGroupingRule
CSSImportRule
CSSKeyframeRule
CSSKeyframesRule
CSSLayerStatementRule
CSSMarginRule
CSSNamespaceRule
CSSNestedDeclarations
CSSPositionTryRule
CSSPropertyRule
CSSRule
CSSRuleList
CSSStyleDeclaration
CSSStyleSheet
CSSViewTransitionRule
Referring specifications
- CSS Anchor Positioning refers to
CSSRule
- CSS Animations Level 1 refers to
CSSRule
- CSS Cascading and Inheritance Level 5 refers to
CSSRule
- CSS Color Module Level 5 refers to
CSSRule
- CSS Conditional Rules Module Level 3 refers to
CSSRule
- CSS Counter Styles Level 3 refers to
CSSRule
- CSS Fonts Module Level 4 refers to
CSSRule
- CSS Nesting Module refers to
CSSRule
- CSS Properties and Values API Level 1 refers to
CSSRule
- CSS View Transitions Module Level 2 refers to
CSSRule