[cssom] Expose all supported CSS properties as IDL attributes on CSSStyleDeclaration

Tue, 16 Apr 2013 17:01:22 +0200

author
Simon Pieters <simonp@opera.com>
date
Tue, 16 Apr 2013 17:01:22 +0200
changeset 7948
360713dc452f
parent 7947
78ab98b686d3
child 7949
c5506c8ff868

[cssom] Expose all supported CSS properties as IDL attributes on CSSStyleDeclaration

cssom/Overview.html file | annotate | diff | comparison | revisions
cssom/cssom-source file | annotate | diff | comparison | revisions
cssom/data/xrefs/css/cssom.json file | annotate | diff | comparison | revisions
     1.1 --- a/cssom/Overview.html	Tue Apr 16 15:00:38 2013 +0200
     1.2 +++ b/cssom/Overview.html	Tue Apr 16 17:01:22 2013 +0200
     1.3 @@ -18,7 +18,7 @@
     1.4  
     1.5     <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
     1.6  
     1.7 -   <h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 15 April 2013</h2>
     1.8 +   <h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 16 April 2013</h2>
     1.9  
    1.10     <dl>
    1.11  
    1.12 @@ -83,7 +83,7 @@
    1.13    can be found in the
    1.14    <a href="http://www.w3.org/TR/">W3C technical reports index at http://www.w3.org/TR/.</a></em>
    1.15  
    1.16 -  <p class="dontpublish">This is the 15 April 2013 Editor's Draft of CSSOM. Please send comments to
    1.17 +  <p class="dontpublish">This is the 16 April 2013 Editor's Draft of CSSOM. Please send comments to
    1.18    <a href="mailto:www-style@w3.org?subject=%5Bcssom%5D%20">www-style@w3.org</a>
    1.19    (<a href="http://lists.w3.org/Archives/Public/www-style/">archived</a>)
    1.20    with <samp>[cssom]</samp> at the start of the subject line.
    1.21 @@ -1978,7 +1978,66 @@
    1.22  <p>The <code>removeProperty</code> operation must run these steps:</p>    <ol>     <li><p>If the <a href="#css-declaration-block-readonly-flag">CSS declaration block readonly flag</a> is set, <a class="external" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a> a       '<code class="external"><a href="http://dom.spec.whatwg.org/#nomodificationallowederror">NoModificationAllowedError</a></code>' and terminate these steps.</li>     <li><p>If <var>property</var> is an <a class="external" href="http://dom.spec.whatwg.org/#ascii-case-insensitive">ASCII case-insensitive</a> match for a property of a declaration in the       <span>collection of CSS declarations</span> remove the declaration.</li>    </ol></dd>
    1.23  </dl>
    1.24  
    1.25 -
    1.26 +  
    1.27 +  <p>For each CSS property <var>property</var> that the user agent supports, the following
    1.28 +  partial interface applies where <var>attribute</var> is obtained by running the
    1.29 +  <a href="#css-property-to-idl-attribute">CSS property to IDL attribute</a> algorithm for <var>property</var>.
    1.30 +
    1.31 +  <pre class="idl">partial interface CSSStyleDeclaration {
    1.32 +  attribute DOMString <var>attribute</var>;
    1.33 +};</pre>
    1.34 +
    1.35 +  <p>Getting the <var>attribute</var> attribute must return the result of invoking
    1.36 +  <code title="dom-CSSStyleDeclaration-getPropertyValue">getPropertyValue()</code> with as
    1.37 +  argument the result of running the <a href="#idl-attribute-to-css-property">IDL attribute to CSS property</a>
    1.38 +  algorithm for <var>attribute</var>.</p>
    1.39 +
    1.40 +  <p>Setting the <var>attribute</var> attribute must invoke
    1.41 +  <code title="dom-CSSStyleDeclaration-setPropertyValue">setPropertyValue()</code> with as
    1.42 +  first argument the result of running the <a href="#idl-attribute-to-css-property">IDL attribute to CSS property</a>
    1.43 +  algorithm for <var>attribute</var>, as second argument the given value, and no third argument. Any
    1.44 +  exceptions thrown must be re-thrown.</p>
    1.45 +    
    1.46 +  <p>The <dfn id="css-property-to-idl-attribute">CSS property to IDL attribute</dfn> algorithm for <var>property</var> is as
    1.47 +  follows:</p>
    1.48 +  
    1.49 +  <ol>
    1.50 +    <li><p>Let <var>output</var> be the empty string.
    1.51 +    
    1.52 +    <li><p>Let <var>uppercase next</var> be unset.
    1.53 +    
    1.54 +    <li><p>For each character <var>c</var> in <var>property</var>:
    1.55 +    
    1.56 +      <ol>
    1.57 +        <li><p>If <var>c</var> is "<code title="">-</code>" (U+002D), let <var>uppercase next</var> be set.
    1.58 +        
    1.59 +        <li><p>Otherwise, if <var>uppercase next</var> is set, let <var>uppercase next</var> be unset and append <var>c</var> converted to ASCII uppercase to <var>output</var>.
    1.60 +        
    1.61 +        <li><p>Otherwise, append <var>c</var> to <var>output</var>.
    1.62 +      </ol>
    1.63 +    
    1.64 +    <li><p>Return <var>output</var>.
    1.65 +  </ol>
    1.66 +  
    1.67 +  <p>The <dfn id="idl-attribute-to-css-property">IDL attribute to CSS property</dfn> algorithm for <var>attribute</var> is as
    1.68 +  follows:</p>
    1.69 +
    1.70 +  <ol>
    1.71 +    <li><p>Let <var>output</var> be the empty string.
    1.72 +        
    1.73 +    <li><p>For each character <var>c</var> in <var>attribute</var>:
    1.74 +    
    1.75 +      <ol>
    1.76 +        <li><p>If <var>c</var> is in the range U+0041 to U+005A (ASCII uppercase), append "<code title="">-</code>" (U+002D) followed by <var>c</var> converted to ASCII lowercase to <var>output</var>.
    1.77 +                
    1.78 +        <li><p>Otherwise, append <var>c</var> to <var>output</var>.
    1.79 +      </ol>
    1.80 +    
    1.81 +    <li><p>Return <var>output</var>.
    1.82 +  </ol>
    1.83 +  
    1.84 +
    1.85 +<!--
    1.86    <hr>
    1.87  
    1.88    <p>For the table below, the IDL attribute in the first column
    1.89 @@ -2003,9 +2062,9 @@
    1.90       <th>IDL attribute
    1.91       <th>CSS property
    1.92     <tbody>
    1.93 -<!--CSSOM-DECLARATIONTABLE-->
    1.94 +<!- -CSSOM-DECLARATIONTABLE- ->
    1.95    </table>
    1.96 -
    1.97 +-->
    1.98  <!--
    1.99    <h4>CSS Properties</h4>
   1.100  
     2.1 --- a/cssom/cssom-source	Tue Apr 16 15:00:38 2013 +0200
     2.2 +++ b/cssom/cssom-source	Tue Apr 16 17:01:22 2013 +0200
     2.3 @@ -1534,7 +1534,66 @@
     2.4    <h4>The <code>CSSStyleDeclaration</code> Interface</h4>
     2.5  
     2.6    <!--{@idl(CSSStyleDeclaration)}-->
     2.7 -
     2.8 +  
     2.9 +  <p>For each CSS property <var>property</var> that the user agent supports, the following
    2.10 +  partial interface applies where <var>attribute</var> is obtained by running the
    2.11 +  <span>CSS property to IDL attribute</span> algorithm for <var>property</var>.
    2.12 +
    2.13 +  <pre class=idl>partial interface CSSStyleDeclaration {
    2.14 +  attribute DOMString <var>attribute</var>;
    2.15 +};</pre>
    2.16 +
    2.17 +  <p>Getting the <var>attribute</var> attribute must return the result of invoking
    2.18 +  <code title=dom-CSSStyleDeclaration-getPropertyValue>getPropertyValue()</code> with as
    2.19 +  argument the result of running the <span>IDL attribute to CSS property</span>
    2.20 +  algorithm for <var>attribute</var>.</p>
    2.21 +
    2.22 +  <p>Setting the <var>attribute</var> attribute must invoke
    2.23 +  <code title=dom-CSSStyleDeclaration-setPropertyValue>setPropertyValue()</code> with as
    2.24 +  first argument the result of running the <span>IDL attribute to CSS property</span>
    2.25 +  algorithm for <var>attribute</var>, as second argument the given value, and no third argument. Any
    2.26 +  exceptions thrown must be re-thrown.</p>
    2.27 +    
    2.28 +  <p>The <dfn>CSS property to IDL attribute</dfn> algorithm for <var>property</var> is as
    2.29 +  follows:</p>
    2.30 +  
    2.31 +  <ol>
    2.32 +    <li><p>Let <var>output</var> be the empty string.
    2.33 +    
    2.34 +    <li><p>Let <var>uppercase next</var> be unset.
    2.35 +    
    2.36 +    <li><p>For each character <var>c</var> in <var>property</var>:
    2.37 +    
    2.38 +      <ol>
    2.39 +        <li><p>If <var>c</var> is "<code title>-</code>" (U+002D), let <var>uppercase next</var> be set.
    2.40 +        
    2.41 +        <li><p>Otherwise, if <var>uppercase next</var> is set, let <var>uppercase next</var> be unset and append <var>c</var> converted to ASCII uppercase to <var>output</var>.
    2.42 +        
    2.43 +        <li><p>Otherwise, append <var>c</var> to <var>output</var>.
    2.44 +      </ol>
    2.45 +    
    2.46 +    <li><p>Return <var>output</var>.
    2.47 +  </ol>
    2.48 +  
    2.49 +  <p>The <dfn>IDL attribute to CSS property</dfn> algorithm for <var>attribute</var> is as
    2.50 +  follows:</p>
    2.51 +
    2.52 +  <ol>
    2.53 +    <li><p>Let <var>output</var> be the empty string.
    2.54 +        
    2.55 +    <li><p>For each character <var>c</var> in <var>attribute</var>:
    2.56 +    
    2.57 +      <ol>
    2.58 +        <li><p>If <var>c</var> is in the range U+0041 to U+005A (ASCII uppercase), append "<code title>-</code>" (U+002D) followed by <var>c</var> converted to ASCII lowercase to <var>output</var>.
    2.59 +                
    2.60 +        <li><p>Otherwise, append <var>c</var> to <var>output</var>.
    2.61 +      </ol>
    2.62 +    
    2.63 +    <li><p>Return <var>output</var>.
    2.64 +  </ol>
    2.65 +  
    2.66 +
    2.67 +<!--
    2.68    <hr>
    2.69  
    2.70    <p>For the table below, the IDL attribute in the first column
    2.71 @@ -1559,9 +1618,9 @@
    2.72       <th>IDL attribute
    2.73       <th>CSS property
    2.74     <tbody>
    2.75 -<!--CSSOM-DECLARATIONTABLE-->
    2.76 +<!- -CSSOM-DECLARATIONTABLE- ->
    2.77    </table>
    2.78 -
    2.79 +-->
    2.80  <!--
    2.81    <h4>CSS Properties</h4>
    2.82  
     3.1 --- a/cssom/data/xrefs/css/cssom.json	Tue Apr 16 15:00:38 2013 +0200
     3.2 +++ b/cssom/data/xrefs/css/cssom.json	Tue Apr 16 17:01:22 2013 +0200
     3.3 @@ -11,6 +11,7 @@
     3.4      "css declaration block": "css-declaration-block",
     3.5      "css declaration block declarations": "css-declaration-block-declarations",
     3.6      "css declaration block readonly flag": "css-declaration-block-readonly-flag",
     3.7 +    "css property to idl attribute": "css-property-to-idl-attribute",
     3.8      "css rule": "rule",
     3.9      "css style sheet": "css-style-sheet",
    3.10      "document style sheets": "document-style-sheets",
    3.11 @@ -19,6 +20,7 @@
    3.12      "escape a character": "escape-a-character",
    3.13      "escape a character as code point": "escape-a-character-as-code-point",
    3.14      "http-default-style": "default-style",
    3.15 +    "idl attribute to css property": "idl-attribute-to-css-property",
    3.16      "insert a css rule": "insert-a-css-rule",
    3.17      "last style sheet set name": "last-style-sheet-set-name",
    3.18      "parse a css declaration block": "parse-a-css-declaration-block",

mercurial