Skip to content
Permalink
Browse files

[] (0) Filling in the rendering section: <font> and related changes.

git-svn-id: http://svn.whatwg.org/webapps@2752 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Feb 4, 2009
1 parent c706922 commit 04ee2e87c9f1f89baca6e90a80f6e2aa0f70a0d7
Showing with 286 additions and 23 deletions.
  1. +127 −12 index
  2. +159 −11 source
139 index
@@ -2195,6 +2195,11 @@

<li><p>If <var title="">position</var> is past the end of <var title="">input</var>, return an error.</li>

<li><p>If the next character is a U+002B PLUS SIGN character (+),
advance <var title="">position</var> to the next character.</li>

<li><p>If <var title="">position</var> is past the end of <var title="">input</var>, return an error.</li>

<li><p>If the next character is not one of U+0030 DIGIT ZERO (0)
.. U+0039 DIGIT NINE (9), then return an error.</li>

'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 -->
<!-- pointsize=>font-size as pt if present;
otherwise size=>font-size as follows:
int <0: as x-small
int >7: as xx-large
1,2,3,4,5,6: as x-small,small,medium,large,x-large,xx-large; quirks offsets by one?
-6 .. -0 +0 .. +6: add to <basefont size> and treat as above?
what values should x-small..xx-large have?
-->
<!-- color -->
<hr><p>When a <code>font</code> element has a <code title=attr-font-color>color</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>font</code> element has a <code title=attr-font-face>face</code> attribute, 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
'font-family' property to the attribute's value.</p>

<p>When a <code>font</code> element has a <code title=attr-font-pointsize>pointsize</code> attribute, the user
agent is expected to parse that attribute's value using the
<a href=#rules-for-parsing-non-negative-integers>rules for parsing non-negative integers</a>, and if this
doesn't generate an error, then the user agent is expected to use
the parsed value as a <em>point</em> length for a <a href=#presentational-hints title="presentational hints">presentational hint</a> for the
'font-size' property on the element.</p>

<p>When a <code>font</code> element has a <code title=attr-font-size>size</code> attribute, the user agent is
expected to use the following steps to treat the attribute as a
<a href=#presentational-hints title="presentational hints">presentational hint</a>
setting the element's 'font-size' property:</p>

<ol><li><p>Let <var title="">input</var> be the attribute's
value.</li>

<li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
string.</li>

<li><p><a href=#skip-whitespace>Skip whitespace</a>.</li>

<li><p>If <var title="">position</var> is past the end of <var title="">input</var>, there is no <a href=#presentational-hints title="presentational
hints">presentational hint</a>. Abort these steps.</li>

<li><p>If the character at <var title="">position</var> is a U+002B
PLUS SIGN character (+), then let <var title="">mode</var> be
<i>relative-plus</i>, and advance <var title="">position</var> to
the next character. Otherwise, if the character at <var title="">position</var> is a U+002D HYPHEN-MINUS character (-),
then let <var title="">mode</var> be <i>relative-minus</i>, and
advance <var title="">position</var> to the next
character. Otherwise, let <var title="">mode</var> be
<i>absolute</i>.</li>

<li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range
U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), and let the
resulting sequence be <var title="">digits</var>.</li>

<li><p>If <var title="">digits</var> is the empty string, there is
no <a href=#presentational-hints title="presentational hints">presentational
hint</a>. Abort these steps.</li>

<li><p>Interpret <var title="">digits</var> as a base-ten
integer. Let <var title="">size</var> be the resulting
number.</li>

<li>

<p>If <var title="">mode</var> is not <i>absolute</i>, run these
substeps:</p>

<ol><li><p>Let <var title="">base</var> be 3.</li>

<li><p>Let <var title="">base element</var> be the the last
<code>basefont</code> element in <a href=#tree-order>tree order</a> that is
before the <code>font</code> element, if there is one.</li>

<li><p>If there is a <var title="">base element</var>, and it has
a <code title=attr-basefont-size>size</code> attribute, then
apply the <a href=#rules-for-parsing-non-negative-integers>rules for parsing non-negative integers</a> to
that attribute's value.</li>

<li><p>If <var title="">base</var> is greater than 7, let it be
7.</li>

<li><p>If <var title="">base</var> is less than 1, let it be
1.</li>

<li><p>If <var title="">mode</var> is <i>relative-plus</i>, then
increment <var title="">value</var> by <var title="">base</var>. Otherwise, decrement <var title="">value</var> by <var title="">base</var>.</li>

</ol></li>

<li><p>If <var title="">value</var> is greater than 7, let it be
7.</li>

<li><p>If <var title="">value</var> is less than 1, let it be
1.</li>

<li>

<p>Set 'font-size' to the keyword corresponding to the value of
<var title="">value</var> according to the following table:</p>

<table><thead><tr><th><var title="">value</var>
<th>'font-size' keyword
<th>Notes
<tbody><tr><td>1
<td>xx-small
<td>
<tr><td>2
<td>small
<td>
<tr><td>3
<td>medium
<td>
<tr><td>4
<td>large
<td>
<tr><td>5
<td>x-large
<td>
<tr><td>6
<td>xx-large
<td>
<tr><td>7
<td>xxx-large
<td><i>see below</i>
</table><p>The 'xxx-large' value is a non-CSS value used here to indicate
a font size one "step" larger than 'xx-large'.</p>

</li>

<h4 id=punctuation-and-decorations><span class=secno>10.3.6 </span>Punctuation and decorations</h4>
</ol><h4 id=punctuation-and-decorations><span class=secno>10.3.6 </span>Punctuation and decorations</h4>

<pre class=css>@namespace url(http://www.w3.org/1999/xhtml);

170 source
@@ -1185,6 +1185,12 @@
<li><p>If <var title="">position</var> is past the end of <var
title="">input</var>, return an error.</p></li>

<li><p>If the next character is a U+002B PLUS SIGN character (+),
advance <var title="">position</var> to the next character.</li>

<li><p>If <var title="">position</var> is past the end of <var
title="">input</var>, return an error.</p></li>

<li><p>If the next character is not one of U+0030 DIGIT ZERO (0)
.. U+0039 DIGIT NINE (9), then return an error.</p></li>


<hr>

<p class="XXX">...font...</p>
<!-- face=>font-family -->
<!-- pointsize=>font-size as pt if present;
otherwise size=>font-size as follows:
int <0: as x-small
int >7: as xx-large
1,2,3,4,5,6: as x-small,small,medium,large,x-large,xx-large; quirks offsets by one?
-6 .. -0 +0 .. +6: add to <basefont size> and treat as above?
what values should x-small..xx-large have?
-->
<!-- color -->
<p>When a <code>font</code> element has a <code
title="attr-font-color">color</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>font</code> element has a <code
title="attr-font-face">face</code> attribute, the user agent is
expected to treat the attribute as a <span title="presentational
hints">presentational hint</span> setting the element's
'font-family' property to the attribute's value.</p>

<p>When a <code>font</code> element has a <code
title="attr-font-pointsize">pointsize</code> attribute, the user
agent is expected to parse that attribute's value using the
<span>rules for parsing non-negative integers</span>, and if this
doesn't generate an error, then the user agent is expected to use
the parsed value as a <em>point</em> length for a <span
title="presentational hints">presentational hint</span> for the
'font-size' property on the element.</p>

<p>When a <code>font</code> element has a <code
title="attr-font-size">size</code> attribute, the user agent is
expected to use the following steps to treat the attribute as a
<span title="presentational hints">presentational hint</span>
setting the element's 'font-size' property:</p>

<ol>

<li><p>Let <var title="">input</var> be the attribute's
value.</p></li>

<li><p>Let <var title="">position</var> be a pointer into <var
title="">input</var>, initially pointing at the start of the
string.</p></li>

<li><p><span>Skip whitespace</span>.</p></li>

<li><p>If <var title="">position</var> is past the end of <var
title="">input</var>, there is no <span title="presentational
hints">presentational hint</span>. Abort these steps.</p></li>

<li><p>If the character at <var title="">position</var> is a U+002B
PLUS SIGN character (+), then let <var title="">mode</var> be
<i>relative-plus</i>, and advance <var title="">position</var> to
the next character. Otherwise, if the character at <var
title="">position</var> is a U+002D HYPHEN-MINUS character (-),
then let <var title="">mode</var> be <i>relative-minus</i>, and
advance <var title="">position</var> to the next
character. Otherwise, let <var title="">mode</var> be
<i>absolute</i>.</p></li>

<li><p><span>Collect a sequence of characters</span> in the range
U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), and let the
resulting sequence be <var title="">digits</var>.</p></li>

<li><p>If <var title="">digits</var> is the empty string, there is
no <span title="presentational hints">presentational
hint</span>. Abort these steps.</p></li>

<li><p>Interpret <var title="">digits</var> as a base-ten
integer. Let <var title="">size</var> be the resulting
number.</p></li>

<li>

<p>If <var title="">mode</var> is not <i>absolute</i>, run these
substeps:</p>

<ol>

<li><p>Let <var title="">base</var> be 3.</p></li>

<li><p>Let <var title="">base element</var> be the the last
<code>basefont</code> element in <span>tree order</span> that is
before the <code>font</code> element, if there is one.</p></li>

<li><p>If there is a <var title="">base element</var>, and it has
a <code title="attr-basefont-size">size</code> attribute, then
apply the <span>rules for parsing non-negative integers</span> to
that attribute's value.</p></li>

<li><p>If <var title="">base</var> is greater than 7, let it be
7.</p></li>

<li><p>If <var title="">base</var> is less than 1, let it be
1.</p></li>

<li><p>If <var title="">mode</var> is <i>relative-plus</i>, then
increment <var title="">value</var> by <var
title="">base</var>. Otherwise, decrement <var
title="">value</var> by <var title="">base</var>.</p></li>

</ol>

</li>

<li><p>If <var title="">value</var> is greater than 7, let it be
7.</p></li>

<li><p>If <var title="">value</var> is less than 1, let it be
1.</p></li>

<li>

<p>Set 'font-size' to the keyword corresponding to the value of
<var title="">value</var> according to the following table:</p>

<table>
<thead>
<tr>
<th><var title="">value</var>
<th>'font-size' keyword
<th>Notes
<tbody>
<tr>
<td>1
<td>xx-small
<td>
<tr>
<td>2
<td>small
<td>
<tr>
<td>3
<td>medium
<td>
<tr>
<td>4
<td>large
<td>
<tr>
<td>5
<td>x-large
<td>
<tr>
<td>6
<td>xx-large
<td>
<tr>
<td>7
<td>xxx-large
<td><i>see below</i>
</table>

<p>The 'xxx-large' value is a non-CSS value used here to indicate
a font size one "step" larger than 'xx-large'.</p>

</li>

</ol>


<h4>Punctuation and decorations</h4>

0 comments on commit 04ee2e8

Please sign in to comment.
You can’t perform that action at this time.