This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 30276 - [ser] HTML/XHTML indentation: definition of "inline" elements
Summary: [ser] HTML/XHTML indentation: definition of "inline" elements
Status: NEW
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Serialization 3.1 (show other bugs)
Version: Recommendation
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: C. M. Sperberg-McQueen
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-16 08:30 UTC by Michael Kay
Modified: 2018-07-16 08:33 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2018-07-16 08:30:37 UTC
The definition of "inline" elements in §6.1.4 and §7.4.3 is a little fuzzy.

For XHTML, the definition is

The inline elements are those elements recognized as HTML elements that are in the %inline category of any of the XHTML 1.0 DTDs, in the %inline.class category of the XHTML 1.1 DTD, those elements defined to be phrasing elements in HTML5 and elements recognized as HTML elements with local names ins and del if they are used as inline elements (i.e., if they do not contain element children).

The use of a list of sets joined with "and" suggests that there is a single set of inline element (names) which is the union of these sets, and that the set of inline elements is therefore independent of the HTML version, except to the extent that the rules for an element being "recognized as an HTML element" are dependent on HTML version.

For HTML, the definition is

The inline elements are those included in the %inline category of any of the HTML 4.01 DTDs or those elements defined to be phrasing elements in HTML5, as well as the ins and del elements if they are used as inline elements (i.e., if they do not contain element children).

The use of "or" here suggests that we use one set of names or the other, presumably the first set if it's HTML4 and the second set if it's HTML5.

There's no mention here of the element being "recognized as an HTML element".

In practical terms, suppose we have a <mark> element and we're serializing as HTML 4.0. The <mark> element is new in HTML5. Do we treat it as an inline element or not, and is the answer the same for HTML and for XHTML?

I think the solution that will work best for users is to have a single set of element names considered to be inline elements, which is the union of the above categories, and which is used both for HTML and for XHTML, irrespective of version.
Comment 1 Michael Kay 2018-07-16 08:33:19 UTC
Note that there is no harm in treating an element as an inline element even if the spec doesn't classify it as such. The only effect is that the implementation won't add indenting whitespace around such elements, and since there is never a requirement to add whitespace, such behaviour is conformant.