[whatwg] New attributes would degrade better than new elements

Jukka K. Korpela jkorpela at cs.tut.fi
Thu Oct 27 01:30:27 PDT 2011


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/



More information about the whatwg mailing list