Skip to content
Browse files

[] (0) Filling in the rendering section: color-related presentational…

… hints; fixes for previous checkin.

git-svn-id: http://svn.whatwg.org/webapps@2751 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
1 parent 7b390a5 commit c706922618c8c6f838ba7f8445d4e2e1396e703b @Hixie Hixie committed
Showing with 200 additions and 85 deletions.
  1. +89 −39 index
  2. +111 −46 source
View
128 index
@@ -2602,8 +2602,8 @@
<li>Return <var title="">number</var>.</li>
</ol><h5 id=percentages-and-dimensions><span class=secno>2.4.3.5 </span>Percentages and lengths</h5>
-
- <p>A string is a <dfn id=valid-dimension-value>valid dimension value</dfn> if it consists of
+<!--(percentages are not used in html5)
+ <p>A string is a <dfn>valid dimension value</dfn> if it consists of
a character in the range U+0031 DIGIT ONE (1) to U+0039 DIGIT NINE
(9), optionally followed by zero of more characters in the range
U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), optionally followed
@@ -2611,15 +2611,15 @@
the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), and
optionally suffixed by a U+0025 PERCENT SIGN character (%).</p>
- <p>A <a href=#valid-dimension-value>valid dimension value</a> represents the number that
+ <p>A <span>valid dimension value</span> represents the number that
is represented in base ten by that string of digits, optionally with
a fractional component. If the U+0025 PERCENT SIGN is present, then
the dimension is a percentage; otherwise, it is a length.</p>
- <p class=note>For historical reasons, percentanges and lengths
- less than 1.0 cannot be represented as <a href=#valid-dimension-value title="valid dimension
- value">valid dimension values</a>.</p>
-
+ <p class="note">For historical reasons, percentanges and lengths
+ less than 1.0 cannot be represented as <span title="valid dimension
+ value">valid dimension values</span>.</p>
+-->
<p>The <dfn id=rules-for-parsing-dimension-values>rules for parsing dimension values</dfn> are as given in
the following algorithm. When invoked, the steps must be followed in
the order given, aborting at the first step that returns a
@@ -2680,9 +2680,6 @@
</ol></li>
- <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> that are
- U+0030 DIGIT ZERO (0) characters, and discard them.</li>
-
<li><p>If <var title="">position</var> is past the end of <var title="">input</var>, return <var title="">value</var> as a
length.</li>
@@ -3736,13 +3733,19 @@
<li><p>Return <var title="">result</var>, which will be a
<a href=#valid-lowercase-simple-color>valid lowercase simple color</a>.</li>
- </ol><p class=note>The <a href=#canvas-context-2d title=canvas-context-2d>2D graphics
+ </ol><hr><p>Some obsolete legacy attributes parse colors in a more
+ complicated manner, using the <dfn id=rules-for-parsing-a-legacy-color-value>rules for parsing a legacy color
+ value</dfn>, which are given in the following algorithm. When
+ invoked, the steps must be followed in the order given, aborting at
+ the first step that returns a value. This algorithm will either
+ return a <a href=#simple-color>simple color</a> or an error.</p>
+
+ <ol class=XXX><li>...
+
+ </ol><hr><p class=note>The <a href=#canvas-context-2d title=canvas-context-2d>2D graphics
context</a> has a separate color syntax that also handles
opacity.</p>
- <p class=note>Some obsolete legacy attributes parse colors in a
- more complicated manner.</p>
-
<h4 id=space-separated-tokens><span class=secno>2.4.6 </span>Space-separated tokens</h4>
@@ -55883,23 +55886,6 @@ style, title { display: none; }</pre>
<p class=XXX>Please send feedback if you can accurately describe
rules required by legacy content.</p>
- <p>When the text below says that an attribute <var title="">attribute</var> on an element <var title="">element</var>
- <dfn id=maps-to-the-pixel-length-property>maps to the pixel length property</dfn> (or properties) <var title="">properties</var>, it means that if <var title="">element</var> has an attribute <var title="">attribute</var> set, and parsing that attribute's value
- using the <a href=#rules-for-parsing-non-negative-integers>rules for parsing non-negative integers</a>
- doesn't generate an error, then the user agent is expected to use
- the parsed value as a pixel length for a <a href=#presentational-hints title="presentational
- hints">presentational hint</a> for <var title="">property</var>.</p>
-
- <p>When the text below says that an attribute <var title="">attribute</var> on an element <var title="">element</var>
- <dfn id=maps-to-the-dimension-property>maps to the dimension property</dfn> (or properties) <var title="">properties</var>, it means that if <var title="">element</var> has an attribute <var title="">attribute</var> set, and parsing that attribute's value
- using the <a href=#rules-for-parsing-dimension-values>rules for parsing dimension values</a> doesn't
- generate an error, then the user agent is expected to use the parsed
- dimension as the value for a <a href=#presentational-hints title="presentational
- hints">presentational hint</a> for <var title="">property</var>,
- with the value given as a pixel length if the dimension was an
- integer, and with the value given as a percentage if the dimension
- was a percentage.</p>
-
<h4 id=display-types><span class=secno>10.3.2 </span>Display types</h4>
@@ -56007,6 +55993,22 @@ td, th { padding: 1px; }</pre>
<code>frame</code> or <code><a href=#the-iframe-element>iframe</a></code> element. Otherwise, there
is no <a href=#container-frame-element>container frame element</a>.</p>
+ <hr><p>When the text below says that an attribute <var title="">attribute</var> on an element <var title="">element</var>
+ <dfn id=maps-to-the-pixel-length-property>maps to the pixel length property</dfn> (or properties) <var title="">properties</var>, it means that if <var title="">element</var> has an attribute <var title="">attribute</var> set, and parsing that attribute's value
+ using the <a href=#rules-for-parsing-non-negative-integers>rules for parsing non-negative integers</a>
+ doesn't generate an error, then the user agent is expected to use
+ the parsed value as a pixel length for a <a href=#presentational-hints title="presentational
+ hints">presentational hint</a> for <var title="">properties</var>.</p>
+
+ <p>When the text below says that an attribute <var title="">attribute</var> on an element <var title="">element</var>
+ <dfn id=maps-to-the-dimension-property>maps to the dimension property</dfn> (or properties) <var title="">properties</var>, it means that if <var title="">element</var> has an attribute <var title="">attribute</var> set, and parsing that attribute's value
+ using the <a href=#rules-for-parsing-dimension-values>rules for parsing dimension values</a> doesn't
+ generate an error, then the user agent is expected to use the parsed
+ dimension as the value for a <a href=#presentational-hints title="presentational
+ hints">presentational hint</a> for <var title="">properties</var>, with the value given as a pixel length if
+ the dimension was an integer, and with the value given as a
+ percentage if the dimension was a percentage.</p>
+
<hr><p>The <code><a href=#the-table-element>table</a></code> element's <code title=attr-table-cellspacing>cellspacing</code> attribute
<a href=#maps-to-the-pixel-length-property>maps to the pixel length property</a> 'border-spacing' on the
element.</p>
@@ -56203,14 +56205,62 @@ thead, tbody, tfoot, tr { border-color: inherit; }</pre>
<var title="">x</var> <var title="">x</var> <var title="">x</var> <var title="">x</var> h1 { font-size: 0.83em; }
<var title="">x</var> <var title="">x</var> <var title="">x</var> <var title="">x</var> <var title="">x</var> h1 { font-size: 0.67em; }</pre>
- <hr><p class=XXX>...background...</p>
- <!-- body, table, td, th, tbody, tfoot, thead, tr: background (empty string ignored?), bgcolor -->
-
- <hr><p class=XXX>...body...</p>
- <!--link, vlink, alink, text -->
-
- <hr><p class=XXX>...tables...</p>
- <!-- table: bordercolor -->
+ <hr><p>When a <code><a href=#the-body-element>body</a></code>, <code><a href=#the-table-element>table</a></code>, <code><a href=#the-thead-element>thead</a></code>,
+ <code><a href=#the-tbody-element>tbody</a></code>, <code><a href=#the-tfoot-element>tfoot</a></code>, <code><a href=#the-tr-element>tr</a></code>,
+ <code><a href=#the-td-element>td</a></code>, or <code><a href=#the-th-element>th</a></code> element has a <code title=attr-background>background</code> attribute set to a
+ non-empty value, the new value is expected to be <a href=#resolve-a-url title="resolve a url">resolved</a> relative to the element, and
+ if this is successful, the user agent is expected to treat the
+ attribute as a <a href=#presentational-hints title="presentational hints">presentational
+ hint</a> setting the element's 'background-image' property to the
+ resulting <a href=#absolute-url>absolute URL</a>.</p>
+
+ <p>When a <code><a href=#the-body-element>body</a></code>, <code><a href=#the-table-element>table</a></code>, <code><a href=#the-thead-element>thead</a></code>,
+ <code><a href=#the-tbody-element>tbody</a></code>, <code><a href=#the-tfoot-element>tfoot</a></code>, <code><a href=#the-tr-element>tr</a></code>,
+ <code><a href=#the-td-element>td</a></code>, or <code><a href=#the-th-element>th</a></code> element has a <code title=attr-bgcolor>bgcolor</code> attribute set, the new value is
+ expected to be parsed using the <a href=#rules-for-parsing-a-legacy-color-value>rules for parsing a legacy
+ color value</a>, and the user agent is expected to treat the
+ attribute as a <a href=#presentational-hints title="presentational hints">presentational
+ hint</a> setting the element's 'background-color' property to the
+ resulting color.</p>
+
+ <p>When a <code><a href=#the-body-element>body</a></code> element has a <code title=attr-body-text><a href=#attr-body-text>text</a></code> attribute, its value is expected
+ to be parsed using the <a href=#rules-for-parsing-a-legacy-color-value>rules for parsing a legacy color
+ value</a>, and the user agent is expected to treat the attribute
+ as a <a href=#presentational-hints title="presentational hints">presentational hint</a>
+ setting the element's 'color' property to the resulting color.</p>
+
+ <p>When a <code><a href=#the-body-element>body</a></code> element has a <code title=attr-body-link><a href=#attr-body-link>link</a></code> attribute, its value is expected
+ to be parsed using the <a href=#rules-for-parsing-a-legacy-color-value>rules for parsing a legacy color
+ value</a>, and the user agent is expected to treat the attribute
+ as a <a href=#presentational-hints title="presentational hints">presentational hint</a>
+ setting the 'color' property of any element in the
+ <code>Document</code> matching the ':link' pseudo-class to the
+ resulting color.</p>
+
+ <p>When a <code><a href=#the-body-element>body</a></code> element has a <code title=attr-body-vlink><a href=#attr-body-vlink>vlink</a></code> attribute, its value is
+ expected to be parsed using the <a href=#rules-for-parsing-a-legacy-color-value>rules for parsing a legacy
+ color value</a>, and the user agent is expected to treat the
+ attribute as a <a href=#presentational-hints title="presentational hints">presentational
+ hint</a> setting the 'color' property of any element in the
+ <code>Document</code> matching the ':visited' pseudo-class to the
+ resulting color.</p>
+
+ <p>When a <code><a href=#the-body-element>body</a></code> element has a <code title=attr-body-alink><a href=#attr-body-alink>alink</a></code> attribute, its value is
+ expected to be parsed using the <a href=#rules-for-parsing-a-legacy-color-value>rules for parsing a legacy
+ color value</a>, and the user agent is expected to treat the
+ attribute as a <a href=#presentational-hints title="presentational hints">presentational
+ hint</a> setting the 'color' property of any element in the
+ <code>Document</code> matching the ':active' pseudo-class and either
+ the ':link' pseudo-class or the ':visited' pseudo-class to the
+ resulting color.</p>
+
+ <p>When a <code><a href=#the-table-element>table</a></code> element has a <code title=attr-table-bordercolor>bordercolor</code> attribute, its
+ value is expected to be parsed using the <a href=#rules-for-parsing-a-legacy-color-value>rules for parsing a
+ legacy color value</a>, and the user agent is expected to treat
+ the attribute as a <a href=#presentational-hints title="presentational hints">presentational
+ hint</a> setting the element's 'border-top-color',
+ 'border-right-color', 'border-bottom-color', and
+ 'border-right-color' properties to the resulting color.</p>
<hr><p class=XXX>...font...</p>
<!-- face=>font-family -->
View
157 source
@@ -1708,7 +1708,7 @@
<h5 id="percentages-and-dimensions">Percentages and lengths</h5>
-
+<!--(percentages are not used in html5)
<p>A string is a <dfn>valid dimension value</dfn> if it consists of
a character in the range U+0031 DIGIT ONE (1) to U+0039 DIGIT NINE
(9), optionally followed by zero of more characters in the range
@@ -1725,7 +1725,7 @@
<p class="note">For historical reasons, percentanges and lengths
less than 1.0 cannot be represented as <span title="valid dimension
value">valid dimension values</span>.</p>
-
+-->
<p>The <dfn>rules for parsing dimension values</dfn> are as given in
the following algorithm. When invoked, the steps must be followed in
the order given, aborting at the first step that returns a
@@ -1800,9 +1800,6 @@
</li>
- <li><p><span>Collect a sequence of characters</span> that are
- U+0030 DIGIT ZERO (0) characters, and discard them.</p></li>
-
<li><p>If <var title="">position</var> is past the end of <var
title="">input</var>, return <var title="">value</var> as a
length.</p></li>
@@ -3174,13 +3171,27 @@
</ol>
+ <hr>
+
+ <p>Some obsolete legacy attributes parse colors in a more
+ complicated manner, using the <dfn>rules for parsing a legacy color
+ value</dfn>, which are given in the following algorithm. When
+ invoked, the steps must be followed in the order given, aborting at
+ the first step that returns a value. This algorithm will either
+ return a <span>simple color</span> or an error.</p>
+
+ <ol class=XXX>
+
+ <li>...
+
+ </ol>
+
+ <hr>
+
<p class="note">The <span title="canvas-context-2d">2D graphics
context</span> has a separate color syntax that also handles
opacity.</p>
- <p class="note">Some obsolete legacy attributes parse colors in a
- more complicated manner.</p>
-
<h4>Space-separated tokens</h4>
@@ -61091,32 +61102,6 @@ style, title { display: none; }</pre>
<p class="XXX">Please send feedback if you can accurately describe
rules required by legacy content.</p>
- <p>When the text below says that an attribute <var
- title="">attribute</var> on an element <var title="">element</var>
- <dfn>maps to the pixel length property</dfn> (or properties) <var
- title="">properties</var>, it means that if <var
- title="">element</var> has an attribute <var
- title="">attribute</var> set, and parsing that attribute's value
- using the <span>rules for parsing non-negative integers</span>
- doesn't generate an error, then the user agent is expected to use
- the parsed value as a pixel length for a <span title="presentational
- hints">presentational hint</span> for <var
- title="">property</var>.</p>
-
- <p>When the text below says that an attribute <var
- title="">attribute</var> on an element <var title="">element</var>
- <dfn>maps to the dimension property</dfn> (or properties) <var
- title="">properties</var>, it means that if <var
- title="">element</var> has an attribute <var
- title="">attribute</var> set, and parsing that attribute's value
- using the <span>rules for parsing dimension values</span> doesn't
- generate an error, then the user agent is expected to use the parsed
- dimension as the value for a <span title="presentational
- hints">presentational hint</span> for <var title="">property</var>,
- with the value given as a pixel length if the dimension was an
- integer, and with the value given as a percentage if the dimension
- was a percentage.</p>
-
<h4>Display types</h4>
@@ -61251,6 +61236,34 @@ td, th { padding: 1px; }</pre>
<hr>
+ <p>When the text below says that an attribute <var
+ title="">attribute</var> on an element <var title="">element</var>
+ <dfn>maps to the pixel length property</dfn> (or properties) <var
+ title="">properties</var>, it means that if <var
+ title="">element</var> has an attribute <var
+ title="">attribute</var> set, and parsing that attribute's value
+ using the <span>rules for parsing non-negative integers</span>
+ doesn't generate an error, then the user agent is expected to use
+ the parsed value as a pixel length for a <span title="presentational
+ hints">presentational hint</span> for <var
+ title="">properties</var>.</p>
+
+ <p>When the text below says that an attribute <var
+ title="">attribute</var> on an element <var title="">element</var>
+ <dfn>maps to the dimension property</dfn> (or properties) <var
+ title="">properties</var>, it means that if <var
+ title="">element</var> has an attribute <var
+ title="">attribute</var> set, and parsing that attribute's value
+ using the <span>rules for parsing dimension values</span> doesn't
+ generate an error, then the user agent is expected to use the parsed
+ dimension as the value for a <span title="presentational
+ hints">presentational hint</span> for <var
+ title="">properties</var>, with the value given as a pixel length if
+ the dimension was an integer, and with the value given as a
+ percentage if the dimension was a percentage.</p>
+
+ <hr>
+
<p>The <code>table</code> element's <code
title="attr-table-cellspacing">cellspacing</code> attribute
<span>maps to the pixel length property</span> 'border-spacing' on the
@@ -61472,18 +61485,70 @@ thead, tbody, tfoot, tr { border-color: inherit; }</pre>
<hr>
- <p class="XXX">...background...</p>
- <!-- body, table, td, th, tbody, tfoot, thead, tr: background (empty string ignored?), bgcolor -->
-
- <hr>
-
- <p class="XXX">...body...</p>
- <!--link, vlink, alink, text -->
-
- <hr>
-
- <p class="XXX">...tables...</p>
- <!-- table: bordercolor -->
+ <p>When a <code>body</code>, <code>table</code>, <code>thead</code>,
+ <code>tbody</code>, <code>tfoot</code>, <code>tr</code>,
+ <code>td</code>, or <code>th</code> element has a <code
+ title="attr-background">background</code> attribute set to a
+ non-empty value, the new value is expected to be <span
+ title="resolve a url">resolved</span> relative to the element, and
+ if this is successful, the user agent is expected to treat the
+ attribute as a <span title="presentational hints">presentational
+ hint</span> setting the element's 'background-image' property to the
+ resulting <span>absolute URL</span>.</p>
+
+ <p>When a <code>body</code>, <code>table</code>, <code>thead</code>,
+ <code>tbody</code>, <code>tfoot</code>, <code>tr</code>,
+ <code>td</code>, or <code>th</code> element has a <code
+ title="attr-bgcolor">bgcolor</code> attribute set, the new value is
+ expected to be parsed using the <span>rules for parsing a legacy
+ color value</span>, and the user agent is expected to treat the
+ attribute as a <span title="presentational hints">presentational
+ hint</span> setting the element's 'background-color' property to the
+ resulting color.</p>
+
+ <p>When a <code>body</code> element has a <code
+ title="attr-body-text">text</code> attribute, its value is expected
+ to be parsed using the <span>rules for parsing a legacy color
+ value</span>, and the user agent is expected to treat the attribute
+ as a <span title="presentational hints">presentational hint</span>
+ setting the element's 'color' property to the resulting color.</p>
+
+ <p>When a <code>body</code> element has a <code
+ title="attr-body-link">link</code> attribute, its value is expected
+ to be parsed using the <span>rules for parsing a legacy color
+ value</span>, and the user agent is expected to treat the attribute
+ as a <span title="presentational hints">presentational hint</span>
+ setting the 'color' property of any element in the
+ <code>Document</code> matching the ':link' pseudo-class to the
+ resulting color.</p>
+
+ <p>When a <code>body</code> element has a <code
+ title="attr-body-vlink">vlink</code> attribute, its value is
+ expected to be parsed using the <span>rules for parsing a legacy
+ color value</span>, and the user agent is expected to treat the
+ attribute as a <span title="presentational hints">presentational
+ hint</span> setting the 'color' property of any element in the
+ <code>Document</code> matching the ':visited' pseudo-class to the
+ resulting color.</p>
+
+ <p>When a <code>body</code> element has a <code
+ title="attr-body-alink">alink</code> attribute, its value is
+ expected to be parsed using the <span>rules for parsing a legacy
+ color value</span>, and the user agent is expected to treat the
+ attribute as a <span title="presentational hints">presentational
+ hint</span> setting the 'color' property of any element in the
+ <code>Document</code> matching the ':active' pseudo-class and either
+ the ':link' pseudo-class or the ':visited' pseudo-class to the
+ resulting color.</p>
+
+ <p>When a <code>table</code> element has a <code
+ title="attr-table-bordercolor">bordercolor</code> attribute, its
+ value is expected to be parsed using the <span>rules for parsing a
+ legacy color value</span>, and the user agent is expected to treat
+ the attribute as a <span title="presentational hints">presentational
+ hint</span> setting the element's 'border-top-color',
+ 'border-right-color', 'border-bottom-color', and
+ 'border-right-color' properties to the resulting color.</p>
<hr>

0 comments on commit c706922

Please sign in to comment.
Something went wrong with that request. Please try again.