[whatwg] New attributes would degrade better than new elements
ash at ashleysheridan.co.uk
Wed Oct 26 17:11:10 PDT 2011
On Thu, 2011-10-27 at 02:37 +0300, Jukka K. Korpela wrote:
> 27.10.2011 0:57, Ashley Sheridan wrote:
> > If people are using versions of IE that old, then
> > they deserve to have an older version of the "web" given to them.
> That's rather elitistic, given the fact that many people have no way of
> upgrading their IE or switching to your preferred browser, and no need
> to do that apart from some ideas of "HMTL5".
Yes, but then I have to deal with the pain of old versions of IE every
day, so my view is not without cause.
> > Why is adding attributes smoother?
> Browsers recognize the elements.
Browsers also recognise HTML5 elements. Going back to a link that
someone posted earlier http://caniuse.com/html5semantic it's clear to
see that of the 64 browsers listed (including each unique version number
as distinct and grouping both occurances of IE9.0 as 1) then it's clear
to see that the browsers *not* supporting HTML5 (of which there are 5)
are in the minority with regards to all the browsers out there (at least
those tested, which does not include some of the more minor browsers
such as Konqueror, Galeon & Epiphany on desktops and things like
Firefox, Dolphin and Boat for Android, for example)
> > User agents still have to be modified
> > to 'understand' an attribute to make the same semantic sense as a new
> > tag
> What semantic sense? Exactly what do "modern" browsers understand about
> <nav> for example? What are they required to "understand"? Just that
> there's a styleable element. But with <div>, that's something we have
> with all browsers.
It's not just about browsers don't forget, there are other things out
there too that visit websites, such as search engines. Try telling me
Google isn't aware of HTML5 in web pages and I'll laugh. The semantic
value is there also for things like speech and Braille browsers too,
which can use HTML5 to aid navigation, by offering differences in the
way that <nav> elements are presented, and easy navigation between
<section>s and <article>s.
> The difference is between fancy new elements and good old elements with
> new attributes.
> > If you're using an older version of IE then likely it's because you
> > don't know any different
> That's rather elitistic, isn't it?
Not really, it's what I've observed to be true. I'm not saying that if
you're using an old version of IE that you *must* not know about any
different browsers, but that it's more likely that you don't.
> If we could discard all "bad"
> browsers, the world would be nicer, yes, but then we would not really
> have any browsers, would we?
> > Attributes can be semantic, but where do you draw the line?
> In the definition of the attributes. If you can make up a new element
> like <nav>, why can't you make up a new attribute like type=nav?
Because that's how HTML works. You don't just add new attributes to
things that exist already to create a whole new meaning for something.
You advocate using <div> tags with custom attributes, but they weren't
part of the standard until HTML4. Should we have stopped back then and
say "we don't need new tags, let's just add attributes to the ones we
have already"? No, new tags were added to the spec because it was felt
they were needed.
> > Would you really favour using attributes to determing the meaning of a
> > tag, or would you rather that HTML just follows its natural course and
> > attributes be used to supplement a tag from default values?
> Neither attributes nor tag names mean anything by themselves. They get
> their meanings from specifications or from browser practices.
> The question is whether the new "semantic" tags have any useful impact
> (what might it be?). Inventing new tags may sound cooler than defining
> meanings for attributes, but it's just an idle game. Is there _any_
> demonstrable use of, say, the semantics of <nav>? And what's the reason
> why that could not be achieved in the less disruptive way of assigning a
> standardized meaning to, say, the type attribute of <div>?
Because you shouldn't use attributes to determine the meaning of the
content. There's only one such example I can think of where an attribute
totally changes the meaning of a tag, and there were calls for getting
rid of that ambiguity in HTML5. I speak of the <a> tag of course, and
its double nature as both a link and an anchor. All the other HTML tags
are specific and described in their behaviour and meaning for the
content they contain, and use attributes only to enhance, supplement or
subtly alter their basic function. A <p> tag is always used for
paragraphs, an <img> tag is always used for images, <script> is always
used for script, etc. <nav> seems like a perfectly logical choice of tag
to add to the spec, as it's a rare day you ever see a website without a
navigation bar of some sort; it makes sense.
More information about the whatwg