[html5] r3193 - [] (0) Correct the algorithm for <textarea> dimensions. (credit: ov)
whatwg at whatwg.org
whatwg at whatwg.org
Thu Jun 4 18:23:58 PDT 2009
Author: ianh
Date: 2009-06-04 18:23:56 -0700 (Thu, 04 Jun 2009)
New Revision: 3193
Modified:
index
source
Log:
[] (0) Correct the algorithm for <textarea> dimensions. (credit: ov)
Modified: index
===================================================================
--- index 2009-06-05 00:33:37 UTC (rev 3192)
+++ index 2009-06-05 01:23:56 UTC (rev 3193)
@@ -69250,16 +69250,8 @@
implement any relevant animations, etc, that are appropriate for the
platform. <a href=#refsCSSUI>[CSSUI]</a></p>
- <hr><p>The <dfn id=converting-a-character-width-to-pixels>converting a character width to pixels</dfn> algorithm,
- used by some of the bindings below, returns <span>(<var title="">size-1</var>)×<var title="">avg</var> + <var title="">max</var></span>, where
- <var title="">size</var> is the character width to convert, <var title="">avg</var> is the average character width of the primary
- font for the element for which the algorithm is being run, in
- pixels, and <var title="">max</var> is the maximum character width
- of that same font, also in pixels. (The element's 'letter-spacing'
- property does not affect the result.)</p>
-
<h4 id=the-bb-element-0><span class=secno>11.4.2 </span>The <code><a href=#the-bb-element>bb</a></code> element</h4>
<pre class=css>@namespace url(http://www.w3.org/1999/xhtml);
@@ -69363,8 +69355,16 @@
from applying the <a href=#converting-a-character-width-to-pixels>converting a character width to
pixels</a> algorithm to the number 20.</p>
+ <p>The <dfn id=converting-a-character-width-to-pixels>converting a character width to pixels</dfn> algorithm
+ returns <span>(<var title="">size</var>-1)×<var title="">avg</var> + <var title="">max</var></span>, where
+ <var title="">size</var> is the character width to convert, <var title="">avg</var> is the average character width of the primary
+ font for the element for which the algorithm is being run, in
+ pixels, and <var title="">max</var> is the maximum character width
+ of that same font, also in pixels. (The element's 'letter-spacing'
+ property does not affect the result.)</p>
+
<h4 id=the-input-element-as-domain-specific-widgets><span class=secno>11.4.7 </span>The <code><a href=#the-input-element>input</a></code> element as domain-specific widgets</h4>
<pre class=css>@namespace url(http://www.w3.org/1999/xhtml);
@@ -69809,18 +69809,34 @@
attribute, 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 attribute as a <a href=#presentational-hints title="presentational hints">presentational hint</a> for the
- 'width' property on the element, with the value obtained from
- applying the <a href=#converting-a-character-width-to-pixels>converting a character width to pixels</a>
- algorithm to the value of the attribute and then adding the width of
- a scroll bar.</p>
+ 'width' property on the element, with the value being the
+ <a href=#textarea-effective-width>textarea effective width</a> (as defined below). Otherwise,
+ the user agent is expected to act as if it had a user-agent-level
+ style sheet rule setting the 'width' property on the element to the
+ <a href=#textarea-effective-width>textarea effective width</a>.</p>
+ <p>The <dfn id=textarea-effective-width>textarea effective width</dfn> of a
+ <code><a href=#the-textarea-element>textarea</a></code> element is <span><var title="">size</var>×<var title="">avg</var> + <var title="">sbw</var></span>, where <var title="">size</var> is the
+ element's <a href=#attr-textarea-cols-value title=attr-textarea-cols-value>character
+ width</a>, <var title="">avg</var> is the average character width
+ of the primary font of the element, in CSS pixels, and <var title="">sbw</var> is the width of a scroll bar, in CSS pixels. (The
+ element's 'letter-spacing' property does not affect the result.)</p>
+
<p>If the element has a <code title=attr-textarea-rows><a href=#attr-textarea-rows>rows</a></code>
attribute, 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 attribute as a <a href=#presentational-hints title="presentational hints">presentational hint</a> for the
- 'height' property on the element, with the value being the specified
- number of lines, plus the height of a scrollbar.</p>
+ 'height' property on the element, with the value being the
+ <a href=#textarea-effective-height>textarea effective height</a> (as defined
+ below). Otherwise, the user agent is expected to act as if it had a
+ user-agent-level style sheet rule setting the 'height' property on
+ the element to the <a href=#textarea-effective-height>textarea effective height</a>.</p>
+ <p>The <dfn id=textarea-effective-height>textarea effective height</dfn> of a
+ <code><a href=#the-textarea-element>textarea</a></code> element is the height in CSS pixels of the
+ number of lines specified the element's <a href=#attr-textarea-rows-value title=attr-textarea-rows-value>character height</a>, plus the
+ height of a scrollbar in CSS pixels.</p>
+
<p>For historical reasons, if the element has a <code title=attr-textarea-wrap><a href=#attr-textarea-wrap>wrap</a></code> attribute whose value is an
<a href=#ascii-case-insensitive>ASCII case-insensitive</a> match for the string "<code title=attr-textarea-wrap-off>off</code>", then the user agent is
expected to not wrap the rendered value; otherwise, the value of the
Modified: source
===================================================================
--- source 2009-06-05 00:33:37 UTC (rev 3192)
+++ source 2009-06-05 01:23:56 UTC (rev 3193)
@@ -81660,21 +81660,8 @@
implement any relevant animations, etc, that are appropriate for the
platform. <a href="#refsCSSUI">[CSSUI]</a></p>
- <hr>
- <p>The <dfn>converting a character width to pixels</dfn> algorithm,
- used by some of the bindings below, returns <span>(<var
- title="">size-1</var>)×<var
- title="">avg</var> + <var title="">max</var></span>, where
- <var title="">size</var> is the character width to convert, <var
- title="">avg</var> is the average character width of the primary
- font for the element for which the algorithm is being run, in
- pixels, and <var title="">max</var> is the maximum character width
- of that same font, also in pixels. (The element's 'letter-spacing'
- property does not affect the result.)</p>
-
-
<h4>The <code>bb</code> element</h4>
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
@@ -81792,8 +81779,18 @@
from applying the <span>converting a character width to
pixels</span> algorithm to the number 20.</p>
+ <p>The <dfn>converting a character width to pixels</dfn> algorithm
+ returns <span>(<var title="">size</var>-1)×<var
+ title="">avg</var> + <var title="">max</var></span>, where
+ <var title="">size</var> is the character width to convert, <var
+ title="">avg</var> is the average character width of the primary
+ font for the element for which the algorithm is being run, in
+ pixels, and <var title="">max</var> is the maximum character width
+ of that same font, also in pixels. (The element's 'letter-spacing'
+ property does not affect the result.)</p>
+
<h4>The <code>input</code> element as domain-specific widgets</h4>
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
@@ -82310,19 +82307,39 @@
for parsing non-negative integers</span> doesn't generate an error,
then the user agent is expected to use the attribute as a <span
title="presentational hints">presentational hint</span> for the
- 'width' property on the element, with the value obtained from
- applying the <span>converting a character width to pixels</span>
- algorithm to the value of the attribute and then adding the width of
- a scroll bar.</p>
+ 'width' property on the element, with the value being the
+ <span>textarea effective width</span> (as defined below). Otherwise,
+ the user agent is expected to act as if it had a user-agent-level
+ style sheet rule setting the 'width' property on the element to the
+ <span>textarea effective width</span>.</p>
+ <p>The <dfn>textarea effective width</dfn> of a
+ <code>textarea</code> element is <span><var
+ title="">size</var>×<var title="">avg</var> + <var
+ title="">sbw</var></span>, where <var title="">size</var> is the
+ element's <span title="attr-textarea-cols-value">character
+ width</span>, <var title="">avg</var> is the average character width
+ of the primary font of the element, in CSS pixels, and <var
+ title="">sbw</var> is the width of a scroll bar, in CSS pixels. (The
+ element's 'letter-spacing' property does not affect the result.)</p>
+
<p>If the element has a <code title="attr-textarea-rows">rows</code>
attribute, 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 attribute as a <span
title="presentational hints">presentational hint</span> for the
- 'height' property on the element, with the value being the specified
- number of lines, plus the height of a scrollbar.</p>
+ 'height' property on the element, with the value being the
+ <span>textarea effective height</span> (as defined
+ below). Otherwise, the user agent is expected to act as if it had a
+ user-agent-level style sheet rule setting the 'height' property on
+ the element to the <span>textarea effective height</span>.</p>
+ <p>The <dfn>textarea effective height</dfn> of a
+ <code>textarea</code> element is the height in CSS pixels of the
+ number of lines specified the element's <span
+ title="attr-textarea-rows-value">character height</span>, plus the
+ height of a scrollbar in CSS pixels.</p>
+
<p>For historical reasons, if the element has a <code
title="attr-textarea-wrap">wrap</code> attribute whose value is an
<span>ASCII case-insensitive</span> match for the string "<code
More information about the Commit-Watchers
mailing list