Re: [whatwg] Empty elements

2011-08-28 Thread Aryeh Gregor
On Sun, Aug 28, 2011 at 12:26 AM, Jukka K. Korpela jkorp...@cs.tut.fi wrote:
 The word void, though used even in the validator's message, is at least
 misleading if not incorrect. The correct word is empty.

Void is correct:

http://www.whatwg.org/specs/web-apps/current-work/multipage/syntax.html#void-elements

 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

 The XHTML serialization rules say, at
 http://www.whatwg.org/specs/web-apps/current-work/multipage/the-xhtml-syntax.html#the-xhtml-syntax
 as follows:

Those are relevant only to documents served with an XML MIME type.
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.

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.


Re: [whatwg] Empty elements

2011-08-28 Thread Jukka K. Korpela

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/