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

[whatwg] New attributes would degrade better than new elements

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Thu, 27 Oct 2011 11:30:27 +0300
Message-ID: <4EA916A3.3030101@cs.tut.fi>
27.10.2011 9:55, Ashley Sheridan wrote:

>> There is no _required_ functionality or default rendering for <nav>  or
>> <article>  and no special attributes for them. What you lose by having
>> them as elements rather than attributes is that you cannot style them in
>> a manner that works on all browsers.
 >
> <nav> is a block level element, so behaves as such in conforming browsers.

And if <div type=nav> were used, it would be rendered as a block in 
nonconforming browsers too. (The point about more or less required 
default rendering with display: block is taken as a correction to my 
statement above, but it does not really change my point. Rather, 
strengthens it.)

> What about <strong> and <b>?

Yes, what about them? They have been in HTML since the very beginning. 
If you were to add _new_ markup for emphasis into HTML, I would suggest 
that you don't add a new element, like <key>, but rather an attribute - 
to an element that comes closest in meaning and default rendering, like 
<strong type=key> or <b type=key>.

> Google admits certain aspects of its indexing algorithm, and this is but
> a little part of it. They would be certainly missing a trick if they
> weren't also indexing based on HTML5 tags as well, adding context to a
> page.

There's a lot we can speculate about potential use of the new markup 
elements and remarkably little factual evidence. But surely if Google 
can recognize <nav> and make some use of it, it could deal with <div 
type=nav> as well.

> What is the fear of adding new tags?

Compatibility with older browsers. It should not be broken without due 
cause.

> You don't create a new XML document
> with every tag as <tag> do you?

HTML isn't XML. Or, to the extent that it is XML (serialized as XML), it 
has a specific HTML vocabulary recognized by browsers and other 
HTML-aware software.

> They are backwards compatible in
> that browsers that don't understand them can just ignore them.

That's exactly the point that causes the incompatibility: to a browser 
that does not recognize <nav> at all, your CSS settings for it are 
ignored and it isn't even rendered as a block by default.

> You can
> use other elements within them in a transitional phase of your
> development if you really think you need to.

So in any reasonable use now or some years from now, the new markup that 
was supposed to simplify markup will make markup more lengthy and less 
logical. Instead of
<div class=nav>...</div>
authors would need to use
<nav><div class=nav>...</div></nav>
and they would have to do all the styling and scripting on the div element.

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/
Received on Thursday, 27 October 2011 01:30:27 UTC

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