-
Notifications
You must be signed in to change notification settings - Fork 791
Expand file tree
/
Copy pathCSSRule.idl
More file actions
executable file
·100 lines (88 loc) · 4 KB
/
CSSRule.idl
File metadata and controls
executable file
·100 lines (88 loc) · 4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
//
// All members defined since DOM-2 Style. The only differences are:
//
// 1. removal of UNKNOWN_RULE = 0 constant
// 2. removal of CHARSET_RULE = 2 constant
// 3. addition of NAMESPACE_RULE = 10 constant
// 4. removal of commented raises(DOMException) on setting cssText
//
[Documentation=
"<p>The {@name} {@type} represents an abstract, base CSS style rule. Each\
distinct CSS style rule type is represented by a distinct {@type} that\
inherits from this {@type}.</p>"
]
interface CSSRule {
[Documentation=
"<p>When the value of the <code>type</code> attribute is {@name}, then the object that implements\
this interface must implement the <code>CSSStyleRule</code> interface.</p>"
]
const unsigned short STYLE_RULE = 1;
[Documentation=
"<p>When the value of the <code>type</code> attribute is {@name}, then the object that implements\
this interface must implement the <code>CSSImportRule</code> interface.</p>"
]
const unsigned short IMPORT_RULE = 3;
[Documentation=
"<p>When the value of the <code>type</code> attribute is {@name}, then the object that implements\
this interface must implement the <code>CSSMediaRule</code> interface.</p>"
]
const unsigned short MEDIA_RULE = 4;
[Documentation=
"<p>When the value of the <code>type</code> attribute is {@name}, then the object that implements\
this interface must implement the <code>CSSFontFaceRule</code> interface.</p>"
]
const unsigned short FONT_FACE_RULE = 5;
[Documentation=
"<p>When the value of the <code>type</code> attribute is {@name}, then the object that implements\
this interface must implement the <code>CSSPageRule</code> interface.</p>"
]
const unsigned short PAGE_RULE = 6;
[Documentation=
"<p>When the value of the <code>type</code> attribute is {@name}, then the object that implements\
this interface must implement the <code>CSSNamespaceRule</code> interface.</p>"
]
const unsigned short NAMESPACE_RULE = 10;
[Documentation=
"<p>The {@name} {@type} must return one of the following values:\
<code>STYLE_RULE</code>,\
<code>IMPORT_RULE</code>,\
<code>MEDIA_RULE</code>,\
<code>FONT_FACE_RULE</code>,\
<code>PAGE_RULE</code>,\
<code>NAMESPACE_RULE</code>,\
or a registered extension value.\
</p>\
<p>The values 0 and 2, formerly known as <code>UNKNOWN_RULE</code> and <code>CHARSET_RULE</code>, respectively, are made\
obsolete by this specification. These values will not be re-allocated in the future and shall remain reserved.</p>\
<p class='note'>Constants for new and proprietary rule types are coordinated\
on the <a href='http://wiki.csswg.org/spec/cssom-constants'>CSSOM Constants</a> wiki page.</p>"
]
readonly attribute unsigned short type;
[Documentation=
"<p>The {@name} {@type} must return a <span title='serialize a CSS rule'>serialization</span> of the\
<span>CSS rule</span>.</p>\
<p>On setting the {@name} {@type} these steps must be run:</p>\
<ol>\
<li><p><span title='Parse a CSS rule'>Parse</span> the value.</p></li>\
<li><p>If parsing failed terminate this algorithm.</p></li>\
<li><p>If the <code title='dom-CSSRule-type'>type</code> of the new\
object does not match the <code title='dom-CSSRule-type'>type</code> of\
the current object\
<span data-anolis-spec=dom title=concept-throw>throw</span> an\
'<code data-anolis-spec=dom>InvalidModificationError</code>' exception.</li>\
<li><p>Replace the current object with the new object.</p></li>\
</ol>"
]
attribute DOMString cssText;
[Documentation=
"<p>The {@name} {@type} must return the nearest enclosing rule of the current rule or null, if\
there is no enclosing rule.</p>\
<p class='note'>For example, <code>@media</code> can enclose a rule.</p>"
]
readonly attribute CSSRule parentRule;
[Documentation=
"<p>The {@name} {@type} must return the <code>CSSStyleSheet</code> object that contains the the\
current rule.</p>"
]
readonly attribute CSSStyleSheet parentStyleSheet;
};