-
Notifications
You must be signed in to change notification settings - Fork 791
Expand file tree
/
Copy pathCSSStyleDeclaration.idl
More file actions
executable file
·90 lines (80 loc) · 4.69 KB
/
CSSStyleDeclaration.idl
File metadata and controls
executable file
·90 lines (80 loc) · 4.69 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
//
// All members defined since DOM-2 Style. The only differences are:
//
// 1. removal of commented raises(DOMException) on setting cssText
// 2. removal of raises(DOMException) on {set,remove}Property
// 3. removal of getPropertyCSSValue() method
//
[Documentation=
"<p>The {@name} {@type} represents a <span>CSS declaration block</span>, including its underlying state, where this\
underlying state depends upon the source of the {@name} instance.</p>"
]
interface CSSStyleDeclaration {
[Documentation=
"<p>The {@name} {@type} must return the result of <span title='serialize a CSS declaration block'>serializing</span> the\
<span>CSS declaration block declarations</span>.</p>\
<p>Setting the <code>cssText</code> attribute must run these steps:\
<ol>\
<li><p>If the <span>CSS declaration block readonly flag</span> is set, <span data-anolis-spec=dom title=concept-throw>throw</span> a\
<code data-anolis-spec=dom>NoModificationAllowedError</code> exception and terminate these steps.</li>\
<li><p>Empty the <span>CSS declaration block declarations</span>.</li>\
<li><p><span title='Parse a CSS declaration block'>Parse</span> the given value and, if the return value is not null, insert it into the\
<span>CSS declaration block declarations</span>.</p></li>\
</ol>"
]
attribute DOMString cssText;
[Documentation=
"<p>The {@name} {@type} must return the number of declarations in the <span>collection of CSS declarations</span>.</p>"
]
readonly attribute unsigned long length;
[Documentation=
"<p>The {@name} {@type} must return the property at position <var>index</var>.</p>"
]
DOMString item(unsigned long index);
[Documentation=
"<p>The {@name} {@type} must ...</p>"
]
DOMString getPropertyValue(DOMString property);
[Documentation=
"<p>The {@name} {@type}, when invoked, if <var>property</var> is an <span data-anolis-spec=dom>ASCII case-insensitive</span>\
match for a property that has a priority user agents must return the canonical priority of that property as given in the\
syntax definition. Otherwise, the empty string must be returned.</p>\
<p class='example'>E.g. for <code>background-color:lime !IMPORTANT</code> the return value would be '<code>important</code>'.</p>"
]
DOMString getPropertyPriority(DOMString property);
[Documentation=
"<p>The {@name} {@type} must run these steps:</p>\
<ol>\
<li><p>If the <span>CSS declaration block readonly flag</span> is set, <span data-anolis-spec=dom title=concept-throw>throw</span>\
an '<code data-anolis-spec=dom>NoModificationAllowedError</code>' and terminate these steps.</li>\
<li><p>If <var>property</var> is not an <span data-anolis-spec=dom>ASCII case-insensitive</span> match for a supported property,\
terminate this algorithm.</p></li>\
<li><p>If <var>value</var> is the empty string, invoke <code title='dom-CSSStyleDeclaration-removeProperty'>removeProperty()</code>\
with <var>property</var> as argument and terminate this algorithm.</p></li>\
<li><p>If the <var>priority</var> argument has been omitted let <var>priority</var> be the empty string.</p></li>\
<li><p>If <var>priority</var> is neither a valid priority nor the empty string terminate this algorithm.</p></li>\
<li>\
<p>If <span title='parse a CSS value'>parsing the <var>value</var></span> returns null terminate this algorithm.\
<p class='note'><var>value</var> can not include '<code>!important</code>'.</p>\
</li>\
<li><p>Finally, set <var>property</var> to <var>value</var> with priority <var>priority</var> when <var>priority</var>\
is not the empty string. Otherwise set <var>property</var> to <var>value</var>.</p></li>\
</ol>"
]
void setProperty(DOMString property, DOMString value, optional DOMString priority);
[Documentation=
"<p>The {@name} {@type} must run these steps:</p>\
<ol>\
<li><p>If the <span>CSS declaration block readonly flag</span> is set, <span data-anolis-spec=dom title=concept-throw>throw</span> a\
'<code data-anolis-spec=dom>NoModificationAllowedError</code>' and terminate these steps.</li>\
<li><p>If <var>property</var> is an <span data-anolis-spec=dom>ASCII case-insensitive</span> match for a property of a declaration in the\
<span>collection of CSS declarations</span> remove the declaration.</p></li>\
</ol>"
]
DOMString removeProperty(DOMString property);
[Documentation=
"<p>The {@name} {@type} must return the <code>CSSrule</code> object the <code>CSSStyleDeclaration</code> is object is associated with\
or null if it is not associated with a <code>CSSrule</code> object.</p>"
]
readonly attribute CSSRule? parentRule;
};