Ruby's Louvre

每天学习一点点算法

导航

This Week in HTML 5 – Episode 1

Web Workers, and how to specify alternate text for images you know nothing about.

Welcome to a new semi-regular column, "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.

The biggest news is the birth of the Web Workers draft specification. Quoting the spec, "This specification defines an API that allows Web application authors to spawn background workers running scripts in parallel to their main page. This allows for thread-like operation with message-passing as the coordination mechanism." This is the standardization of the API that Google Gears pioneered last year. See also: initial Workers thread, announcement of new spec, response to Workers feedback.

Also notable this week: even more additions to the Requirements for providing text to act as an alternative for images. 4 new cases were added:

  1. A link containing nothing but an image
  2. A group of images that form a single larger image
  3. An image not intended for the user (such as a "web bug" tracking image)
  4. Text that has been rendered to a graphic for typographical effect

Additionally, the spec now tries to define what authors should do if they know they have an image but don't know what it is. Quoting again from the spec:

If the src attribute is set and the alt attribute is set to a string whose first character is a U+007B LEFT CURLY BRACKET character ({) and whose last character is a U+007D RIGHT CURLY BRACKET character (}), the image is a key part of the content, and there is no textual equivalent of the image available. The string consisting of all the characters between the first and the last character of the value of the alt attribute gives the kind of image (e.g. photo, diagram, user-uploaded image). If that value is the empty string (i.e. the attribute is just "{}"), then even the kind of image being shown is not known.

  • If the image is available, the element represents the image specified by the src attribute.
  • If the image is not available or if the user agent is not configured to display the image, then the user agent should display some sort of indicator that the image is not being rendered, and, if possible, provide to the user the information regarding the kind of image that is (as derived from the alt attribute).

See also: revision 1972, revision 1976, revision 1978, revision 1979, Images and alternate text.

Other interesting changes this week:

  • revision 1951: define window.top
  • revision 1956: "User agents must not run executable code embedded in the image resource."
  • revision 1958: more notes on what is a valid image (a surprisingly difficult question)
  • revision 1965: allow <a> elements to straddle paragraphs
  • revision 1998: define what happens when you set onclick='' on a document outside a Window
  • revision 1999: define javascript: in Window-less environments
  • revision 2001: define 'directionality' in terms of the dir='' attribute for cases where the 'direction' property has no computed value
  • revision 2002: define processing for the second argument to getDataURL() for image/jpeg
  • revision 2004: specify how to handle transparent images in the toDataURL() method
  • revision 2008: make patterns required in the <canvas> API
  • revision 2016: when <script type=''> is given, it must match the type of the script, even if the script is Javascript
  • revision 2019: remove autosubmit='' from the <menu> element

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

This entry was posted on Wednesday, August 6th, 2008 at 17:32 and is filed under Processing Model, WHATWG, Weekly Review. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

posted on 2009-12-09 11:05  司徒正美  阅读(846)  评论(1编辑  收藏  举报