A user account is required in order to edit this wiki, but we've had to disable public user registrations due to spam.

To request an account, ask an autoconfirmed user on IRC (such as one of these permanent autoconfirmed members).

Difference between revisions of "Rationale"

From WHATWG Wiki
Jump to: navigation, search
(Why the complications for script elements: change of title to fit page format)
Line 52: Line 52:
 
- temporary stub -<ref>http://www.paciellogroup.com/resources/articles/altinhtml5.html</ref>
 
- temporary stub -<ref>http://www.paciellogroup.com/resources/articles/altinhtml5.html</ref>
  
=== script - rules for parsing ===
+
== HTML parsing ==
 +
 
 +
=== script element ===
  
 
Why the [http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting-1.html#restrictions-for-contents-of-script-elements restrictions for contents of script elements]? Why the [http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#script-data-double-escaped-dash-dash-state complicated parsing rules for script elements]?
 
Why the [http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting-1.html#restrictions-for-contents-of-script-elements restrictions for contents of script elements]? Why the [http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#script-data-double-escaped-dash-dash-state complicated parsing rules for script elements]?
  
 
See http://lists.w3.org/Archives/Public/public-html-comments/2010Mar/0017.html
 
See http://lists.w3.org/Archives/Public/public-html-comments/2010Mar/0017.html
 +
 +
=== quirks mode ===
 +
 +
The HTML parser has [http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#parsing-main-inbody the following] behavior difference in quirks mode:
 +
 +
<blockquote><dl><dt>A start tag whose tag name is "table"
 +
<dd>If the Document is not set to quirks mode, and the stack of open elements has a p element in scope, then act as if an end tag with the tag name "p" had been seen.</dd></dl></blockquote>
 +
 +
Why? See http://hsivonen.iki.fi/last-html-quirk/
  
 
== Other Pages ==
 
== Other Pages ==

Revision as of 21:20, 10 May 2010

This document serves a rationale document for various parts of the HTML5 specification. Over time this page will be a complete rationale document.

General Rationale

One Vendor, One Veto

Part of the the goal of the WHATWG is to document how web browsers actually handle HTML. As such browser vendors already have veto power - by not following the standard. The W3C and WHATWG do not have any enforcement power and can only write what browsers are willing to implement. Not removing features from the HTML standard that at least one browser vendor has stated they are unwilling to implement causes the HTML spec to not accurately document reality.[1][2]

Specific Elements

Plaintext

the <plaintext> element is a obsolete precursor to the <pre> element. [3] It is is now in the HTML5 spec as a method of stopping all further html token parsing. It lacks an end tag and just emits the rest of the page as plain text. It throws a parse error upon reaching the end of the document as it is not considered a valid element (and it is missing an end-tag).

Image

<image> element is treated as an alternate (but invalid) name for <img>. This is because some sites (around 0.2%[4]) make this mistake. It is already treated as an image by most major browsers.

Meter and Progress (are not the same thing)

<meter> is not just a special case of <progress>. The meter element represents a scalar measurement within a known range, such as storage quota usage, a relative popularity rating or relevance indicator. The control allows for the indication of high and low ranges, or minimum, maximum and optimal levels.

The progress element, on the other hand, represents the completion progress of a task. This could be a real time indicator for background processing task (e.g. using Web Workers or a file upload). Progress elmements can also be in the indeterminate state, indicating that something is in progress, but it's completion progress is unknown.

The default rendering for a meter element could look something like the following:

example of proper rendering for the meter element

Whereas, the default rendering for the progress element could look like this:

Alternatively, an indeterminate progress bar could also be styled as a throbber, which indicates progress without any indication of the remaining progress:

picture of the default apple throbber

See Re: <progress> draft for details.

B, I, EM, and STRONG

<em> is meant to indicate that some text is emphasized. <strong> is meant to confer importance upon text. <b> is meant for text that is stylistically offset from the rest of the text. Finally <i> is used to indicate that some text is meant to be read in an alternate mood.

For example

   Cats are <em>cute</em> animals.

could mean that cats are specifically cute.

   Cats are <strong>cute</strong> animals.

could mean that the word cute is in some way important

   Cats are <b>cute</b> animals.

could mean that the word cute is a new word (perhaps in a language lesson) but is not important

   Cats are <i>cute</i> animals.

could mean that the word cute is meant to be read in a different tone (sarcastically for example)

IMG tag & alt text

- temporary stub -[5]

HTML parsing

script element

Why the restrictions for contents of script elements? Why the complicated parsing rules for script elements?

See http://lists.w3.org/Archives/Public/public-html-comments/2010Mar/0017.html

quirks mode

The HTML parser has the following behavior difference in quirks mode:

A start tag whose tag name is "table"
If the Document is not set to quirks mode, and the stack of open elements has a p element in scope, then act as if an end tag with the tag name "p" had been seen.

Why? See http://hsivonen.iki.fi/last-html-quirk/

Other Pages

References