Skip to content
Permalink
Browse files

[] (0) Filling in the rendering section: <input type=text>; also, som…

…e tweaks to <img>'s requirements.

git-svn-id: http://svn.whatwg.org/webapps@2765 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Feb 6, 2009
1 parent a72aed9 commit 78f593bf10a4d80d007baa22981913569a2a8842
Showing with 189 additions and 83 deletions.
  1. +89 −40 index
  2. +100 −43 source
129 index
conditions in the previous paragraph are not met, then the image is
<em>not</em> <i>available</i>.</p>

<p class=note>An image might be <i>available</i> in one
<a href=#view>view</a> but not another. For instance, a
<code>Document</code> could be rendered by a screen reader providing
a speech synthesis view of the output of a Web browser using the
screen media. In this case, the image would be <i>available</i> in
the Web browser's screen view, but <em>not</em> <i>available</i> in
the screen reader's view.</p>

<p>Whether the image is fetched successfully or not (e.g. whether
the response code was a 2xx code <a href=#concept-http-equivalent-codes title=concept-http-equivalent-codes>or equivalent</a>) must be
ignored when determining the image's type and whether it is a valid
<p>The image might be a key part of the content, and there is no
textual equivalent of the image available.</p>

<p class=note>In a conforming document, the absence of the <code title=attr-img-alt><a href=#attr-img-alt>alt</a></code> attribute indicates that the image
is a key part of the content but that a textual replacement for
the image was not available when the image was generated.</p>

<p>If the image is <i>available</i>, the element
<a href=#represents>represents</a> the image specified by the <code title=attr-img-src><a href=#attr-img-src>src</a></code> attribute.</p>

<p>When it is possible for detailed alternative text to be
provided, for example if the image is part of a series of
screenshots in a magazine review, or part of a comic strip, or is
a photograph in a blog entry about that photograph, text that
conveys can serve as a substitute for the image must be given as
the contents of the <code title=attr-img-alt><a href=#attr-img-alt>alt</a></code>
attribute.</p>
a photograph in a blog entry about that photograph, text that can
serve as a substitute for the image must be given as the contents
of the <code title=attr-img-alt><a href=#attr-img-alt>alt</a></code> attribute.</p>

<div class=example>

instance of the tokeniser (<a href=#fragment-case>fragment case</a>), or, if the
<a href=#content-model-flag>content model flag</a> is set to the RCDATA or CDATA states
and the next few characters do not match the tag name of the last
start tag token emitted (compared in an <span>ASCII case
insensitive</span> manner), or if they do but they are not
start tag token emitted (compared in an <a href=#ascii-case-insensitive>ASCII
case-insensitive</a> manner), or if they do but they are not
immediately followed by one of the following characters:</p>

<ul class=brief><li>U+0009 CHARACTER TABULATION</li>
line-height: initial;
white-space: initial;
text-align: initial;
}</pre>
}

input { box-sizing: border-box; }</pre>


<h4 id=the-hr-element-0><span class=secno>10.2.8 </span>The <code><a href=#the-hr-element>hr</a></code> element</h4>
<code><a href=#the-fieldset-element>fieldset</a></code> element, if any, is expected to be rendered
over the top border edge of the <code><a href=#the-fieldset-element>fieldset</a></code> element. If
the <code><a href=#the-legend-element>legend</a></code> element in question has an <code title=attr-legend-align>align</code> attribute, and its value is
an <span>ASCII case insensitive</span> match for one of the strings
an <a href=#ascii-case-insensitive>ASCII case-insensitive</a> match for one of the strings
in the first column of the following table, then the
<code><a href=#the-legend-element>legend</a></code> is expected to be rendered horizontally aligned
over the border edge in the position given in the corresponding cell
width is necessary to render the text on one line.</p>

<p>The icons mentioned above are expected to be relatively small so
as not to disrupt most text but be easily clickable, for instance 16
pixels by 16 pixels square, or 1em by 1em if the images are
scalable. The images are intended to indicate to the user that they
can be used to get to whatever options the UA provides for images,
and, where appropriate, are expected to provide access to the
context menu that would have come up if the user interacted with the
actual image.</p>
as not to disrupt most text but be easily clickable. In a visual
environment, for instance, icons could be 16 pixels by 16 pixels
square, or 1em by 1em if the images are scalable. In an audio
environment, the icon could be a short bleep. The icons are intended
to indicate to the user that they can be used to get to whatever
options the UA provides for images, and, where appropriate, are
expected to provide access to the context menu that would have come
up if the user interacted with the actual image.</p>

<hr><p>The following CSS rules are expected to apply when the
<code>Document</code> is in <a href=#quirks-mode>quirks mode</a>:</p>




<h4 id=the-input-element-as-a-text-entry-widget><span class=secno>10.4.6 </span>The <code><a href=#the-input-element>input</a></code> element as a text entry widget</h4>

<p class=XXX>When an <code><a href=#the-input-element>input</a></code> element's <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute is in the <a href=#text-state-and-search-state title=attr-input-type-text>Text</a>, <a href=#text-state-and-search-state title=attr-input-type-search>Search</a>, <a href=#url-state title=attr-input-type-url>URL</a>, <a href=#e-mail-state title=attr-input-type-email>E-mail</a>, or <a href=#password-state title=attr-input-type-password>Password</a> state, ...</p>
<!-- datalist presentation -->
<pre class=css>@namespace url(http://www.w3.org/1999/xhtml);
input { binding: <i title="">textfield</i>; }
input[type=password] { binding: <i title="">textfield-password</i>; }
/* later rules override this for other values of type="" */</pre>

<p>When the <i title="">textfield</i> binding applies to an
<code><a href=#the-input-element>input</a></code> element whose <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute is in the <a href=#text-state-and-search-state title=attr-input-type-text>Text</a>, <a href=#text-state-and-search-state title=attr-input-type-search>Search</a>, <a href=#url-state title=attr-input-type-url>URL</a>, or <a href=#e-mail-state title=attr-input-type-email>E-mail</a> state, the element is
expected to render as an 'inline-block' box rendered as a text
field.</p>

<p>When the <i title="">textfield</i> binding applies, to an
<code><a href=#the-input-element>input</a></code> element whose <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute is in the <a href=#password-state title=attr-input-type-password>Password</a> state, the element
is expected to render as an 'inline-block' box rendered as a text
field whose contents are obscured.</p>

<p>If an <code><a href=#the-input-element>input</a></code> element whose <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute is in one of the above
states has a <code title=attr-input-size><a href=#attr-input-size>size</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>presentational hints</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.</p>

<p>If an <code><a href=#the-input-element>input</a></code> element whose <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute is in one of the above
states does <em>not</em> have a <code title=attr-input-size><a href=#attr-input-size>size</a></code> attribute, then 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 value obtained
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
return <span>(<var title="">size-1</var>)&times;<var title="">avg</var>&nbsp;+&nbsp;<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, and <var title="">max</var> is the maximum character width of that same
font. (The element's 'letter-spacing' property does not affect the
result.)</p>

<!-- size: http://mxr.mozilla.org/mozilla-central/ident?i=CalcIntrinsicSize -->


<h4 id=the-input-element-as-domain-specific-widgets><span class=secno>10.4.7 </span>The <code><a href=#the-input-element>input</a></code> element as domain-specific widgets</h4>
Smith, Geoffrey Garen, Geoffrey Sneddon, George Lund, H&aring;kon
Wium Lie, Hans S. T&oslash;mmerhalt, Henri Sivonen, Henrik Lied,
Henry Mason, Hugh Winkler, Ignacio Javier, Ivo Emanuel
Gon&ccedil;alves, J. King, Jacques Distler, James Graham, James
Justin Harrell, James M Snell, James Perrett, Jan-Klaas Kollhof,
Jason White, Jasper Bryant-Greene, Jed Hartman, Jeff Cutsinger, Jeff
Schiller, Jeff Walden, Jens Bannmann, Jens Fendler, Jeroen van der
Meer, Jim Jewett, Jim Meehan, Joe Clark, John Fallows, Joseph
Kesselman, Jjgod Jiang, Joel Spolsky, Johan Herland, John Boyer,
John Bussjaeger, John Harding, Johnny Stenback, Jon Gibbins, Jon
Perlow, Jonathan Worent, Jorgen Horstink, Josh Levenberg, Joshua
Randall, Jukka K. Korpela, Jules Cl&eacute;ment-Ripoche, Julian
Reschke, Kai Hendry, Kartikaya Gupta, <!-- Keryx Web, = Lars Gunther
--> Kornel Lesinski, &#40658;&#28580;&#21083;&#24535; (KUROSAWA
Takeshi), Kristof Zelechovski, Kyle Hofmann, Lachlan Hunt, Larry
Page, Lars Gunther, Laura L. Carlson, Laura Wisewell, Laurens Holst,
Lee Kowalkowski, Leif Halvard Silli, Lenny Domnitser, L&eacute;onard
Bouchet, Leons Petrazickis, Logan<!-- on moz irc -->, Loune, Maciej
Stachowiak, Magnus Kristiansen<!-- Dashiva -->, Maik Merten, Malcolm
Rowe, Mark Nottingham, Mark Rowe<!--bdash-->, Mark Schenk, Martijn
Wargers, Martin Atkins, Martin D&uuml;rst, Martin Honnen, Masataka
Yakura, Mathieu Henri, Matthew Gregan, Matthew Mastracci, Matthew
Raymond, Matthew Thomas, Mattias Waldau, Max Romantschuk, Michael
'Ratt' Iannarelli, Michael A. Nachbaur, Michael A. Puls
Gon&ccedil;alves, J. King, Jacques Distler, James Craig, James
Graham, James Justin Harrell, James M Snell, James Perrett,
Jan-Klaas Kollhof, Jason White, Jasper Bryant-Greene, Jed Hartman,
Jeff Cutsinger, Jeff Schiller, Jeff Walden, Jens Bannmann, Jens
Fendler, Jeroen van der Meer, Jim Jewett, Jim Meehan, Joe Clark,
John Fallows, Joseph Kesselman, Jjgod Jiang, Joel Spolsky, Johan
Herland, John Boyer, John Bussjaeger, John Harding, Johnny Stenback,
Jon Gibbins, Jon Perlow, Jonathan Worent, Jorgen Horstink, Josh
Levenberg, Joshua Randall, Jukka K. Korpela, Jules
Cl&eacute;ment-Ripoche, Julian Reschke, Kai Hendry, Kartikaya Gupta,
<!-- Keryx Web, = Lars Gunther --> Kornel Lesinski,
&#40658;&#28580;&#21083;&#24535; (KUROSAWA Takeshi), Kristof
Zelechovski, Kyle Hofmann, Lachlan Hunt, Larry Page, Lars Gunther,
Laura L. Carlson, Laura Wisewell, Laurens Holst, Lee Kowalkowski,
Leif Halvard Silli, Lenny Domnitser, L&eacute;onard Bouchet, Leons
Petrazickis, Logan<!-- on moz irc -->, Loune, Maciej Stachowiak,
Magnus Kristiansen<!-- Dashiva -->, Maik Merten, Malcolm Rowe, Mark
Nottingham, Mark Rowe<!--bdash-->, Mark Schenk, Martijn Wargers,
Martin Atkins, Martin D&uuml;rst, Martin Honnen, Masataka Yakura,
Mathieu Henri, Matthew Gregan, Matthew Mastracci, Matthew Raymond,
Matthew Thomas, Mattias Waldau, Max Romantschuk, Michael 'Ratt'
Iannarelli, Michael A. Nachbaur, Michael A. Puls
II<!--Shadow2531-->, Michael Carter, Michael Gratton, Michael
Nordman, Michael Powers, Michael(tm) Smith, Michel Fortin, Michiel
van der Blonk, Mihai &#350;ucan<!-- from ROBO Design -->, Mike

0 comments on commit 78f593b

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