W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2007

[whatwg] Attributes vs. Elements

From: Nicholas Shanks <contact@nickshanks.com>
Date: Mon, 12 Mar 2007 20:59:55 +0000
Message-ID: <1CACA4DA-6FF9-4FAC-8327-6E4E3B97C129@nickshanks.com>
On 12 Mar 2007, at 20:19, Andrew Fedoniouk wrote:

> Case:
> <td ><a href="1.htm">xyz</a></td>
> <td ><a href="2.htm">xyz-xyz-xyz</a></td>
> is perfectly valid from some abstract semantic machine
> point of view but for human these two cells are not
> equal. At least hit area is different. And visual perception too.

All you need to do is add this to your CSS:

td > a:link { display: block; }

and the whole cell content area will become clickable (i.e. the area  
interior to the padding. don't use padding on the cell if you want to  
run the clickable area up to the cell's border)

> Even now you can use get/setAttribute methods to get/set 'href'
> attribute to any element.  So where do you see the problem?

But that doesn't make any of them clickable, because they are not  
anchor heads.

> I do not really understand this too:
> "browser implementations have an implementation class per element"

Most HTML implementations use a class hierarchy whereby each HTML  
element is represented by a distinct subclass of some abstract base  
element representation. To move href onto every element would require  
moving the hyperlink functionality into that base class rather than  
having it in the anchor subclass.

For some browsers this could be quite easy, for others it would be  
deceptively difficult.

- Nicholas.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2157 bytes
Desc: not available
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20070312/a4a7530b/attachment.bin>
Received on Monday, 12 March 2007 13:59:55 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:53 UTC