Eliminating authoring distinctions between block and non-block semantics

also to permit varied content models within the Q (or another) element

Corresponds to issue number 45

Problem statements / use cases

Dependency of element kind on element content model/state

This table illustrates the dependencies of CSS display-model, CSS display-role and HTML5 element kind on the content model and content state needed by an author. In other words this table stars from the left-side with a particular authors needs for semantic markup of a quotation and also the content model and content state (including number of words) of that quotation. From there it moves to the right determining the element kind. Moving to the next pair of columns it indicates the CSS display-role that can sometimes clash with the semantics expressed in HTML (and leads to 'misuse' of the BLOCKQUOTE element). Finally, the last column pair shows the display-model that is very dependent on the semantics in an HTML5 document.

Quotation dependencies →

element kind

display-role

display-model

content state ↓

structured

phrase

block

inline

block-inside

inline-inside

structured-inline

BLOCKQUOTE

BLOCKQUOTE

BLOCKQUOTE

strictly inline (phrase)

Q

Q

Q

strictly inline (phrase) (> n words)

Q

BLOCKQUOTE

Q

The distinctions illustrated here for Q and BLOCKQUOTE could be repeated for othere elements that share semantics, but whose content models can differ greatly (SPAN/DIV, CODE/BLOCKCODE, MAP). Yet other elements typically have a display-role of block (or always start a new line anyway) and so no attempt is made within the semantic markup to capture this distinction (e.g. P, LI, DD, TD, TH, PRE, DETAILS). Still other elements might benefit from the flexibility to have alternate content models if the display dependencies could be handled appropriately (without need for redundant semantic markup).

Proposed solutions

Add a type attribute to the DIV element

DIV elements are used for three broad purposes in HTML documents:

HTML5 (as well as XHTML2) introduce new elements and modified content models to largely eliminate the need for DIV except for the last case of a web component element. However, while new content models for P and SECTION elements will work in XML serializations automatically and for UAs updated to handle the text/html serialization of HTML5, these will not work in legacy browsers and authors cannot start using them until all non-HTML5 UAs are no longer part of the author’s targeted UAs.

By adding a type attribute and allowing authors to use the DIV element as a synonymous substitute element, authors can start taking advantage of these features of HTML5 immediately. Such a use for the DIV element would also facilitate easy straightforward conversion of the serialization to HTML5 or XHTML5 at any time.

<div type='p' >
As we can see from this extended quotation, this is clearly not the authors intent:

<q>
<div type='p'>
...
</div>
<div type='p'>
...
</div>
</q>
</div>

For an author only targeting XML or HTML5 aware text/html processing UAs the same document fragment could be authored as:

<p>
As we can see from this extended quotation, this is clearly not the authors intent:

<q>
<p>
...
</p>
<p>
...
</p>
</q>
</p>

As one can see from this example, the need for the BLOCKQUOTE element is completely obviated from a semantic point of view. It is clear from the contents of the element that the quotation involves block content. Requiring authors to provide this information redundantly by using a separate element is unnecessary.

The only use for BLOCKQUOTE that remains is in its inappropriate use as a styling mechanism for text quotes (not involving block/structure/grouping elements) but exceeding a particular number of words as many style guides and publishers direct.

Recommend authors use DIV type=p for text/html serialization

This proposal considers whether UAs may be able to lift the need for authors to markup different quotations with different markup depending on the content of the quotation: especially since the display-role presentation of the quotation may depend on different circumstances than the content model distinction between Q and BLOCKQUOTE (a distinction that really is redundant and adds nothing to the markup than the quotation markup itself).

In the XML serialization deprecate the BLOCKQUOTE element and recommend authors only use the Q element with a new content model of: inline or block but not both.

Summary

In summary, the proposal constitutes one new DOM method and one new DOM attribute on a new HTMLQuoteElement interface. Second, the proposal adds a new DOM attribute to the HTMLElement interface.

contentModel DOM attribute added to HTMLElement interface

The contentModel DOM attribute on the HTMLElement interface would return the state of an element's content. Return values are either 'phrase', 'text' or 'structured' (either a integers 0, 1, 2 respectively or as those actual strings). This would provide a convenience method for DOM API consumers to easily, consistently and accurately evaluate the content state of an element. For element's whose content model can vary, this would provided information that the element name can not provide. For example, the name Q and BLOCKQUOTE unambiguously indicate the content state of an element that is conforming: i.e., 'phrase' for Q and 'structural' for BLOCKQUOTE. However, for the P element in a XML de-serialized DOM, the element can either be 'phrase' or 'text' depending on the situation. {NOTE: these return values could be changed depending on the categories established in our CR HTML5 draft}

New HTMLQuoteElement interface with threshold DOM method and words DOM attribute

 interface HTMLQuoteElement : HTMLElement {
        attribute DOMString cite;
 +      boolean threshold (unsigned long words);
 +      attribute unsigned long words;
 +      attribute DOMString marks;
 +      attribute DOMString pages;
 +      attribute DOMString annotation;
 };

The threshold method returns true if the contents innerText method of the quotation element exceeds the unssinged long words argument passed to the interface. Otherwise it returns false.

Liaison with CSS3 WG

Liaison with CSS3 WG to provide pseudo-class selectors to distinguish between elements based on their content state and to distinguish between quotation elements based on their word length. The CSS WG has come up with some fairly ingenious mechanisms that are both simple and elegant to solve similar problems. It would be nice to be able to specify a word length property through CSS and then specify a pseudo-class selector select for styling only those quotations exceeding (or not exceeding) that number of words.

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.

Originally introduced in a review of the HTML5 draft section on phrase elements.

  1. Review by Rob Burns

Discussion of alternate proposal on wai-xtech list serve with the subject: "Alternate Additional Attribute Set for a Single Quote Element"

See also

HTML/QuotationBlockVInline (last edited 2008-06-09 13:54:17 by rburns)