This Week in HTML 5 – Episode 20
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.
The big news this week is the beginning of the non-normative section on rendering HTML documents. For those of you not up on spec-writing lingo, "non-normative" means "you can ignore this and still claim to be in compliance with the specification." It's advice, not commands. On the other hand, it's generally useful advice, so ignoring it completely is probably not in your best interests.
Currently, the rendering section includes advice on
- Hidden elements. Things like
<script>should always be hidden (in the sense that they should be executed, not have their source displayed in the page). Likewise,
<style>, and so on.
- Display types. Which elements should be rendered as block-level elements, which as tables, which as list items, and so on.
- Margins and padding. Default values for different elements, and also for the same element in different contexts (nested within other elements).
- Alignment. Table headers and captions are centered by default;
<table align=left>is treated like
- Fonts and colors. By default, links are blue, visited links are purple, and
<code>is rendered in a monospace font.
- Punctuation and decorations. Links are underlined by default, acronyms are dotted-underlined, and
<blink>, well, blinks.
- Resetting rules for inherited properties. Tables reset certain text properties; in quirks mode, they reset even more.
Scrolling through the rest of the (mostly empty) rendering section shows lots of potential for future advice on form controls, data grids, favicons, and even the
Switching back to the normative parts of the spec, we have r2720, which makes the
outerHTML property and the
insertAdjacentHTML() method work in XHTML. For the purposes of this discussion — indeed, for the purposes of the entire HTML 5 specification — "XHTML" means "content served with a
Content-Type: application/xhtml+xml". In addition, the section The XHTML Syntax has been entirely reorganized and rewritten to consolidate the rules for parsing and serializing XHTML documents and fragments. [Background: Re: outerHTML/insertAdjacentHTML in XML mode]
Other interesting tidbits this week:
- r2712 mandates that browsers ignore any extraneous text on the first line of an application cache manifest file (after the file signature "CACHE MANIFEST"), to accomodate hard-core web authors who edit their manifest files manually in Emacs and want to include mode lines on the first line of the file.
- r2719 specifies that browsers should not allow scripts to set
document.domainto anything on the Public Suffix List, such as "com" or "co.jp". Essential background reading on why this is dangerous: Untraceable XSS Attacks. Most browsers already block this attack, e.g. Firefox since 3.0. [Background: Re: Setting document.domain]
- r2711 addresses some security issues surrounding scripts that open windows with an address of
- r2731 requires that floats be serialized using exponential notation, e.g.
1e+0. [Background: Floating point number feedback]
- r2725 is another in a long and mostly boring saga surrounding the concept of a "legacy DOCTYPE." The official DOCTYPE of HTML 5 is simply
<!DOCTYPE HTML>-- so simple, in fact, that some tools can not generate it. Bug 54 tracks the issue to the point of obsession; I won't go into details here, but the issue has been bounced around since at least June 2008. I doubt this will be the last we hear about legacy DOCTYPEs. [More background: ISSUE-54: <!DOCTYPE HTML SYSTEM "about:legacy-compat">]
Tune in next week for another exciting episode of "This Week in HTML 5."