Fragment Identifiers for HTML5

Hi,

(see also <http://www.w3.org/Bugs/Public/show_bug.cgi?id=5744>).

I'm a bit concerned about both how we treated the bugzilla bug above, 
and what the spec currently says.

Contrary to what Ian claimed in the bug, HTML5 *does* define the 
fragment identifier syntax for text/html:

"The the indicated part of the document is the one that the fragment 
identifier, if any, identifies. The semantics of the fragment identifier 
in terms of mapping it to a specific DOM Node is defined by the MIME 
type specification of the document's MIME Type (for example, the 
processing of fragment identifiers for XML MIME types is the 
responsibility of RFC3023).

For HTML documents (and the text/html MIME type), the following 
processing model must be followed to determine what the indicated part 
of the document is.

    1. Let fragid be the <fragment> part of the URI. [RFC3987]
    2. If fragid is the empty string, then the indicated part of the 
document is the top of the document.
    3. 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.
    4. If there is an a element in the DOM that has a name attribute 
whose value is exactly equal to fragid, then the first such element in 
tree order is the indicated part of the document; stop the algorithm here.
    5. Otherwise, there is no indicated part of the document." -- 
<http://www.w3.org/TR/html5/history.html#the-indicated>

So that part essentially updates Section 3 of RFC 2854 
(<http://tools.ietf.org/html/rfc2854#section-3>).

Furthermore, HTML5 currently points to RFC3023 for fragment identifier 
semantics; the trouble is, that one doesn't define it at all:

    As of today, no established specifications define identifiers for XML
    media types.  However, a working draft published by W3C, namely "XML
    Pointer Language (XPointer)", attempts to define fragment identifiers
    for text/xml and application/xml.  The current specification for
    XPointer is available at http://www.w3.org/TR/xptr. -- 
<http://tools.ietf.org/html/rfc3023#section-5>

What it should reference is RFC 3236.

Also, the fragment identifier syntax currently is incompatible between 
text/html and application/xhtml+xml, shouldn't we fix that?

Finally, as a general comment: fragment identifier syntax is an integral 
part of a document format specification. Hiding the fragid semantics in 
a section that defines navigation behavior seems to be the wrong 
approach to me.

BR, Julian

Received on Saturday, 21 June 2008 14:12:47 UTC