Skip to content

Commit b5d604c

Browse files
emilioJordan Taylor
authored and
Jordan Taylor
committed
[cssom] CSSStyleDeclaration.cssText should return the empty string for computed style.
Closes w3c#1033
1 parent 2a028b0 commit b5d604c

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

cssom-1/Overview.bs

+19-16
Original file line numberDiff line numberDiff line change
@@ -1808,7 +1808,7 @@ On setting the {{CSSStyleRule/selectorText}} attribute these steps must be run:
18081808
The <dfn attribute for=CSSStyleRule>style</dfn> attribute must return a <code>CSSStyleDeclaration</code> object for the style rule, with the
18091809
following properties:
18101810
<dl>
1811-
<dt><a for="CSSStyleDeclaration">readonly flag</a>
1811+
<dt><a for="CSSStyleDeclaration">computed flag</a>
18121812
<dd>Unset.
18131813
<dt><a for="CSSStyleDeclaration">declarations</a>
18141814
<dd>The declared declarations in the rule, in <a>specified order</a>.
@@ -1908,7 +1908,7 @@ On setting the {{CSSPageRule/selectorText}} attribute these steps must be run:
19081908
The <dfn attribute for=CSSGroupingRule>style</dfn> attribute must return a <code>CSSStyleDeclaration</code> object for the
19091909
<code>@page</code> at-rule, with the following properties:
19101910
<dl>
1911-
<dt><a for="CSSStyleDeclaration">readonly flag</a>
1911+
<dt><a for="CSSStyleDeclaration">computed flag</a>
19121912
<dd>Unset.
19131913
<dt><a for="CSSStyleDeclaration">declarations</a>
19141914
<dd>The declared declarations in the rule, in <a>specified order</a>.
@@ -1938,7 +1938,7 @@ included in the name. [[!CSS3SYN]]
19381938
The <dfn attribute for=CSSMarginRule>style</dfn> attribute must return a <code>CSSStyleDeclaration</code> object for the
19391939
margin at-rule, with the following properties:
19401940
<dl>
1941-
<dt><a for="CSSStyleDeclaration">readonly flag</a>
1941+
<dt><a for="CSSStyleDeclaration">computed flag</a>
19421942
<dd>Unset.
19431943
<dt><a for="CSSStyleDeclaration">declarations</a>
19441944
<dd>The declared declarations in the rule, in <a>specified order</a>.
@@ -1996,9 +1996,9 @@ the DOM a <a>CSS declaration block</a> is a
19961996
<a>CSS declaration block</a> has the following associated properties:
19971997

19981998
<dl dfn-for="CSSStyleDeclaration" export>
1999-
<dt><dfn>readonly flag</dfn>
2000-
<dd>Unset if the object can be manipulated. Set if it can not be
2001-
manipulated. Unless otherwise stated it is unset.
1999+
<dt><dfn>computed flag</dfn>
2000+
<dd>Set if the object is a computed style declaration, rather than a specified
2001+
style. Unless otherwise stated it is unset.
20022002

20032003
<dt><dfn>declarations</dfn>
20042004
<dd>The <a>CSS declarations</a> associated with the object.
@@ -2099,7 +2099,7 @@ A <a>CSS declaration block</a> has these <a>attribute change steps</a> for its <
20992099
with <var>localName</var>, <var>value</var>, and <var>namespace</var>:
21002100

21012101
<ol>
2102-
<li>If the <a for="CSSStyleDeclaration">readonly flag</a> is set, then return.
2102+
<li>If the <a for="CSSStyleDeclaration">computed flag</a> is set, then return.
21032103
<li>If the <a for="CSSStyleDeclaration">updating flag</a> is set, then return.
21042104
<li>If <var>localName</var> is not "<code>style</code>", or <var>namespace</var> is not null, then return.
21052105
<li>If <var>value</var> is null, empty the <a for="CSSStyleDeclaration">declarations</a>.
@@ -2111,7 +2111,7 @@ When a <a>CSS declaration block</a> object is created, then:
21112111

21122112
<ol>
21132113
<li>Let <var>owner node</var> be the <a for="CSSStyleDeclaration">owner node</a>.
2114-
<li>If <var>owner node</var> is null, or the <a for="CSSStyleDeclaration">readonly flag</a> is set, then return.
2114+
<li>If <var>owner node</var> is null, or the <a for="CSSStyleDeclaration">computed flag</a> is set, then return.
21152115
<li>Let <var>value</var> be the result of <a lt="get an attribute by namespace and local name">getting an attribute</a>
21162116
given null, "<code>style</code>", and <var>owner node</var>.
21172117
<li>If <var>value</var> is not null, let the <a for="CSSStyleDeclaration">declarations</a> be the result of
@@ -2121,7 +2121,7 @@ When a <a>CSS declaration block</a> object is created, then:
21212121
To <dfn export>update style attribute for</dfn> <var>declaration block</var> means to run the steps below:
21222122

21232123
<ol>
2124-
<li>Assert: <var>declaration block</var>'s <a for="CSSStyleDeclaration">readonly flag</a> is unset.
2124+
<li>Assert: <var>declaration block</var>'s <a for="CSSStyleDeclaration">computed flag</a> is unset.
21252125
<li>Let <var>owner node</var> be <var>declaration block</var>'s <a for="CSSStyleDeclaration">owner node</a>.
21262126
<li>If <var>owner node</var> is null, then return.
21272127
<li>Set <var>declaration block</var>'s <a for="CSSStyleDeclaration">updating flag</a>.
@@ -2164,11 +2164,14 @@ The object's <a>supported property indices</a> are the numbers in the range zero
21642164
<a>CSS declarations</a> in the <a for="CSSStyleDeclaration">declarations</a>. If there are no such
21652165
<a>CSS declarations</a>, then there are no <a>supported property indices</a>.
21662166

2167-
The <dfn attribute for=CSSStyleDeclaration>cssText</dfn> attribute must return the result of
2168-
<a lt="serialize a CSS declaration block">serializing</a> the <a for="CSSStyleDeclaration">declarations</a>.
2167+
Getting the <dfn attribute for="CSSStyleDeclaration">cssText</dfn> attribute must run these steps:
2168+
2169+
1. If the <a for="CSSStyleDeclaration">computed flag</a> is set, then return the empty string.
2170+
2. Return the result of <a lt="serialize a CSS declaration block">serializing</a> the <a for="CSSStyleDeclaration">declarations</a>.
2171+
21692172
Setting the {{CSSStyleDeclaration/cssText}} attribute must run these steps:
21702173
<ol>
2171-
<li>If the <a for="CSSStyleDeclaration">readonly flag</a> is set,
2174+
<li>If the <a for="CSSStyleDeclaration">computed flag</a> is set,
21722175
then <a>throw</a> a {{NoModificationAllowedError}} exception.
21732176
<li>Empty the <a for="CSSStyleDeclaration">declarations</a>.
21742177
<li><a lt="Parse a CSS declaration block">Parse</a> the given value and, if the return value is not the empty list, insert the items in the list
@@ -2234,7 +2237,7 @@ value would be "<code>important</code>".</div>
22342237

22352238
The <dfn method for=CSSStyleDeclaration>setProperty(<var>property</var>, <var>value</var>, <var>priority</var>)</dfn> method must run these steps:
22362239
<ol>
2237-
<li>If the <a for="CSSStyleDeclaration">readonly flag</a> is set,
2240+
<li>If the <a for="CSSStyleDeclaration">computed flag</a> is set,
22382241
then <a>throw</a> a {{NoModificationAllowedError}} exception.
22392242
<li>If <var>property</var> is not a <a>custom property</a>, follow these substeps:
22402243
<ol>
@@ -2349,7 +2352,7 @@ use different algorithms as long as the constraints above hold.
23492352

23502353
The <dfn method for=CSSStyleDeclaration>removeProperty(<var>property</var>)</dfn> method must run these steps:
23512354
<ol>
2352-
<li>If the <a for="CSSStyleDeclaration">readonly flag</a> is set,
2355+
<li>If the <a for="CSSStyleDeclaration">computed flag</a> is set,
23532356
then <a>throw</a> a {{NoModificationAllowedError}} exception.
23542357
<li>If <var>property</var> is not a <a>custom property</a>,
23552358
let <var>property</var> be <var>property</var> <a lt="ASCII lowercase">converted to ASCII lowercase</a>.
@@ -2801,7 +2804,7 @@ interface mixin ElementCSSInlineStyle {
28012804
</pre>
28022805

28032806
The <dfn attribute for=ElementCSSInlineStyle>style</dfn> attribute must return a <a>CSS declaration block</a> object whose
2804-
<a for="CSSStyleDeclaration">readonly flag</a> is unset, whose <a for="CSSStyleDeclaration">parent CSS rule</a> is null, and
2807+
<a for="CSSStyleDeclaration">computed flag</a> is unset, whose <a for="CSSStyleDeclaration">parent CSS rule</a> is null, and
28052808
whose <a for="CSSStyleDeclaration">owner node</a> is the <a>context object</a>.
28062809

28072810
If the user agent supports HTML, the following IDL applies: [[HTML]]
@@ -2859,7 +2862,7 @@ steps:
28592862
<li>
28602863
Return a live <a>CSS declaration block</a> with the following properties:
28612864
<dl>
2862-
<dt><a for="CSSStyleDeclaration">readonly flag</a>
2865+
<dt><a for="CSSStyleDeclaration">computed flag</a>
28632866
<dd>Set.
28642867
<dt><a for="CSSStyleDeclaration">declarations</a>
28652868
<dd><var>decls</var>.

0 commit comments

Comments
 (0)