Warning:
This wiki has been archived and is now read-only.

InterimLegacyBridgingMarkup

From HTML WG Wiki
Jump to: navigation, search

Interim markup to bridge with legacy UAs

Problem statement / use cases

For the text/html serialization only:

  • many key implementations do not use DTDs or any similar mechanism so they cannot correctly parse unknown HTML elements
  • authors want to use the new semantics elements provided by in HTML5, but cannot do so if targeted UAs do not properly parse those elements
  • routine DOM states cannot be serialized to text/html without loss of data

This issues surrounding parsing involves two separate but related issues:

  • content models not supported by the p (paragraph) element
  • incorrect parsing for newly introduced elements (parsed either as void, paragraph-terminating or non-paragraph-terminating)

Proposed solutions

Provide legacy support through the use of closely related elements modified slightly with very compact boolean attributes. We would then require HTML5 UAs to treat these legacy bridging elements (modified by these attributes) identically to the newly specified element types. Authors needing some measure of legacy support would be allowed to use these elements instead of the newly specified element types. For example:

  • using the DIV element with a p attribute would mean the same as an XHTML5 P element, available for use in the same contexts, with the same content model, and the same semantics.
  • a DIV element with an s attribute would be synonymous with a SECTION element

HTML5 element synonyms

The following table provides a fairly complete view of the needed synonymous elements for newly proposed elements from the HTML5 WG. It does leave out forms related elements, event-source, and a few other specialized elements.

||Semantics ||HTML5 Proposed ||Synonym ||Example||
||Paragraph || P ||DIV@p ||<div p>[a paragraph]</div> ||
||Section || SECTION ||DIV@s ||<div s><div p>[a paragraph]</div></div><!--end section --> ||
||Article || ARTICLE ||DIV@a ||<div a><div s>...[a section containing paragraphs]...</div><!--end section --></div><!--end article --> ||
||Definition || DEFINE ||SPAN@d ||<span d><div p>...[a definition]...</div></span> ||
||Aside|| ASIDE ||SPAN@a ||<span a>...[an aside or subtext or note]...</span> ||
||Line || L ||SPAN@l ||<span l>...[a line]...</span> ||
||Mark || M ||A@m ||<a m>a paragraph</a> ||
||Meter || METER ||SPAN@meter ||<span meter>[a meter fallback value/expression]</span> ||
||Progress || PROGRESS ||SPAN@progress ||<span progress>[a progress fallback value/expression]</span> ||
||Time || TIME ||SPAN@time ||<span time>[a time fallback value/expression]</span> ||
||Figure || FIGURE ||TABLE@f ||<table f><caption>...[a caption]...</caption><img src='afile' role='photograph' ></table> ||
||Term || T ||VAR@t ||<var t>...[a term]...</var> ||
||Proper noun || PN ||VAR@pn ||<var pn>...[a name]...</var> ||
||Bookmark || BMARK ||BR@b ||<hr b> ||
||Block code || BLOCKCODE ||PRE@b ||<pre b>...[a block of sample code]...</pre> ||
||Dialog || DIALOG ||DL@d ||<dl d><dt>...[speaker]...</dt><dd>...[spoken line]...</dd></dl> ||
||Embed Video || VIDEO ||OBJECT@type='video/*' ||<object type='video/mpeg' data='afile' autoplay >...[alternate/fallback content]...</object> ||
||Embed Audio || AUDIO ||OBJECT@type='audio/*' ||<object type='audio/mp3' data='afile' autoplay >...[alternate/fallback content]...</object> ||
|||||||| Components ||
||Header || HEADER ||DIV@header ||<div header>...[contents]...</div> ||
||Footer || FOOTER ||DIV@footer ||<div footer>...[contents]...</div> ||
||Navigation component || NAV ||DIV@nav ||<div nav>...[contents]...</div> ||

Conversion between synonymous markup

Since HTML5 would define these as synonymous for all HTML5 processing UAs authors could use either markup to create the same meaning and expect the same processing in HTML5 compliant UAs. Authors would be prohibited from using the synonyms for the XML serializations and XML serialization processing HTML5 UAS must ignore the boolean attributes.

Discourage P element in text/html

For greatest HTML5 benefits in the text/html serialization, HTML5 would discourage the use of the P element except when using the XML serialization. Authors would simply use the DIV element with a “p” boolean attribute attached. Already authors are accustomed to using DIVs in one of three primary ways. First as a paragraph with mixed text and phrase elements. Second, as a sectioning element or a container for an individual article. Third as a web component like the HTML5 proposed header, footer and nav elements. So encouraging authors to use the DIV@p markup for paragraph semantics will not be seen as unusual by HTML authors.

In the XML serialization, authors must use the P element instead of DIVs. Therefore in the full-fledged XHTML5, the only need remaining for DIV elements is as web component containers.

Discussion and evaluation

Email

WG members should post feedback and other discussion to the WG’s list serve (the URI for the links below provides date information). Search on this email subject.

See also