Skip to content

Commit d7dbea1

Browse files
author
Simon Pieters
committed
[cssom] Make setProperty without priority argument not unset important. Also affects the camel-cased attributes. <http://www.w3.org/mid/DUB119-W4278E92C9DD13C3E85C782E6590@phx.gbl>
1 parent ca284ec commit d7dbea1

2 files changed

Lines changed: 24 additions & 18 deletions

File tree

cssom/Overview.html

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<h1>CSS Object Model (CSSOM)</h1>
1717

1818

19-
<h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 14 August 2013</h2>
19+
<h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 18 August 2013</h2>
2020

2121
<dl>
2222

@@ -90,7 +90,7 @@ <h2 class="no-num no-toc" id="sotd">Status of This Document</h2>
9090
can be found in the
9191
<a href="http://www.w3.org/TR/">W3C technical reports index at http://www.w3.org/TR/.</a></em>
9292

93-
<p class="dontpublish">This is the 14 August 2013 Editor's Draft of CSSOM. Please send comments to
93+
<p class="dontpublish">This is the 18 August 2013 Editor's Draft of CSSOM. Please send comments to
9494
<a href="mailto:www-style@w3.org?subject=%5Bcssom%5D%20">www-style@w3.org</a>
9595
(<a href="http://lists.w3.org/Archives/Public/www-style/">archived</a>)
9696
with <samp>[cssom]</samp> at the start of the subject line.
@@ -2219,7 +2219,7 @@ <h4 id="the-cssstyledeclaration-interface"><span class="secno">6.5.1 </span>The
22192219
DOMString <a href="#dom-cssstyledeclaration-getpropertyvalue" title="dom-CSSStyleDeclaration-getPropertyValue">getPropertyValue</a>(DOMString property);
22202220
DOMString <a href="#dom-cssstyledeclaration-getpropertypriority" title="dom-CSSStyleDeclaration-getPropertyPriority">getPropertyPriority</a>(DOMString property);
22212221
void <a href="#dom-cssstyledeclaration-setproperty" title="dom-CSSStyleDeclaration-setProperty">setProperty</a>(DOMString property, [TreatNullAs=EmptyString] DOMString value, <!--
2222-
-->[TreatNullAs=EmptyString] optional DOMString priority = "");
2222+
-->[TreatNullAs=EmptyString] optional DOMString priority);
22232223
DOMString <a href="#dom-cssstyledeclaration-removeproperty" title="dom-CSSStyleDeclaration-removeProperty">removeProperty</a>(DOMString property);
22242224
readonly attribute <a href="#cssrule">CSSRule</a>? <a href="#dom-cssstyledeclaration-length" title="dom-CSSStyleDeclaration-length">parentRule</a>;
22252225
attribute DOMString <a href="#dom-cssstyledeclaration-cssfloat" title="dom-CSSStyleDeclaration-cssFloat">cssFloat</a>;<!-- setProperty's value arg has [TreatNullAs=EmptyString] -->
@@ -2303,32 +2303,34 @@ <h4 id="the-cssstyledeclaration-interface"><span class="secno">6.5.1 </span>The
23032303
algorithm.</li>
23042304
<li><p>If <var>value</var> is the empty string, invoke <code title="dom-CSSStyleDeclaration-removeProperty"><a href="#dom-cssstyledeclaration-removeproperty">removeProperty()</a></code>
23052305
with <var>property</var> as argument and terminate this algorithm.</li>
2306-
<li><p>If <var>priority</var> is neither an <a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#ascii-case-insensitive">ASCII case-insensitive</a> match for the string "<code title="">important</code>"
2307-
nor the empty string terminate this algorithm.</li>
2306+
<li><p>If <var>priority</var> is not specified, let <var>priority action</var> be "leave as is". Otherwise, if <var>priority</var> is the empty string, let
2307+
<var>priority action</var> be "unset important". Otherwise, if <var>priority</var> is an <a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#ascii-case-insensitive">ASCII case-insensitive</a> match for the
2308+
string "<code title="">important</code>", set <var>priority action</var> to "set important". Otherwise, terminate this algorithm.
23082309
<li>
23092310
<p>Let <var>component value list</var> be the result of <a href="#parse-a-css-value" title="parse a CSS value">parsing</a> <var>value</var>.
23102311
<p class="note"><var>value</var> can not include "<code title="">!important</code>".</p>
23112312
</li>
23122313
<li><p>If <var>component value list</var> is null terminate these steps.
23132314
<li><p>If <var>property</var> is a shorthand property, then for each longhand property <var>longhand</var> that <var>property</var> maps to, in canonical
23142315
order, <a href="#set-a-css-property" title="set a CSS property">set the CSS property</a> <var>longhand</var> to the appropriate value(s) from <var>component value list</var>, with
2315-
the <var>important</var> flag set if <var>priority</var> is not the empty string, and with the list of declarations being the
2316+
<i>priority action</i> being <var>priority action</var>, and with the list of declarations being the
23162317
<a href="#concept-css-declaration-block-declarations" title="concept-css-declaration-block-declarations">declarations</a>.
23172318
<li><p>Otherwise, <a href="#set-a-css-property" title="set a CSS property">set the CSS property</a> <var>property</var> to <var>component value list</var>, with
2318-
the <var>important</var> flag set if <var>priority</var> is not the empty string, and with the list of declarations being the
2319+
<i>priority action</i> being <var>priority action</var>, and with the list of declarations being the
23192320
<a href="#concept-css-declaration-block-declarations" title="concept-css-declaration-block-declarations">declarations</a>.
23202321
</ol>
23212322

2322-
<p>To <dfn id="set-a-css-property">set a CSS property</dfn> <var>property</var> to a value <var>component value list</var> and optionally with an <var>important</var> flag set, in a
2323-
list of declarations <var>declarations</var>, follow these steps:
2323+
<p>To <dfn id="set-a-css-property">set a CSS property</dfn> <var>property</var> to a value <var>component value list</var> and with <i>priority action</i> being either "set
2324+
important", "unset important" or "leave as is", in a list of declarations <var>declarations</var>, follow these steps:
23242325

23252326
<ol>
23262327
<li><p>If <var>property</var> is a <a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#case-sensitive">case-sensitive</a> match for a property of a declaration in
23272328
<var>declarations</var>, let <var>declaration</var> be that declaration.
23282329
<li><p>Otherwise, append a new declaration with the property name <var>property</var> to <var>declarations</var> and let <var>declaration</var> be that
23292330
declaration.
23302331
<li><p>Set <var>declaration</var>'s value to <var>component value list</var>.
2331-
<li><p>Set the declaration's <i>important</i> flag if <var>important</var> is set, or unset it otherwise.
2332+
<li><p>If <i>priority action</i> is "set important", set the declaration's <i>important</i> flag.
2333+
<li><p>Otherwise, if <i>priority action</i> is "unset important", unset the declaration's <i>important</i> flag.
23322334
</ol>
23332335

23342336
<p>The <dfn id="dom-cssstyledeclaration-removeproperty" title="dom-CSSStyleDeclaration-removeProperty"><code>removeProperty(<var>property</var>)</code></dfn> method must run these steps:</p>
@@ -3070,6 +3072,7 @@ <h2 class="no-num" id="acknowledgments">Acknowledgments</h2>
30703072
Mike Sherov,
30713073
Morten Stenshorne,
30723074
Øyvind Stenhaug,
3075+
Peter Sloetjes,
30733076
Philip Taylor,
30743077
Robert O'Callahan,
30753078
Simon Sapin,

cssom/Overview.src.html

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2141,7 +2141,7 @@ <h4>The <code title>CSSStyleDeclaration</code> Interface</h4>
21412141
DOMString <span title=dom-CSSStyleDeclaration-getPropertyValue>getPropertyValue</span>(DOMString property);
21422142
DOMString <span title=dom-CSSStyleDeclaration-getPropertyPriority>getPropertyPriority</span>(DOMString property);
21432143
void <span title=dom-CSSStyleDeclaration-setProperty>setProperty</span>(DOMString property, [TreatNullAs=EmptyString] DOMString value, <!--
2144-
-->[TreatNullAs=EmptyString] optional DOMString priority = "");
2144+
-->[TreatNullAs=EmptyString] optional DOMString priority);
21452145
DOMString <span title=dom-CSSStyleDeclaration-removeProperty>removeProperty</span>(DOMString property);
21462146
readonly attribute <span>CSSRule</span>? <span title=dom-CSSStyleDeclaration-length>parentRule</span>;
21472147
attribute DOMString <span title=dom-CSSStyleDeclaration-cssFloat>cssFloat</span>;<!-- setProperty's value arg has [TreatNullAs=EmptyString] -->
@@ -2225,32 +2225,34 @@ <h4>The <code title>CSSStyleDeclaration</code> Interface</h4>
22252225
algorithm.</p></li>
22262226
<li><p>If <var>value</var> is the empty string, invoke <code title='dom-CSSStyleDeclaration-removeProperty'>removeProperty()</code>
22272227
with <var>property</var> as argument and terminate this algorithm.</p></li>
2228-
<li><p>If <var>priority</var> is neither an <span data-anolis-spec=dom>ASCII case-insensitive</span> match for the string "<code title>important</code>"
2229-
nor the empty string terminate this algorithm.</p></li>
2228+
<li><p>If <var>priority</var> is not specified, let <var>priority action</var> be "leave as is". Otherwise, if <var>priority</var> is the empty string, let
2229+
<var>priority action</var> be "unset important". Otherwise, if <var>priority</var> is an <span data-anolis-spec=dom>ASCII case-insensitive</span> match for the
2230+
string "<code title>important</code>", set <var>priority action</var> to "set important". Otherwise, terminate this algorithm.
22302231
<li>
22312232
<p>Let <var>component value list</var> be the result of <span title='parse a CSS value'>parsing</span> <var>value</var>.
22322233
<p class='note'><var>value</var> can not include "<code title>!important</code>".</p>
22332234
</li>
22342235
<li><p>If <var>component value list</var> is null terminate these steps.
22352236
<li><p>If <var>property</var> is a shorthand property, then for each longhand property <var>longhand</var> that <var>property</var> maps to, in canonical
22362237
order, <span title="set a CSS property">set the CSS property</span> <var>longhand</var> to the appropriate value(s) from <var>component value list</var>, with
2237-
the <var>important</var> flag set if <var>priority</var> is not the empty string, and with the list of declarations being the
2238+
<i>priority action</i> being <var>priority action</var>, and with the list of declarations being the
22382239
<span title=concept-css-declaration-block-declarations>declarations</span>.
22392240
<li><p>Otherwise, <span title="set a CSS property">set the CSS property</span> <var>property</var> to <var>component value list</var>, with
2240-
the <var>important</var> flag set if <var>priority</var> is not the empty string, and with the list of declarations being the
2241+
<i>priority action</i> being <var>priority action</var>, and with the list of declarations being the
22412242
<span title=concept-css-declaration-block-declarations>declarations</span>.
22422243
</ol>
22432244

2244-
<p>To <dfn>set a CSS property</dfn> <var>property</var> to a value <var>component value list</var> and optionally with an <var>important</var> flag set, in a
2245-
list of declarations <var>declarations</var>, follow these steps:
2245+
<p>To <dfn>set a CSS property</dfn> <var>property</var> to a value <var>component value list</var> and with <i>priority action</i> being either "set
2246+
important", "unset important" or "leave as is", in a list of declarations <var>declarations</var>, follow these steps:
22462247

22472248
<ol>
22482249
<li><p>If <var>property</var> is a <span data-anolis-spec=dom>case-sensitive</span> match for a property of a declaration in
22492250
<var>declarations</var>, let <var>declaration</var> be that declaration.
22502251
<li><p>Otherwise, append a new declaration with the property name <var>property</var> to <var>declarations</var> and let <var>declaration</var> be that
22512252
declaration.
22522253
<li><p>Set <var>declaration</var>'s value to <var>component value list</var>.
2253-
<li><p>Set the declaration's <i>important</i> flag if <var>important</var> is set, or unset it otherwise.
2254+
<li><p>If <i>priority action</i> is "set important", set the declaration's <i>important</i> flag.
2255+
<li><p>Otherwise, if <i>priority action</i> is "unset important", unset the declaration's <i>important</i> flag.
22542256
</ol>
22552257

22562258
<p>The <dfn title=dom-CSSStyleDeclaration-removeProperty><code>removeProperty(<var>property</var>)</code></dfn> method must run these steps:</p>
@@ -2944,6 +2946,7 @@ <h2 class="no-num">Acknowledgments</h2>
29442946
Mike Sherov,
29452947
Morten Stenshorne,
29462948
Øyvind Stenhaug,
2949+
Peter Sloetjes,
29472950
Philip Taylor,
29482951
Robert O'Callahan,
29492952
Simon Sapin,

0 commit comments

Comments
 (0)