Re: Proposal for developing HTML 5 materials for Web *authors*

On 21 Nov 2007, at 11:31, Dean Edridge wrote:

> Maciej Stachowiak wrote:
>> On Nov 20, 2007, at 10:21 PM, Karl Dubost wrote:
>>> Some issues arose during the F2F and corridors discussions.
>>> * Shall the syntax style be stricter than the one recommended by  
>>> HTML 5 specification.
>>> example:
>>> <p class=intro>Readable Markup
>>> <p class="intro">Readable Markup</p>
>> It may be a good idea to recommend some style guidelines. However,  
>> I'm not sure this should necessarily be mixed with an intro for  
>> authors. For example, when it comes to quoting attribute values,  
>> HTML coding styles might recommend either always quoting or always  
>> omitting the quotes when possible; which is preferred is largely a  
>> matter of taste.
>> I'd draw the comparison with if statements in C. Some insist on  
>> using braces even around single-line if conditions, like so:
>> if (foo) {
>>    bar();
>> } else {
>>    baz();
>> }
>> Others insist on omitting braces whenever possible:
>> if (foo)
>>    bar();
>> else
>>    baz();
>> As far as I'm concerned, either coding style is valid, so long as a  
>> given code base is consistent. The same goes for quoting attribute  
>> values. It could be argued that skipping unnecessary quotes makes  
>> markup less noisy and therefore easier to read.
>> In ay case, even if an introduction for authors recommends a  
>> particular coding style, it should draw the distinction between  
>> coding style conventions and actual document conformance  
>> requirements, just as Kernighan & Ritchie's famous book does the  
>> equivalent for C.
>> Regards,
>> Maciej
> Why would it be a good idea to encourage people to omit quotes  
> around attribute values, when this method would only be suitable for  
> *one* of the *three* serialisations of (X)HTML5 ?
> application/xhtml+xml (XHTML)
> application/xml (XHTML)
> text/html (HTML)

The serialisations sent over application/xhtml+xml and application/xml  
are wholly identical. There are only two serialisations: custom SGML- 
inspired text/html, and XML.

> Surely it would be better to have just the one method that works  
> with all serialisations and get everyone to use that.
> Otherwise we end up with web tools (WYSIWYG editors and CMSs etc)  
> that only generate markup suitable for text/html.

But there are other differences between HTML and XHTML. xml:lang and  
lang only exist an XML and HTML documents respectively. |meta|@charset  
doesn't exist in XML documents (as it would mean redefining XML's  
character set detection, and would prohibit verbatim XML parsers from  
being used). |noscript| doesn't exist in XML documents (due to it  
needing to have an effect on the parser).

To make conforming HTML documents a (tiny) subset of XML, a great deal  
of documents would become non-conforming HTML 5, requiring them all to  
be rewritten: If we make moving to HTML 5 too big of a change, will  
people bother?

Lastly, there are some differences that make it impossible to make  
conforming HTML document a subset of XML: |blockquote| cannot be  
nested within a |p| for example. The only way to avoid this would be  
to require a third parsing mode incompatible with current HTML UAs in  
HTML5 UAs (which goes against the degrade gracefully principle).

Geoffrey Sneddon

Received on Friday, 23 November 2007 16:10:20 UTC