W3C home > Mailing lists > Public > www-svg@w3.org > February 2008

Re: pointer-events="none" and an element's children

From: Jonathan Watt <jwatt@jwatt.org>
Date: Thu, 21 Feb 2008 11:42:40 +0100
Message-ID: <47BD55A0.7050601@jwatt.org>
To: www-svg <www-svg@w3.org>

Jeff Schiller wrote:
> Question was raised whether if an element has pointer-events="none"
> and one of its children overrides pointer-events="all", can that child
> recevie the pointer event?

Yes.

> Please sse discussion here
> https://bugzilla.mozilla.org/show_bug.cgi?id=410820#c4
>
> Seems like if the parent element can't receive a pointer event, that
> means its children automatically do not because of the capture phase.
> Can the SVG WG clarify?  Can clarifications be added to the spec?

It's nothing to do with "capture phase", it's to do with CSS inheritance. The
'pointer-events' property is inherited, and therefore if a parent has
pointer-events="none" the children will inherit this value unless they override it.

Note that pointer-events only helps decide if an element is the _target_ of an
event, and therefore which element an event is targeted at. It does not stop
handlers on an element from being triggered if an event has been dispatched to
one of that element's children (because the child overrode pointer-events).

Jonathan
Received on Thursday, 21 February 2008 10:43:02 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:38 GMT