W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2011

[whatwg] Empty elements

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Sun, 28 Aug 2011 20:45:50 +0300
Message-ID: <4E5A7ECE.2050906@cs.tut.fi>
28.8.2011 17:52, Aryeh Gregor wrote:

> "Void" is correct:
>
> http://www.whatwg.org/specs/web-apps/current-work/multipage/syntax.html#void-elements

I see. What a pointless and confusing change (from HTML tradition and 
SGML usage). "Empty" is descriptive (an element that has no content, or 
has empty content), whereas "void" suggests associations like "null and 
void" or "void pointer". This is about elements that are very real and 
meaningful, instead of being "void" in any normal meaning - they just 
express everything they can express by their name and attributes

>> The interesting question is: Where do the normative rules say that
>> self-closing syntax must not be used for other than empty elements?
>
> http://www.whatwg.org/specs/web-apps/current-work/multipage/syntax.html#start-tags

OK, that's rather clear, I just didn't find it - I was looking for 
something more prominent.

> Documents served with a text/html MIME type must obey the HTML syntax
> rules, not XHTML.  I couldn't find where the spec says this
> normatively, but there's an informative note at the top of the HTML
> syntax and XHTML syntax sections.

So does this mean that the rules are, after all, different for HTML 
serialization than for XHTML serialization?

> If you're serving a document with an XML MIME type,<foo></foo>  is
> equivalent to <foo />  for any value of foo.  The validator won't
> distinguish and neither will UAs, so use whichever you please.
> They're entirely different with an HTML MIME type, and that cannot be
> changed at this point due to compatibility.

Is there any way to tell validator.nu or the W3C Validator in HTML5 mode 
to apply XHTML rules when submitting a document via a text field or via 
file upload? Is there any requirement on such a distinction?

When validating via URL, the W3C Validator (in HTML5 mode) indeed 
accepts <p /> when Content-Type: application/xhtml+xml. However, 
validator.nu responds:
     IO Error: Non-HTML Content-Type: application/xhtml+xml.

This is getting rather confusing...

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/
Received on Sunday, 28 August 2011 10:45:50 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:35 UTC