W3C home > Mailing lists > Public > www-style@w3.org > June 2012

Re: Clickable area for hyperlinks

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 14 Jun 2012 10:04:40 -0700
Message-ID: <CAAWBYDD+Q2C2sFhvnbK9EMVp4Cc018=6a2bU-3fyLE5jhTw3Ew@mail.gmail.com>
To: Simon Sapin <simon.sapin@kozea.fr>
Cc: Boris Zbarsky <bzbarsky@mit.edu>, www-style@w3.org
On Thu, Jun 14, 2012 at 9:58 AM, Simon Sapin <simon.sapin@kozea.fr> wrote:
> Le 14/06/2012 18:34, Boris Zbarsky a écrit :
>> That will Just Work due to click events bubbling, no?  As in, the event
>> _target_  in this case will be the image, not the <a>.  But the event
>> will then bubble up to the <a>.
>
> In a browser yes, I guess. For producing PDFs in WeasyPrint I need to find a
> rectangle, though multiple rectangles would work too. (In PDF objects they
> would multiple links that happen to have the same target/href)

In that case, take a rectangle that's as wide as the <a> and as tall
as the <a>'s line-height, then add similar rectangles for the <a>'s
children.  If you can have an irregular shape, just union all of them;
if you need a single rectangle, take the bounding box (though
recognize that this might be bad in some degenerate circumstances).

The "actionable area" is just the element's own geometry, based on its
display type and the relevant properties.   That's well-defined by the
layout mode it's in.  As Boris says, event bubbling handles the case
when children extend outside of the <a>'s geometry.

~TJ
Received on Thursday, 14 June 2012 17:05:36 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:55 GMT