[whatwg] href on any element

Andrew Fedoniouk news at terrainformatica.com
Mon Aug 28 22:36:59 PDT 2006

----- Original Message ----- 
From: "Ian Hickson" <ian at hixie.ch>
To: "Anne van Kesteren" <fora at annevankesteren.nl>
Cc: "WHATWG" <whatwg at whatwg.org>
Sent: Monday, August 28, 2006 5:30 PM
Subject: Re: [whatwg] href on any element

> On Mon, 28 Aug 2006, Anne van Kesteren wrote:
>> On Mon, 28 Aug 2006 11:33:43 +0200, Lachlan Hunt 
>> <lachlan.hunt at lachy.id.au>
>> wrote:
>> > > It's arguably a very minor improvement,
>> >
>> > The only benefit I'm aware of is the convenience it provides to authors 
>> > for
>> > hand coding, but that benefit is negligible when you consider the 
>> > abilities
>> > of many authoring tools these days.
>> Another thing that some author seem to want is to make an entire block a 
>> link,
>> including its header and footer. Currently such things are solved with 
>> markup
>> similar to:
>>  <a href="">
>>   <span class="header"></span>
>>   <span class="text"></span>
>>  </a>
> ...or the currently non-conforming:
>   <a href="">
>    <h2>...</h2>
>    <p>...</p>
>   </a>
> We could make it conforming, I guess. The parser already supports it to
> some extent.

Main purpose of  "href on any element" idea I beleive
is to minimize number of elements needed to show the
content. Less elements - more lightweight and better styleable pages.

Just for consistency: the A element can point to any element on the page
so why not any element could do that?

All implementations of Web Applications (sites) already have
situations when you need hyperlink to be a block rather than text
span.  <td href="..."> or <li href="..."> will be pretty popular 

If we will change model of A from
<!ELEMENT A - - (%inline;)* -(A)       -- anchor -->
to something else then it will create implications for parser.
Ideally model of the element should be known upfront and
without need of CSS being loaded first. In this case parser
or DOM builder can create more optimal construction.
So it is better to allow all elements to have href than
to change model of A.

Andrew Fedoniouk.

More information about the whatwg mailing list