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

[whatwg] Citing multiple <blockquote> elements in HTML5

From: Benjamin Hawkes-Lewis <bhawkeslewis@googlemail.com>
Date: Tue, 02 Dec 2008 22:47:29 +0000
Message-ID: <4935BB01.9000203@googlemail.com>
Calogero Alex Baldacchino wrote:
> However, now I have a question. The 3rd step of the algorithm to 
> determine "the indicated part of the document" says,
> 
> "If there is an element in the DOM that has an ID exactly equal to 
> /fragid/, then the first such element in tree order is the indicated 
> part of the document; stop the algorithm here."
> 
> Shouldn't the id be unique in the whole document? Section 3.3.3.2 says,
> 
> "The||| id |attribute represents its element's unique identifier. The 
> value must be unique in the subtree within which the element finds 
> itself and must contain at least one character. The value must not 
> contain any space characters."
> 
> then follows,
> 
> "If the value is not the empty string, user agents must associate the 
> element with the given value (exactly, including any space characters) 
> [...]"

I think you're confusing parsing rules that conforming user agents must 
follow to associate identifiers with elements (even when ids are 
duplicated) with the authoring rules that conforming documents must 
follow (ids must be unique). In general, the rules that user agents must 
follow have to deal with non-conforming documents (i.e. the vast 
majority of the web) too. They are generally patterned after the 
(unwritten) rules that existing user agents follow, for backwards 
compatibility reasons. Duplicated id attributes, sadly, are not that rare.

--
Benjamin Hawkes-Lewis
Received on Tuesday, 2 December 2008 14:47:29 UTC

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