Bug 34042 - visibility:hidden iframe captures contextual click.
Summary: visibility:hidden iframe captures contextual click.
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Frames (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh Intel OS X 10.5
: P2 Normal
Assignee: Nobody
Keywords: InRadar
Depends on:
Reported: 2010-01-23 11:41 PST by Derk-Jan Hartman
Modified: 2019-05-04 10:37 PDT (History)
3 users (show)

See Also:

HTML example of the problem. (1.13 KB, text/html)
2010-01-23 11:43 PST, Derk-Jan Hartman
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Derk-Jan Hartman 2010-01-23 11:41:28 PST
I'm attaching a html case with an iframe within an absolute positioned div. The div has visibility:hidden

Try to right click the link on the webpage. You will be presented with the contextual menu for the frame. The contextual menu options for the link are missing. This is annoying when trying to open a link in the new tab or new window, but even more annoying in that all elements behind this invisible iframe cannot be directly inspected with right-clik "Inspect Element". A mid mouse button click does force the opening of the link in a new tab. The problem can be worked around by using "display:none;" instead.

The bug is present in Safari 4 and the latest nightly (6531.21.10, r53765).
Comment 1 Derk-Jan Hartman 2010-01-23 11:43:16 PST
Created attachment 47274 [details]
HTML example of the problem.
Comment 2 Derk-Jan Hartman 2015-06-30 13:24:44 PDT
This problem still exists in Safari 9 seed 1
Comment 3 Alex Bussey 2019-02-06 08:42:30 PST
This is still present in the latest nightly build (r241015 - 2/6/19) and in production.

The use case we have is that we are a video player that sometimes plays ads in iFrames on top (in terms of z-index) the player. In between ad breaks, we put visibility: hidden on the iFrame. In all browsers, except Safari, right-clicking on the player will bring up the proper contextual menu from the player itself. However, in Safari, the event is still passed to the iFrame and the user sees the contextual menu from the iFrame.

We built a page, linked below, that plainly shows the behavior:


In searching Bugzilla, it looks like similar issues were reported back to 2009 (#26649).
Comment 4 Radar WebKit Bug Importer 2019-05-03 19:36:36 PDT