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

Re: Selectors

From: Simon Fraser <smfr@me.com>
Date: Thu, 16 Oct 2008 12:26:39 -0700
Cc: David Hyatt <hyatt@apple.com>, Anne van Kesteren <annevk@opera.com>, "www-style@w3.org" <www-style@w3.org>
Message-id: <347710ED-9002-4F2F-8E25-85683E0ADE51@me.com>
To: Daniel Glazman <daniel.glazman@disruptive-innovations.com>

On Oct 16, 2008, at 12:20 PM, Daniel Glazman wrote:

> David Hyatt wrote:
>> In WebKit, :hover is hierarchical (and effectively DOM-based).  We  
>> determine what element is hit, and then that element and all  
>> ancestors up the DOM tree are considered to be in :hover.  The same  
>> is true for :active.  It doesn't matter if the ancestor doesn't  
>> happen to spatially contain the child (and why should it...  
>> consider wanting to highlight a hierarchical menu when you're  
>> browsing around in a popped up submenu).
>> I honestly do not think we (Apple) can change this behavior.  It's  
>> fundamental to WebKit apps on OS X that our :hover/:active work  
>> this way and has been for years.
>
> Test case attached... Make the pointer hover over the rightmost
> block and see the other one become yellow too. Not surprising
> if you have some DOM knowledge, extremely surprising if you take
> a look at the name of our pseudo-class "hover".
>
> </Daniel>
>
> <hovertest.xhtml>

And with click handlers:




Click the right box. The left box's handler also fires. So :hover is  
faithfully reporting "what would be hit".

Simon



Received on Thursday, 16 October 2008 19:27:20 GMT

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