W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2008

[whatwg] Citing multiple <blockquote> elements in HTML5

From: Jonas Sicking <jonas@sicking.cc>
Date: Wed, 3 Dec 2008 11:39:09 -0800
Message-ID: <63df84f0812031139t10aac92fs670247b9a6a39d1@mail.gmail.com>
> Otherwise, just let the id attribute be unique in the whole document, label
> any duplicate one as illegal and treat it as the empty string, so that one
> only method is enough and the DOM 3 undefined behaviour for 'getElementById'
> is no more problematic, being fired by non-allowed DOM structures (as don't
> care conditions). Such would be the easiest choice, although there might be
> any good reason to prefer allowing replicated ids inside the same document.

Note that having multiple IDs is quite common on real-world pages.
Especially ones that actively modify the DOM since often subtrees
containing nodes with IDs are cloned and reinserted. So if we do this
I expect quite a few pages to break.

In firefox we now always return the first element with the requested
ID. I think IE does the same. This seems equally reliably and much
less likely to cause page breakage or interoperability issues.

As for CSS, I believe in firefox we make all elements with a given ID
match the #foo selector. I don't have a strong feeling if this is the
correct thing to do, or just make the first one match. The only
concern I have is performance.

/ Jonas
Received on Wednesday, 3 December 2008 11:39:09 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:46 UTC