Why HTML5?
Why not XHTML2?
Learning from history how todrive the future of the Web

Michael(tm) Smith
mike@w3.org
http://people.w3.org/mikesideshowbarker on Twitter, GitHub, &c

W3C Interaction domain• HTML Working Group• Web Applications Working Group• CSS Working Group• SVG Working Group• more...

From 1997 through theend of 2006, work on
HTML within the W3C
focused exclusively on the
XHTML dialect.

A government in exile...

From June 2004 toMarch 2007, work on the(non-XHTML) HTMLlanguage took placeoutside of the W3C.

About HTML5 (andHTML forms)...

HTML5 in the words ofthe W3C HTML WG...

HTML design principles
http://w3.org/TR/html-design-principles/HTML design principles• Support existing content• Ensure interoperability• Precisely define UA behavior• Handle errors (non-draconically)• Evolution not revolution

“Draconically”=“Draconian”=“catch fire and fail”

About XHTML2 (andXForms)...

XHTML2 in the words ofthe W3C XHTML WG...

XHTML2 Design Aims
http://w3.org/TR/xhtml2/introduction.html#aims

XHTML2 Design Aims

• Use existing XML facilities rather
than duplicating them (impliesnamespace support)• Less scripting (vs declarative approach)• Integration with Semantic Web

What does
“declarative” mean?

Declarative programming
success story: SVG(XSLT also? XForms?)

HTML5 and XHTML2
in contrast...

Things HTML5 doesn’t do• Does not favor XML facilities• Does not avoid scripting• Does not consider integration
with the SemWeb a priority• No arbitrary namespaces

Things XHTML2 did not do• Does not support existing content

in the same way that HTML5 does

• Does not precisely define UA behavior• Does not handle errors non-draconically (uses “catch fire andfail” error handling)Important point:
XHTML2 was adifferent language thanXHTML1

...“different language” inthat XHTML2 does not
fully support existing
XHTML1 content (notbackward compatible)

A representative statement about
the difference in philosophy:“HTML is the assembly
language of the Web.”

Important point: In somecases HTML5 offers achoice of bothdeclarative and scripting
approaches.

About error handling...

Which of these are errors?
• Well-formed XML:
<input disabled="disabled">• Empty attribute: <input disabled>• Without quotes: <input value=yes>• Single quotes: <input type='checkbox'>• Double quotes: <input name="be evil">This is a real error<i><b>misnested tags</i></b>HTML5 parsers can handle
real errors interoperably
and gracefully.

Why is it important tohandle errors?

More than 93% ofAlexa Top 500 sites
contain HTML
conformance errors.

A little history...

(About draconian error handling in XML)I think users and application builders
should have a choice with what they
do with invalid data... I therefore planto continue to provide it even if thespec says that this is non-conforming.

April 1997
◦I think users and application builders should have a choice with what they do with invalid data. I cannot see
how a user or application builder can be disadvantaged by being provided with this choice, and I therefore
plan to continue to provide it even if the spec says that thisAfter careful consideration, theHTML Working Group has decided
that the goals for the next generationof forms are incompatible withpreserving backwards compatibility
with browsers designed for earlierversions of HTML.
August 1999

W3C has no intention to extend
HTML 4 as such. Instead, further
work is focusing on a reformulationof HTML in XMLNovember 1999

...while the ancestry of XHTML 2
comes from HTML 4, XHTML 1.0,
and XHTML 1.1, it is not intended to
be backward compatible with its
earlier versions
August 2002

XHTML 2.0 seems to me the live
proof that something is going wrong
at W3C... I strongly suggest
dropping all XHTML 2.0 efforts infavor of a new “xHTML 5.0”
language. Clearly a successor toHTML 4, feature-oriented, made forthe web.
December 2002

The W3C had so far failed toaddress a need in the Web
community: There is no language for
Web applications... I intend to dosomething about this (hopefullywithin a W3C context, although thatwill depend on the politicsof the situation).
January 2004

The dream of a new web, based on
XHTML+SVG+SMIL+XForms, is justthat — a dream... The best way tohelp the Web is to incrementally
improve the existing web
standards... so that web content
authors can actually deploy newformats interoperably.
June 2004

We need to specify error handlingbehavior to ensure interoperability“even in the face of documents that
do not comply to the letter of thespecifications”.

Authors will write invalid content
regardless of what we spec. So thespec states “what authors must not
do, and then tells implementors what
they must do when an author
does it anyway”.

It is necessary to evolve HTMLincrementally. The attempt to get theworld to switch to XML, including
quotes around attribute values andslashes in empty tags and namespaces
all at once didn’t work...

October 2006

more HTML history
http://w3.org/html/wg/wiki/History

HTML5 has a major focus on
facilitating use of a browser asa Web application platform (orWeb application runtimeenvironment).

XHTML2 had a major focus
on providing a generalpurpose document languagewith declarative mechanisms
to enable interactive features.

HTML5 support• specific native browser

support being implemented by
all major browser vendors• spec remains in active
development

XHTML2 support• no specific client-side native••

browser support from any majorbrowser vendor… but was intended to bepossible to “bolt on” some levelof support using CSS+JS
last WD: 2006

The bottom line...

HTML5 is the only HTMLdialect that will be natively
supported in browsers onthe client side.

Some HTML5 differences...

HTML5 defines HTML as an abstract
language with two standard
syntaxes supported by browsers:• a text/html syntax, with parsing

rules defined by the HTML5 spec

• an XML syntax, with parsing rules
defined by the XML spec

Similarly, applications canpotentially represent HTML inmemory in any number of ways.

http://software.hixie.ch/utilities/js/live-dom-viewer/However, there’s only one standard
in-memory representation supported
by browsers: The W3C DOM.
The HTML5 spec precisely defines
the DOM representation thatbrowsers must use to represent
HTML content in memory.

<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0
Transitional//EN""http://www.w3.org/TR/xhtml1/
DTD/xhtml1-transitional.dtd"><!DOCTYPE html>

<meta http-equiv="Content-Type"content="text/html; charset=utf-8">

<meta charset="utf-8">

Important point:
HTML5 includes XHTML(but not XHTML2...)

Frequently Asked
Questions (FAQ) about
the future of XHTML
http://www.w3.org/2009/06/xhtmlfaq.html

Michael(tm) Smith
mike@w3.org
http://people.w3.org/mikesideshowbarker on Twitter, GitHub, &c