Bug 14364 - Elements with visibility:hidden can still receive "onmouseover" and "onclick" events
Summary: Elements with visibility:hidden can still receive "onmouseover" and "onclick"...
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 419.x
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-24 02:11 PDT by Peter Snyder
Modified: 2013-03-04 23:15 PST (History)
1 user (show)

See Also:


Attachments
testcase (837 bytes, text/html)
2013-03-04 23:11 PST, Matt Falkenhagen
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.