Bug 53993 - [android] Elements from an iframe hidden using overflow:hidden and height:0 are still clickable
Summary: [android] Elements from an iframe hidden using overflow:hidden and height:0 a...
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Frames (show other bugs)
Version: 528+ (Nightly build)
Hardware: Android Android
: P2 Normal
Assignee: Nobody
URL: http://jsfiddle.net/9YcnJ/6/
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-08 04:56 PST by Marek Stepien
Modified: 2012-02-13 14:45 PST (History)
1 user (show)

See Also:


Attachments
testcase (687 bytes, text/html)
2011-02-08 04:56 PST, Marek Stepien
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Stepien 2011-02-08 04:56:49 PST
Created attachment 81621 [details]
testcase

Content from an iframe that is placed inside a div that has height: 0 and overflow: hidden still invoked onclick event handlers after tapping the place which would be occupied by it if it had a non-zero height.

Basically, we have two divs with the same width. Even though the first div has a height of zero and its overflow is hidden, the button's onclick handler will still be invoked if you tap over the text from the second div.:

------
<style>
div {
    border: 1px solid red;
    height: 500px;
    width:  500px;
}

#t1 {
    overflow: hidden;
    height:   0;
}
</style>

<div id="t1">
    <iframe width=500 height=500 src='data:text/html,<button onclick="alert(true)" style="width:500px;height:500px">Are you gonna click this?</button>' ></iframe>
</div>
<div id="t2">Mobile Webkit (at least on Android): Even though you click this div, the click event will be fired by the button from the iframe</div>
------

Run this code at jsfiddle: http://jsfiddle.net/9YcnJ/6/

This only happens on Android WebKit. I can reproduce it on my own Samsung Galaxy i5800 (vendor-provided Android 2.1) and my employer gets a few reports from people using our web app on Samsung Galaxy Tab that it happens to them as well. It does NOT happen on my iPod touch (and we do not have any reports from our uses with iPhones) nor on desktop WebKit-based browsers. 

Sorry, if this is not the best place for reporting Android Webkit bugs. I tried to find a better place for Android Webkit bugs, but couldn't.
Comment 1 Marek Stepien 2011-02-08 05:31:28 PST
FWIW, this is my phone's browser user-agent string:

Mozilla/5.0 (Linux; U; Android 2.1-update1; pl-pl; GT-I5800 Build/ECLAIR) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17(KHTML, like Gecko) Version/4.0 Mobile Safari/530.17
Comment 2 Marek Stepien 2011-02-08 05:33:14 PST
Something got screwed up during pasting. My UA string is:

Mozilla/5.0 (Linux; U; Android 2.1-update1; pl-pl; GT-I5800 Build/ECLAIR) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17
Comment 3 Eric Seidel (no email) 2012-02-13 14:45:47 PST
Android Chromium is the new future.