This Week in HTML 5 - Episode 8

October 8th, 2008 by Mark Pilgrim, Google

Welcome back to "This Week in HTML 5," where I'll try to summarize the major activity in the ongoing standards process in the WHATWG and W3C HTML Working Group.

It's time to catch up on the myriad of changes to the HTML 5 spec. The big news this week is the continued merging of Web Forms 2 into HTML 5.

In other news, Andy Lyttle wants to standardize one particular feature of <input type="search"> (which is already supported by Safari, but not standardized): placeholder text for input fields. The text would initially display in the input field (possibly in a stylized form, smaller font, or lighter color), then disappear when the field receives focus. Lots of sites use Javascript to achieve this effect, but it is surprisingly difficult to get right, in part because no one can quite agree on exactly how it should work. Mozilla Firefox displays the name of your current search engine in its dedicated search box until you focus the search box, at which point it blanks out and allows you to type. Safari's search box is initially blank (at least on Windows), and only displays the name of your default search engine after it has received focus and lost it again. Google Chrome's "omnibox" displays "Type to search", right-justified, even when the omnibox has focus, then removes it after you've typed a single character. Adding an <input placeholder> attribute would allow each browser on each platform to match their users' expectations (and possibly even allow end-user customization) of how placeholder text should work for web forms. Discussion threads: 1, 2, 3. So far, there is no consensus on whether this should be added to HTML 5, or what the markup would look like.

Other interesting changes this week:

  • r2273 defines the <input required> attribute.
  • r2272 defines what it means to "activate" a form field, so that "clicking a button" and "setting focus to the button and pressing space" result in the same click event being triggered.
  • r2277 defines the <input size> attribute, which controls the displayed size of the field (but not the length of the field's value, that's <input maxlength> [r2233]).
  • r2278 defines the <input pattern> attribute, which is an arbitrary regular expression against which the field's value should be matched.
  • r2282 defines the input and change events. The input event occurs during typing in a form field (and therefore may trigger multiple times as the user types); the change event triggers when a change is committed, even if typing was not involved (such as choosing files to upload with an <input type="file"> field.
  • r2242 tweaks the definition of floating point numbers to allow specifying an exponent.

Around the web:

Tune in next week for another exciting episode of "This Week in HTML 5."

5 Responses to “This Week in HTML 5 - Episode 8”

  1. Ant Bryan Says:

    I interviewed Anne van Kesteren to talk about HTML 5 and other web standards in progress.

  2. Tim Says:

    A generic <h> ist still missing …

  3. Mark Hammonds Says:

    Great post. The thought of (x)HTML5 bringing the power of regular expressions to markup via r2278 is really exciting.

  4. Anne van Kesteren Says:

    Tim, it is called h1. :-)

  5. The WHATWG Blog » Blog Archive » This Week in HTML 5 - Episode 13 Says:

    [...] the discussion around the <input placeholder> attribute (which I first mentioned in This Week in HTML 5 Episode 8) and committed r2409 that defines the new [...]

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>