W3C home > Mailing lists > Public > www-style@w3.org > October 2008

Re: Selectors

From: Brad Kemper <brkemper.comcast@gmail.com>
Date: Thu, 16 Oct 2008 10:18:34 -0700
Cc: Daniel Glazman <daniel.glazman@disruptive-innovations.com>, Anne van Kesteren <annevk@opera.com>, W3C Style List <www-style@w3.org>
Message-Id: <30228617-643C-4BE9-A9D1-D5315758E606@gmail.com>
To: Simon Fraser <smfr@me.com>

Speaking of how DOM events relate to pseudo-classes, is there any  
reason why the BODY tag is able to respond to focus events through  
JavaScript (when the window or frame becomes active and can receive  
keyboard events, for instance), but "body:focus" doesn't work in CSS  
(at least not in my testing).

On Oct 16, 2008, at 8:45 AM, Simon Fraser wrote:

>
> On Oct 16, 2008, at 8:27 am, Daniel Glazman wrote:
>
>> Anne van Kesteren wrote:
>>> On Thu, 16 Oct 2008 15:55:35 +0200, Daniel Glazman <daniel.glazman@disruptive-innovations.com 
>>> > wrote:
>>>>    * Does :hover apply to parent of hovered element if that element
>>>>      is positioned "outside" of its parent?
>>> Seems that :hover should rely on hit testing just like mouse  
>>> events. Not sure why it matters where an element is positioned.
>>
>> That's exactly why it is an issue !
>> Imagine an element having a sub-element positioned outside of its
>> parent. IF :hover works like a mouse event, then it bubbles from the
>> original target to the parent. But the mouse event occured OUTSIDE of
>> the box of the parent, which is not easy to understand from a CSS
>> author's perspective since he/she is not manipulating a mouse event  
>> in
>> a DOM but a pointer hovering some elements in a window...
>
> I think :hover has to always have the same targeting behavior as
> hit testing for mouse events, so that page authors can rely on
> :hover style as a way of communicating to the user that clicking
> on an element will do something (even if the :hover style and
> event handler are on a parent of the hit element). Changing
> this would both break existing pages, and complicate implementations.
>
> Now that we have positioning/transforms etc. that can move elements
> outside the box of their parents, the DOM behavior of propagating
> events up the parent chain seems anachronistic. You could imagine
> an alternative, like sending the event to each element at the hit
> point in z-order. However, such a behavioral change would be a large
> undertaking.
>
> Earlier (<http://lists.w3.org/Archives/Public/www-style/2008Jul/0428.html 
> >)
> we proposed that the SVG pointer-events property be applied to HTML.
> Both Mozilla and WebKit intend to implement this, and it allows
> authors to have some control over hit testing via CSS.
>
> Simon
>
>
Received on Thursday, 16 October 2008 17:19:16 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:15 GMT