[whatwg] Proposal for a link attribute to replace <a href>

Ernest Cline ernestcline at mindspring.com
Sun Jun 1 20:26:40 PDT 2008



-----Original Message-----
>From: Anne van Kesteren <annevk at opera.com>
>Sent: May 31, 2008 5:02 AM
>To: Ernest Cline <ernestcline at mindspring.com>, WhatWG <whatwg at whatwg.org>
>Subject: Re: [whatwg] Proposal for a link attribute to replace <a href>
>
>On Sat, 31 May 2008 04:20:10 +0200, Ernest Cline  
><ernestcline at mindspring.com> wrote:
>> What about adding a third non-metadata hyperlink element, say <anchor>,  
>> which would be a flow content element with flow content allowed in it?   
>> This would seem to cover the use cases presented, while preserving <a>  
>> as being phrasing content only.  The only issue I see if this were  
>> added, is whether it would be better to have the ismap attribute of  
>> <img> only work with <a> or to have it work with the new element as well.
>
>The <a> element can already do this and it would be backwards compatible.

Backwards compatible with some user agents but not with the specs.  The following fragment has never been valid according to the specs in any of HTML 1.0, 2.0, 3.2, or 4, or the current draft of HTML 5, despite <a>, <h3>, and <p> appearing in all of them.

<a href="foo.html">
 <h3>Heading</h3>
 <p>Text</p>
</a>

The specs have always called for <a> to only have inline content save that for some reason, HTML 2.0 did allow <h1> to <h6> inside <a> though that was not recommended, and that was reverted back to inline only in 3.2.

While changing the specs to match user agent behavior is a possibility, it is not one that should be taken lightly. (Nor should adding a new flow content hyperlink element, be taken lightly either.)



More information about the whatwg mailing list