Bug 14364

Summary: Elements with visibility:hidden can still receive "onmouseover" and "onclick" events
Product: WebKit Reporter: Peter Snyder <snyderp>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WORKSFORME    
Severity: Normal CC: falken
Priority: P2    
Version: 419.x   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
testcase none

Description Peter Snyder 2007-06-24 02:11:44 PDT
If I set an element with an "onmouseover" or an "onclick" event, and then set the element to be "visibility:hidden," webkit still triggers those events.  

For example, say I make a button out of a div, and register its onmouseover event to change the cursor to the pointer.  Then I want to hide the button from the user with out affecting the page's layout, so I make the div "hidden."  Webkit would still change the cursor to the pointer when I mouse over the empty spot on the page where the div "used to be" (in the eye of the user).   

As far as I can tell, the CSS specs are silent on what should happen here.  Gecko doesn't seem to trigger events like "onmouseover" or "onclick" on hidden elements, which seems more intuitive and helpful.  Webkit should probably do the same.
Comment 1 Matt Falkenhagen 2013-03-04 23:11:46 PST
Created attachment 191408 [details]
testcase
Comment 2 Matt Falkenhagen 2013-03-04 23:15:18 PST
This issue no longer seems to exist in the latest WebKit. I've attached a testcase and tested on a new Chromium build and Safari 6.0.2. The behavior is the same as Firefox and IE 9: the events are not fired when 'visibility' is 'hidden'.

I also don't see if there is a spec about this but the browsers I tested agree.