[html5] r5726 - [giow] (0) Clarify handling of CSS colors.

whatwg at whatwg.org whatwg at whatwg.org
Wed Dec 29 15:07:23 PST 2010


Author: ianh
Date: 2010-12-29 15:07:21 -0800 (Wed, 29 Dec 2010)
New Revision: 5726

Modified:
   complete.html
   index
   source
Log:
[giow] (0) Clarify handling of CSS colors.

Modified: complete.html
===================================================================
--- complete.html	2010-12-29 22:43:30 UTC (rev 5725)
+++ complete.html	2010-12-29 23:07:21 UTC (rev 5726)
@@ -3337,6 +3337,33 @@
 
    </dd>
 
+   <dt>CSS modules</dt>
+
+   <dd>
+
+    <p>While support for CSS as a whole is not required of
+    implementations of this specification (though it is encouraged, at
+    least for Web browsers), some features are defined in terms of
+    specific CSS requirements.</p>
+
+    <p>In particular, some features require that a string be
+    <dfn id=parsed-as-a-css-color-value>parsed as a CSS <color> value</dfn>. When parsing a CSS
+    value, user agents are required by the CSS specifications to apply
+    some error handling rules. These apply to this specification also.
+    <a href=#refsCSSCOLOR>[CSSCOLOR]</a> <a href=#refsCSS>[CSS]</a></p>
+
+    <p class=example>For example, user agents are required to close
+    all open constructs upon finding the end of a style sheet
+    unexpectedly. Thus, when parsing the string "<code title="">rgb(0,0,0</code>" (with a missing close-parenthesis) for
+    a color value, the close parenthesis is implied by this error
+    handling rule, and a value is obtained (the color 'black').
+    However, the similar construct "<code title="">rgb(0,0,</code>"
+    (with both a missing parenthesis and a missing "blue" value)
+    cannot be parsed, as it closing the open construct does not result
+    in a viable value.</p>
+
+   </dd>
+
   </dl><p>This specification does not <em>require</em> support of any
   particular network protocol, style sheet language, scripting
   language, or any of the DOM specifications beyond those described
@@ -32045,13 +32072,14 @@
 
   <p>Both attributes can be either strings,
   <code><a href=#canvasgradient>CanvasGradient</a></code>s, or <code><a href=#canvaspattern>CanvasPattern</a></code>s. On
-  setting, strings must be parsed as CSS <color> values and the
-  color assigned, and <code><a href=#canvasgradient>CanvasGradient</a></code> and
+  setting, strings must be <a href=#parsed-as-a-css-color-value title="parsed as a CSS <color>
+  value">parsed as CSS <color> values</a> and the color
+  assigned, and <code><a href=#canvasgradient>CanvasGradient</a></code> and
   <code><a href=#canvaspattern>CanvasPattern</a></code> objects must be assigned themselves. <a href=#refsCSSCOLOR>[CSSCOLOR]</a> If the value is a string but
-  is not a valid color, or is neither a string, a
-  <code><a href=#canvasgradient>CanvasGradient</a></code>, nor a <code><a href=#canvaspattern>CanvasPattern</a></code>, then
-  it must be ignored, and the attribute must retain its previous
-  value.</p>
+  cannot be <a href=#parsed-as-a-css-color-value>parsed as a CSS <color> value</a>, or is
+  neither a string, a <code><a href=#canvasgradient>CanvasGradient</a></code>, nor a
+  <code><a href=#canvaspattern>CanvasPattern</a></code>, then it must be ignored, and the
+  attribute must retain its previous value.</p>
 
   <p>When set to a <code><a href=#canvaspattern>CanvasPattern</a></code> or
   <code><a href=#canvasgradient>CanvasGradient</a></code> object, the assignment is
@@ -32152,16 +32180,17 @@
   method on the <code><a href=#canvasgradient>CanvasGradient</a></code> interface adds a new stop
   to a gradient. If the <var title="">offset</var> is less than 0,
   greater than 1, infinite, or NaN, then an
-  <code><a href=#index_size_err>INDEX_SIZE_ERR</a></code> exception must be raised. If the <var title="">color</var> cannot be parsed as a CSS color, then a
-  <code><a href=#syntax_err>SYNTAX_ERR</a></code> exception must be raised. Otherwise, the
-  gradient must have a new stop placed, at offset <var title="">offset</var> relative to the whole gradient, and with the
-  color obtained by parsing <var title="">color</var> as a CSS
-  <color> value. If multiple stops are added at the same offset
-  on a gradient, they must be placed in the order added, with the
-  first one closest to the start of the gradient, and each subsequent
-  one infinitesimally further along towards the end point (in effect
-  causing all but the first and last stop added at each point to be
-  ignored).</p>
+  <code><a href=#index_size_err>INDEX_SIZE_ERR</a></code> exception must be raised. If the <var title="">color</var> cannot be <a href=#parsed-as-a-css-color-value>parsed as a CSS <color>
+  value</a>, then a <code><a href=#syntax_err>SYNTAX_ERR</a></code> exception must be
+  raised. Otherwise, the gradient must have a new stop placed, at
+  offset <var title="">offset</var> relative to the whole gradient,
+  and with the color obtained by parsing <var title="">color</var> as
+  a CSS <color> value. If multiple stops are added at the same
+  offset on a gradient, they must be placed in the order added, with
+  the first one closest to the start of the gradient, and each
+  subsequent one infinitesimally further along towards the end point
+  (in effect causing all but the first and last stop added at each
+  point to be ignored).</p>
 
   <p>The <dfn id=dom-context-2d-createlineargradient title=dom-context-2d-createLinearGradient><code>createLinearGradient(<var title="">x0</var>, <var title="">y0</var>, <var title="">x1</var>,
   <var title="">y1</var>)</code></dfn> method takes four arguments
@@ -32579,10 +32608,10 @@
   <p>On getting, the <a href=#serialization-of-a-color title="serialization of a
   color">serialization of the color</a> must be returned.</p>
 
-  <p>On setting, the new value must be parsed as a CSS <color>
-  value and the color assigned. If the value is not a valid color,
-  then it must be ignored, and the attribute must retain its previous
-  value. <a href=#refsCSSCOLOR>[CSSCOLOR]</a></p>
+  <p>On setting, the new value must be <a href=#parsed-as-a-css-color-value>parsed as a CSS
+  <color> value</a> and the color assigned. If the value
+  cannot be parsed as a CSS <color> value then it must be
+  ignored, and the attribute must retain its previous value. <a href=#refsCSSCOLOR>[CSSCOLOR]</a></p>
 
   <p>The <dfn id=dom-context-2d-shadowoffsetx title=dom-context-2d-shadowOffsetX><code>shadowOffsetX</code></dfn>
   and <dfn id=dom-context-2d-shadowoffsety title=dom-context-2d-shadowOffsetY><code>shadowOffsetY</code></dfn>

Modified: index
===================================================================
--- index	2010-12-29 22:43:30 UTC (rev 5725)
+++ index	2010-12-29 23:07:21 UTC (rev 5726)
@@ -3316,6 +3316,33 @@
 
    </dd>
 
+   <dt>CSS modules</dt>
+
+   <dd>
+
+    <p>While support for CSS as a whole is not required of
+    implementations of this specification (though it is encouraged, at
+    least for Web browsers), some features are defined in terms of
+    specific CSS requirements.</p>
+
+    <p>In particular, some features require that a string be
+    <dfn id=parsed-as-a-css-color-value>parsed as a CSS <color> value</dfn>. When parsing a CSS
+    value, user agents are required by the CSS specifications to apply
+    some error handling rules. These apply to this specification also.
+    <a href=#refsCSSCOLOR>[CSSCOLOR]</a> <a href=#refsCSS>[CSS]</a></p>
+
+    <p class=example>For example, user agents are required to close
+    all open constructs upon finding the end of a style sheet
+    unexpectedly. Thus, when parsing the string "<code title="">rgb(0,0,0</code>" (with a missing close-parenthesis) for
+    a color value, the close parenthesis is implied by this error
+    handling rule, and a value is obtained (the color 'black').
+    However, the similar construct "<code title="">rgb(0,0,</code>"
+    (with both a missing parenthesis and a missing "blue" value)
+    cannot be parsed, as it closing the open construct does not result
+    in a viable value.</p>
+
+   </dd>
+
   </dl><p>This specification does not <em>require</em> support of any
   particular network protocol, style sheet language, scripting
   language, or any of the DOM specifications beyond those described
@@ -32027,13 +32054,14 @@
 
   <p>Both attributes can be either strings,
   <code><a href=#canvasgradient>CanvasGradient</a></code>s, or <code><a href=#canvaspattern>CanvasPattern</a></code>s. On
-  setting, strings must be parsed as CSS <color> values and the
-  color assigned, and <code><a href=#canvasgradient>CanvasGradient</a></code> and
+  setting, strings must be <a href=#parsed-as-a-css-color-value title="parsed as a CSS <color>
+  value">parsed as CSS <color> values</a> and the color
+  assigned, and <code><a href=#canvasgradient>CanvasGradient</a></code> and
   <code><a href=#canvaspattern>CanvasPattern</a></code> objects must be assigned themselves. <a href=#refsCSSCOLOR>[CSSCOLOR]</a> If the value is a string but
-  is not a valid color, or is neither a string, a
-  <code><a href=#canvasgradient>CanvasGradient</a></code>, nor a <code><a href=#canvaspattern>CanvasPattern</a></code>, then
-  it must be ignored, and the attribute must retain its previous
-  value.</p>
+  cannot be <a href=#parsed-as-a-css-color-value>parsed as a CSS <color> value</a>, or is
+  neither a string, a <code><a href=#canvasgradient>CanvasGradient</a></code>, nor a
+  <code><a href=#canvaspattern>CanvasPattern</a></code>, then it must be ignored, and the
+  attribute must retain its previous value.</p>
 
   <p>When set to a <code><a href=#canvaspattern>CanvasPattern</a></code> or
   <code><a href=#canvasgradient>CanvasGradient</a></code> object, the assignment is
@@ -32134,16 +32162,17 @@
   method on the <code><a href=#canvasgradient>CanvasGradient</a></code> interface adds a new stop
   to a gradient. If the <var title="">offset</var> is less than 0,
   greater than 1, infinite, or NaN, then an
-  <code><a href=#index_size_err>INDEX_SIZE_ERR</a></code> exception must be raised. If the <var title="">color</var> cannot be parsed as a CSS color, then a
-  <code><a href=#syntax_err>SYNTAX_ERR</a></code> exception must be raised. Otherwise, the
-  gradient must have a new stop placed, at offset <var title="">offset</var> relative to the whole gradient, and with the
-  color obtained by parsing <var title="">color</var> as a CSS
-  <color> value. If multiple stops are added at the same offset
-  on a gradient, they must be placed in the order added, with the
-  first one closest to the start of the gradient, and each subsequent
-  one infinitesimally further along towards the end point (in effect
-  causing all but the first and last stop added at each point to be
-  ignored).</p>
+  <code><a href=#index_size_err>INDEX_SIZE_ERR</a></code> exception must be raised. If the <var title="">color</var> cannot be <a href=#parsed-as-a-css-color-value>parsed as a CSS <color>
+  value</a>, then a <code><a href=#syntax_err>SYNTAX_ERR</a></code> exception must be
+  raised. Otherwise, the gradient must have a new stop placed, at
+  offset <var title="">offset</var> relative to the whole gradient,
+  and with the color obtained by parsing <var title="">color</var> as
+  a CSS <color> value. If multiple stops are added at the same
+  offset on a gradient, they must be placed in the order added, with
+  the first one closest to the start of the gradient, and each
+  subsequent one infinitesimally further along towards the end point
+  (in effect causing all but the first and last stop added at each
+  point to be ignored).</p>
 
   <p>The <dfn id=dom-context-2d-createlineargradient title=dom-context-2d-createLinearGradient><code>createLinearGradient(<var title="">x0</var>, <var title="">y0</var>, <var title="">x1</var>,
   <var title="">y1</var>)</code></dfn> method takes four arguments
@@ -32561,10 +32590,10 @@
   <p>On getting, the <a href=#serialization-of-a-color title="serialization of a
   color">serialization of the color</a> must be returned.</p>
 
-  <p>On setting, the new value must be parsed as a CSS <color>
-  value and the color assigned. If the value is not a valid color,
-  then it must be ignored, and the attribute must retain its previous
-  value. <a href=#refsCSSCOLOR>[CSSCOLOR]</a></p>
+  <p>On setting, the new value must be <a href=#parsed-as-a-css-color-value>parsed as a CSS
+  <color> value</a> and the color assigned. If the value
+  cannot be parsed as a CSS <color> value then it must be
+  ignored, and the attribute must retain its previous value. <a href=#refsCSSCOLOR>[CSSCOLOR]</a></p>
 
   <p>The <dfn id=dom-context-2d-shadowoffsetx title=dom-context-2d-shadowOffsetX><code>shadowOffsetX</code></dfn>
   and <dfn id=dom-context-2d-shadowoffsety title=dom-context-2d-shadowOffsetY><code>shadowOffsetY</code></dfn>

Modified: source
===================================================================
--- source	2010-12-29 22:43:30 UTC (rev 5725)
+++ source	2010-12-29 23:07:21 UTC (rev 5726)
@@ -2289,6 +2289,35 @@
 
    </dd>
 
+   <dt>CSS modules</dt>
+
+   <dd>
+
+    <p>While support for CSS as a whole is not required of
+    implementations of this specification (though it is encouraged, at
+    least for Web browsers), some features are defined in terms of
+    specific CSS requirements.</p>
+
+    <p>In particular, some features require that a string be
+    <dfn>parsed as a CSS <color> value</dfn>. When parsing a CSS
+    value, user agents are required by the CSS specifications to apply
+    some error handling rules. These apply to this specification also.
+    <a href="#refsCSSCOLOR">[CSSCOLOR]</a> <a
+    href="#refsCSS">[CSS]</a></p>
+
+    <p class="example">For example, user agents are required to close
+    all open constructs upon finding the end of a style sheet
+    unexpectedly. Thus, when parsing the string "<code
+    title="">rgb(0,0,0</code>" (with a missing close-parenthesis) for
+    a color value, the close parenthesis is implied by this error
+    handling rule, and a value is obtained (the color 'black').
+    However, the similar construct "<code title="">rgb(0,0,</code>"
+    (with both a missing parenthesis and a missing "blue" value)
+    cannot be parsed, as it closing the open construct does not result
+    in a viable value.</p>
+
+   </dd>
+
   </dl>
 
   <p>This specification does not <em>require</em> support of any
@@ -35235,14 +35264,15 @@
 
   <p>Both attributes can be either strings,
   <code>CanvasGradient</code>s, or <code>CanvasPattern</code>s. On
-  setting, strings must be parsed as CSS <color> values and the
-  color assigned, and <code>CanvasGradient</code> and
+  setting, strings must be <span title="parsed as a CSS <color>
+  value">parsed as CSS <color> values</span> and the color
+  assigned, and <code>CanvasGradient</code> and
   <code>CanvasPattern</code> objects must be assigned themselves. <a
   href="#refsCSSCOLOR">[CSSCOLOR]</a> If the value is a string but
-  is not a valid color, or is neither a string, a
-  <code>CanvasGradient</code>, nor a <code>CanvasPattern</code>, then
-  it must be ignored, and the attribute must retain its previous
-  value.</p>
+  cannot be <span>parsed as a CSS <color> value</span>, or is
+  neither a string, a <code>CanvasGradient</code>, nor a
+  <code>CanvasPattern</code>, then it must be ignored, and the
+  attribute must retain its previous value.</p>
 
   <p>When set to a <code>CanvasPattern</code> or
   <code>CanvasGradient</code> object, the assignment is
@@ -35356,17 +35386,17 @@
   to a gradient. If the <var title="">offset</var> is less than 0,
   greater than 1, infinite, or NaN, then an
   <code>INDEX_SIZE_ERR</code> exception must be raised. If the <var
-  title="">color</var> cannot be parsed as a CSS color, then a
-  <code>SYNTAX_ERR</code> exception must be raised. Otherwise, the
-  gradient must have a new stop placed, at offset <var
-  title="">offset</var> relative to the whole gradient, and with the
-  color obtained by parsing <var title="">color</var> as a CSS
-  <color> value. If multiple stops are added at the same offset
-  on a gradient, they must be placed in the order added, with the
-  first one closest to the start of the gradient, and each subsequent
-  one infinitesimally further along towards the end point (in effect
-  causing all but the first and last stop added at each point to be
-  ignored).</p>
+  title="">color</var> cannot be <span>parsed as a CSS <color>
+  value</span>, then a <code>SYNTAX_ERR</code> exception must be
+  raised. Otherwise, the gradient must have a new stop placed, at
+  offset <var title="">offset</var> relative to the whole gradient,
+  and with the color obtained by parsing <var title="">color</var> as
+  a CSS <color> value. If multiple stops are added at the same
+  offset on a gradient, they must be placed in the order added, with
+  the first one closest to the start of the gradient, and each
+  subsequent one infinitesimally further along towards the end point
+  (in effect causing all but the first and last stop added at each
+  point to be ignored).</p>
 
   <p>The <dfn
   title="dom-context-2d-createLinearGradient"><code>createLinearGradient(<var
@@ -35875,10 +35905,11 @@
   <p>On getting, the <span title="serialization of a
   color">serialization of the color</span> must be returned.</p>
 
-  <p>On setting, the new value must be parsed as a CSS <color>
-  value and the color assigned. If the value is not a valid color,
-  then it must be ignored, and the attribute must retain its previous
-  value. <a href="#refsCSSCOLOR">[CSSCOLOR]</a></p>
+  <p>On setting, the new value must be <span>parsed as a CSS
+  <color> value</span> and the color assigned. If the value
+  cannot be parsed as a CSS <color> value then it must be
+  ignored, and the attribute must retain its previous value. <a
+  href="#refsCSSCOLOR">[CSSCOLOR]</a></p>
 
   <p>The <dfn
   title="dom-context-2d-shadowOffsetX"><code>shadowOffsetX</code></dfn>




More information about the Commit-Watchers mailing list