W3C home > Mailing lists > Public > public-html@w3.org > January 2009

Re: HTML is a declarative mark-up language

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Fri, 30 Jan 2009 16:32:02 -0500
Message-ID: <498371D2.30004@mit.edu>
To: Robert J Burns <rob@robburns.com>
CC: HTML WG <public-html@w3.org>

Robert J Burns wrote:
> You're honing in on what I was talking about now. There are reasons to 
> have an element that says this is here solely as a anchor destination. A 
> 'span' with an 'id' attribute might be there for some particular CSS 
> hook. However, a phrase wrapped in an "a" with only an 'id' and no 
> 'href' is clearly an anchor destination.

I guess I'm at a bit of a loss to think of a situation where something 
is solely an anchor destination without having any other semantics. 
Anything I can think of linking to directly as part of a document 
(sections, images, lists, tables, <pre> blocks with program code, 
quotations, etc) all have appropriate semantic tags that one would need 
around the thing being linked to anyway...  At that point, it might be 
more clear to put an ID on said semantic tag and use that as the anchor 
destination.

Maybe there are situations I'm just failing to think of here?

> Similarly any id can serve as a anchor destination, but an 'a' element 
> with an 'id' alone is clearly an anchor destination. This is signaled to 
> any other authors of the document in a way that a 'span' element with an 
> 'id' attributes does not signal.

While true, it also leads to this fairly common HTML4 authoring pattern 
(with name replaced by id on the <a>):

   <a id="mytable"></a>
   <table><tr><td>
     This is an important table that people should link to
   </td></tr></table>

both because authors copy/paste from existing HTML (which is informed by 
the HTML 3.2 legacy of not being able to link to IDs) and because the 
spec gives <a> a privileged status as an anchor destination that 
obscures the fact that any element can be an anchor destination if 
that's what you're really meaning to link to.

Note that the above example would break badly if someone happens to 
apply a style that positions the table away from the anchor.  So it's 
not just a matter of semantic purity being violated (thought it most 
certainly is), but of practical consequences that make the document less 
robust than it could be.

> It is dropped from document conformance. The use of an 'a' element with 
> only an 'id' attribute that is also relevant is not supported in the 
> current HTML5 draft (but it has been supported in XHTML1.1, XHTML1, HTML 
> 4.01, so why are we changing it?).

I agree that this is a good question.  It seems to me that while the use 
of such an <a> should be conformant, it should be given no special 
status as an anchor destination, for the above-described reasons.

> However, this WG (or someone) needs to produce a document conformance 
> normative recommendation for a new HTML vocabulary that does make sense 
> and serves as a reference for document authoring.

Agreed.

> Certainly a document conformance normative document 
> would impact on some implementation norms

Sadly also vice versa in some cases...  The meaning of some elements is 
very difficult to describe, much less understand, without reference to 
the processing model...

This doesn't make me happy, by the way, but it's part of the HTML4 
legacy we're working with.

In any case, this is tangential to the specific issue of <a id="..."> 
with no href set.

-Boris
Received on Friday, 30 January 2009 21:32:48 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:28 GMT