1.1 --- a/cssom/Overview.src.html Wed Sep 11 12:15:43 2013 +0200 1.2 +++ b/cssom/Overview.src.html Wed Sep 11 14:18:55 2013 +0200 1.3 @@ -2176,7 +2176,7 @@ 1.4 <li><p>If <var>property</var> maps to one or more shorthand properties, let <var>shorthands</var> be an array of those shorthand properties, in 1.5 <span title=concept-shorthands-preferred-order>preferred order</span>, and follow these substeps: 1.6 <ol> 1.7 - <li><p>Let <var>longhands</var> an array consisting of all <span title="CSS declaration">CSS declarations</span> in <var>declaration block</var>'s 1.8 + <li><p>Let <var>longhands</var> be an array consisting of all <span title="CSS declaration">CSS declarations</span> in <var>declaration block</var>'s 1.9 <span title=concept-css-declaration-block-declarations>declarations</span> that that are not in <var>already serialized</var> and have a 1.10 <span title=concept-css-declaration-property-name>property name</span> that 1.11 maps to one of the shorthand properties in <var>shorthands</var>. 1.12 @@ -2247,7 +2247,9 @@ 1.13 DOMString <span title=dom-CSSStyleDeclaration-getPropertyValue>getPropertyValue</span>(DOMString property); 1.14 DOMString <span title=dom-CSSStyleDeclaration-getPropertyPriority>getPropertyPriority</span>(DOMString property); 1.15 void <span title=dom-CSSStyleDeclaration-setProperty>setProperty</span>(DOMString property, [TreatNullAs=EmptyString] DOMString value, <!-- 1.16 - -->[TreatNullAs=EmptyString] optional DOMString priority); 1.17 + -->[TreatNullAs=EmptyString] optional DOMString priority = ""); 1.18 + void <span title=dom-CSSStyleDeclaration-setPropertyValue>setPropertyValue</span>(DOMString property, [TreatNullAs=EmptyString] DOMString value); 1.19 + void <span title=dom-CSSStyleDeclaration-setPropertyPriority>setPropertyPriority</span>(DOMString property, [TreatNullAs=EmptyString] DOMString priority); 1.20 DOMString <span title=dom-CSSStyleDeclaration-removeProperty>removeProperty</span>(DOMString property); 1.21 readonly attribute <span>CSSRule</span>? <span title=dom-CSSStyleDeclaration-parentRule>parentRule</span>; 1.22 attribute DOMString <span title=dom-CSSStyleDeclaration-cssFloat>cssFloat</span>;<!-- setProperty's value arg has [TreatNullAs=EmptyString] --> 1.23 @@ -2331,25 +2333,59 @@ 1.24 algorithm.</p></li> 1.25 <li><p>If <var>value</var> is the empty string, invoke <code title='dom-CSSStyleDeclaration-removeProperty'>removeProperty()</code> 1.26 with <var>property</var> as argument and terminate this algorithm.</p></li> 1.27 - <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 1.28 - <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 1.29 - string "<code title>important</code>", set <var>priority action</var> to "set important". Otherwise, terminate this algorithm. 1.30 + <li><p>If <var>priority</var> is not the empty string and is not an <span data-anolis-spec=dom>ASCII case-insensitive</span> match for the string 1.31 + "<code title>important</code>", terminate this algorithm. 1.32 <li> 1.33 <p>Let <var>component value list</var> be the result of <span title='parse a CSS value'>parsing</span> <var>value</var>. 1.34 <p class='note'><var>value</var> can not include "<code title>!important</code>".</p> 1.35 </li> 1.36 <li><p>If <var>component value list</var> is null terminate these steps. 1.37 <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 1.38 - 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 1.39 - <i>priority action</i> being <var>priority action</var>, and with the list of declarations being the 1.40 + order, <span title="append a CSS declaration">append the CSS declaration</span> <var>longhand</var> with the appropriate value(s) from <var>component value 1.41 + list</var>, with the <i>important</i> flag set if <var>priority</var> is not the empty string, and unset otherwise, and with the list of declarations being the 1.42 <span title=concept-css-declaration-block-declarations>declarations</span>. 1.43 - <li><p>Otherwise, <span title="set a CSS property">set the CSS property</span> <var>property</var> to <var>component value list</var>, with 1.44 - <i>priority action</i> being <var>priority action</var>, and with the list of declarations being the 1.45 + <li><p>Otherwise, <span title="append a CSS declaration">append the CSS declaration</span> <var>property</var> with value <var>component value list</var>, with 1.46 + the <i>important</i> flag set if <var>priority</var> is not the empty string, and unset otherwise, and with the list of declarations being the 1.47 <span title=concept-css-declaration-block-declarations>declarations</span>. 1.48 </ol> 1.49 1.50 -<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 1.51 -important", "unset important" or "leave as is", in a list of declarations <var>declarations</var>, follow these steps: 1.52 +<p>To <dfn>append a CSS declaration</dfn> <var>property</var> with a value <var>component value list</var> and optionally with an <i>important</i> flag set, in 1.53 +a list of declarations <var>declarations</var>, follow these steps: 1.54 + 1.55 +<ol> 1.56 + <li><p>If <var>property</var> is a <span data-anolis-spec=dom>case-sensitive</span> match for a <span title=concept-css-declaration-property-name>property 1.57 + name</span> of a <span>CSS declaration</span> in <var>declarations</var>, let <var>declaration</var> be that <span>CSS declaration</span>. 1.58 + <li><p>Otherwise, append a new <span>CSS declaration</span> with the <span title=concept-css-declaration-property-name>property name</span> <var>property</var> 1.59 + to <var>declarations</var> and let <var>declaration</var> be that <span>CSS declaration</span>. 1.60 + <li><p>If <var>declaration</var> has its <span title=concept-css-declaration-important-flag>important flag</span> set and the <i>important</i> flag is not set, 1.61 + terminate these steps. 1.62 + <li><p>Set <var>declaration</var>'s <span title=concept-css-declaration-value>value</span> to <var>component value list</var>. 1.63 + <li><p>If the <i>important</i> flag is set, set <var>declaration</var>'s <span title=concept-css-declaration-important-flag>important flag</span>. 1.64 +</ol> 1.65 + 1.66 +<p>The <dfn title=dom-CSSStyleDeclaration-setPropertyValue><code>setPropertyValue(<var>property</var>, <var>value</var>)</code></dfn> method must run these 1.67 +steps:</p> 1.68 +<ol> 1.69 + <li><p>If the <span title=concept-css-declaration-block-readonly-flag>readonly flag</span> is set, <span data-anolis-spec=dom title=concept-throw>throw</span> 1.70 + a <code data-anolis-spec=dom>NoModificationAllowedError</code> exception and terminate these steps.</li> 1.71 + <li><p>Let <var>property</var> be <var>property</var> <span data-anolis-spec=dom>converted to ASCII lowercase</span>. 1.72 + <li><p>If <var>property</var> is not a <span data-anolis-spec=dom>case-sensitive</span> match for a <span>supported CSS property</span>, terminate this 1.73 + algorithm.</p></li> 1.74 + <li><p>If <var>value</var> is the empty string, invoke <code title='dom-CSSStyleDeclaration-removeProperty'>removeProperty()</code> 1.75 + with <var>property</var> as argument and terminate this algorithm.</p></li> 1.76 + <li> 1.77 + <p>Let <var>component value list</var> be the result of <span title='parse a CSS value'>parsing</span> <var>value</var>. 1.78 + <p class='note'><var>value</var> can not include "<code title>!important</code>".</p> 1.79 + </li> 1.80 + <li><p>If <var>component value list</var> is null terminate these steps. 1.81 + <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 1.82 + order, <span title="set a CSS declaration value">set the CSS declaration value</span> <var>longhand</var> to the appropriate value(s) from <var>component 1.83 + value list</var>, and with the list of declarations being the <span title=concept-css-declaration-block-declarations>declarations</span>. 1.84 + <li><p>Otherwise, <span title="set a CSS declaration value">set the CSS declaration value</span> <var>property</var> to the value <var>component value 1.85 + list</var>, and with the list of declarations being the <span title=concept-css-declaration-block-declarations>declarations</span>. 1.86 +</ol> 1.87 + 1.88 +<p>To <dfn>set a CSS declaration value</dfn> to a value <var>component value list</var> in a list of declarations <var>declarations</var>, follow these steps: 1.89 1.90 <ol> 1.91 <li><p>If <var>property</var> is a <span data-anolis-spec=dom>case-sensitive</span> match for a <span title=concept-css-declaration-property-name>property 1.92 @@ -2357,9 +2393,37 @@ 1.93 <li><p>Otherwise, append a new <span>CSS declaration</span> with the <span title=concept-css-declaration-property-name>property name</span> <var>property</var> 1.94 to <var>declarations</var> and let <var>declaration</var> be that <span>CSS declaration</span>. 1.95 <li><p>Set <var>declaration</var>'s <span title=concept-css-declaration-value>value</span> to <var>component value list</var>. 1.96 - <li><p>If <i>priority action</i> is "set important", set <var>declaration</var>'s <span title=concept-css-declaration-important-flag>important flag</span>. 1.97 - <li><p>Otherwise, if <i>priority action</i> is "unset important", unset <var>declaration</var>'s <span title=concept-css-declaration-important-flag>important 1.98 - flag</span>. 1.99 +</ol> 1.100 + 1.101 +<p>The <dfn title=dom-CSSStyleDeclaration-setPropertyPriority><code>setPropertyPriority(<var>property</var>, <var>priority</var>)</code></dfn> method must run 1.102 +these steps:</p> 1.103 + 1.104 +<ol> 1.105 + <li><p>If the <span title=concept-css-declaration-block-readonly-flag>readonly flag</span> is set, <span data-anolis-spec=dom title=concept-throw>throw</span> 1.106 + a <code data-anolis-spec=dom>NoModificationAllowedError</code> exception and terminate these steps.</li> 1.107 + <li><p>Let <var>property</var> be <var>property</var> <span data-anolis-spec=dom>converted to ASCII lowercase</span>. 1.108 + <li><p>If <var>property</var> is not a <span data-anolis-spec=dom>case-sensitive</span> match for a <span>supported CSS property</span>, terminate this 1.109 + algorithm.</p></li> 1.110 + <li><p>If <var>priority</var> is not the empty string and is not an <span data-anolis-spec=dom>ASCII case-insensitive</span> match for the string 1.111 + "<code title>important</code>", terminate this algorithm. 1.112 + <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 1.113 + order, <span title="set a CSS declaration priority">set the CSS declaration priority</span> <var>longhand</var> with the <i>important</i> flag set if 1.114 + <var>priority</var> is not the empty string, and unset otherwise, and with the list of declarations being the 1.115 + <span title=concept-css-declaration-block-declarations>declarations</span>. 1.116 + <li><p>Otherwise, <span title="set a CSS declaration priority">set the CSS declaration priority</span> <var>property</var> with the <i>important</i> flag set 1.117 + if <var>priority</var> is not the empty string, and unset otherwise, and with the list of declarations being the 1.118 + <span title=concept-css-declaration-block-declarations>declarations</span>. 1.119 +</ol> 1.120 + 1.121 +<p>To <dfn>set a CSS declaration priority</dfn> <var>property</var> optionally with an <i>important</i> flag set, in a list of declarations 1.122 +<var>declarations</var>, follow these steps: 1.123 + 1.124 +<ol> 1.125 + <li><p>If <var>property</var> is a <span data-anolis-spec=dom>case-sensitive</span> match for a <span title=concept-css-declaration-property-name>property 1.126 + name</span> of a <span>CSS declaration</span> in <var>declarations</var>, let <var>declaration</var> be that <span>CSS declaration</span>. 1.127 + <li><p>Otherwise, terminate these steps. 1.128 + <li><p>If the <i>important</i> flag is set, set <var>declaration</var>'s <span title=concept-css-declaration-important-flag>important flag</span>. Otherwise, 1.129 + unset <var>declaration</var>'s <span title=concept-css-declaration-important-flag>important flag</span>. 1.130 </ol> 1.131 1.132 <p>The <dfn title=dom-CSSStyleDeclaration-removeProperty><code>removeProperty(<var>property</var>)</code></dfn> method must run these steps:</p>