[cssom] first draft of color serialization rules

Mon, 01 Oct 2012 12:17:55 +0800

author
Glenn Adams <glenn@skynav.com>
date
Mon, 01 Oct 2012 12:17:55 +0800
changeset 6802
0d2a6c814dd1
parent 6801
b91a64fff457
child 6803
9d57ffc5916f
child 6806
fddad400b1ff

[cssom] first draft of color serialization rules

cssom/Overview.html file | annotate | diff | comparison | revisions
cssom/cssom-source file | annotate | diff | comparison | revisions
     1.1 --- a/cssom/Overview.html	Sun Sep 30 16:27:02 2012 +0900
     1.2 +++ b/cssom/Overview.html	Mon Oct 01 12:17:55 2012 +0800
     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 27 September 2012</h2>
     1.8 +   <h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 1 October 2012</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 27 September 2012 Editor's Draft of CSSOM. Please send comments to
    1.17 +  <p class="dontpublish">This is the 1 October 2012 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 @@ -2072,7 +2072,47 @@
    1.22     the literal string "<code>deg</code>".</dd>
    1.23  
    1.24     <dt>&lt;color&gt;</dt>
    1.25 -   <dd><p class="issue">preserve system colors, maybe color keywords...</dd>
    1.26 +   <dd>
    1.27 +   <p>If &lt;color&gt; is a component of a resolved or computed value, then
    1.28 +   return the color using the <code>rgb()</code> or <code>rgba()</code> functional
    1.29 +   notation as follows:</p>
    1.30 +   <ol>
    1.31 +   <li>If the alpha component of the color is equal to one, then return the serialization of the
    1.32 +   <code>rgb()</code> functional equivalent of the opaque color.</li>
    1.33 +   <li>If the alpha component of the color is not equal to one, then return the serialization of the
    1.34 +   <code>rgba()</code> functional equivalent of the non-opaque color.</li>
    1.35 +   </ol>
    1.36 +   <p>The serialization of the <code>rgb()</code> functional equivalent is the concatenation of the following:</p>
    1.37 +   <ol>
    1.38 +   <li>The string "<code>rgb(</code>".</li>
    1.39 +   <li>The shortest base-ten integer serialization of the red value.</li>
    1.40 +   <li>The string "<code>, </code>".</li>
    1.41 +   <li>The shortest base-ten serialization of the green value.</li>
    1.42 +   <li>The string "<code>, </code>".</li>
    1.43 +   <li>The shortest base-ten serialization of the blue value.</li>
    1.44 +   <li>The string "<code>)</code>".</li>
    1.45 +   </ol>
    1.46 +   <p>The serialization of the <code>rgba()</code> functional equivalent is the concatenation of the following:</p>
    1.47 +   <ol>
    1.48 +   <li>The string "<code>rgba(</code>".</li>
    1.49 +   <li>The shortest base-ten serialization of the red value.</li>
    1.50 +   <li>The string "<code>, </code>".</li>
    1.51 +   <li>The shortest base-ten serialization of the green value.</li>
    1.52 +   <li>The string "<code>, </code>".</li>
    1.53 +   <li>The shortest base-ten serialization of the blue value.</li>
    1.54 +   <li>The string "<code>, </code>".</li>
    1.55 +   <li>The shortest serialization of the &lt;number&gt; that denotes the alpha value.</li>
    1.56 +   <li>The string "<code>)</code>".</li>
    1.57 +   </ol>
    1.58 +
    1.59 +   <p>If &lt;color&gt; is a component of a specified value, then
    1.60 +   return the color as follows:</p>
    1.61 +   <ol>
    1.62 +   <li>If the color was explicitly specified by the author, then return the original, author specified color value.</li>
    1.63 +   <li>Otherwise, return the value that would be returned if the color were a component of a computed value.</li>
    1.64 +   </ol>
    1.65 +   <p class="issue">Should author specified values be normalized for case? Or should original case be preserved?</p>
    1.66 +   </dd>
    1.67     <!--
    1.68       <dt>It is a system color</dt>
    1.69  
     2.1 --- a/cssom/cssom-source	Sun Sep 30 16:27:02 2012 +0900
     2.2 +++ b/cssom/cssom-source	Mon Oct 01 12:17:55 2012 +0800
     2.3 @@ -1628,7 +1628,47 @@
     2.4     the literal string "<code>deg</code>".</p></dd>
     2.5  
     2.6     <dt>&lt;color></dt>
     2.7 -   <dd><p class="issue">preserve system colors, maybe color keywords...</p></dd>
     2.8 +   <dd>
     2.9 +   <p>If &lt;color&gt; is a component of a resolved or computed value, then
    2.10 +   return the color using the <code>rgb()</code> or <code>rgba()</code> functional
    2.11 +   notation as follows:</p>
    2.12 +   <ol>
    2.13 +   <li>If the alpha component of the color is equal to one, then return the serialization of the
    2.14 +   <code>rgb()</code> functional equivalent of the opaque color.</li>
    2.15 +   <li>If the alpha component of the color is not equal to one, then return the serialization of the
    2.16 +   <code>rgba()</code> functional equivalent of the non-opaque color.</li>
    2.17 +   </ol>
    2.18 +   <p>The serialization of the <code>rgb()</code> functional equivalent is the concatenation of the following:</p>
    2.19 +   <ol>
    2.20 +   <li>The string "<code>rgb(</code>".</li>
    2.21 +   <li>The shortest base-ten integer serialization of the red value.</li>
    2.22 +   <li>The string "<code>, </code>".</li>
    2.23 +   <li>The shortest base-ten serialization of the green value.</li>
    2.24 +   <li>The string "<code>, </code>".</li>
    2.25 +   <li>The shortest base-ten serialization of the blue value.</li>
    2.26 +   <li>The string "<code>)</code>".</li>
    2.27 +   </ol>
    2.28 +   <p>The serialization of the <code>rgba()</code> functional equivalent is the concatenation of the following:</p>
    2.29 +   <ol>
    2.30 +   <li>The string "<code>rgba(</code>".</li>
    2.31 +   <li>The shortest base-ten serialization of the red value.</li>
    2.32 +   <li>The string "<code>, </code>".</li>
    2.33 +   <li>The shortest base-ten serialization of the green value.</li>
    2.34 +   <li>The string "<code>, </code>".</li>
    2.35 +   <li>The shortest base-ten serialization of the blue value.</li>
    2.36 +   <li>The string "<code>, </code>".</li>
    2.37 +   <li>The shortest serialization of the &lt;number&gt; that denotes the alpha value.</li>
    2.38 +   <li>The string "<code>)</code>".</li>
    2.39 +   </ol>
    2.40 +
    2.41 +   <p>If &lt;color&gt; is a component of a specified value, then
    2.42 +   return the color as follows:</p>
    2.43 +   <ol>
    2.44 +   <li>If the color was explicitly specified by the author, then return the original, author specified color value.</li>
    2.45 +   <li>Otherwise, return the value that would be returned if the color were a component of a computed value.</li>
    2.46 +   </ol>
    2.47 +   <p class="issue">Should author specified values be normalized for case? Or should original case be preserved?</p>
    2.48 +   </dd>
    2.49     <!--
    2.50       <dt>It is a system color</dt>
    2.51  

mercurial