Bug 150079 - <select> menu on iPad causes shifting of hit-testing areas
Summary: <select> menu on iPad causes shifting of hit-testing areas
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: Safari 9
Hardware: iPhone / iPad iOS 9.3
: P2 Normal
Assignee: Simon Fraser (smfr)
URL: http://output.jsbin.com/jinuda/1
Keywords: InRadar
Depends on:
Blocks: 159753
  Show dependency treegraph
Reported: 2015-10-12 19:01 PDT by Chris Rebert
Modified: 2016-08-22 11:04 PDT (History)
4 users (show)

See Also:

Screenshot #1 (2.23 MB, image/png)
2015-10-12 19:01 PDT, Chris Rebert
no flags Details
Screenshot #2 (2.32 MB, image/png)
2015-10-12 19:02 PDT, Chris Rebert
no flags Details
Video of the bug being reproduced (1.44 MB, video/mp4)
2015-10-12 19:03 PDT, Chris Rebert
no flags Details
Patch (27.64 KB, patch)
2016-08-22 10:56 PDT, Simon Fraser (smfr)
thorton: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Rebert 2015-10-12 19:01:43 PDT
Created attachment 262961 [details]
Screenshot #1

Original Bootstrap bug: https://github.com/twbs/bootstrap/issues/14975
This bug has also been reproduced on iOS 9.1 in the iPad Simulator.

Steps to reproduce:
(See the video attachment for proof)
1. Open http://output.jsbin.com/jinuda/1 in Safari on iPad Air 2 running iOS 9.0
2. Scroll to the bottom of the page
3. Tap the green button
4. Observe that a dialog appears (see 1st screenshot)
5. Tap the blue button to confirm that hit-testing of the button is working correctly.
6. Observe that an alert() box appears
7. Dismiss the alert() box
8. Tap the "Open this list" <select> menu
9. Observe that the dialog moves upward a bit (see 2nd screenshot)
10. Choose an option from the <select> menu so as to close the menu
11. Observe that the modal moves downward, back to its original position as in the 1st screenshot
12. Tap on the "Ut enim" text in the dialog.

Expected results:
Nothing should happen.

Actual results:
An alert() box is showing, indicating that the blue button was somehow clicked.
It seems as if, for hit-testing purposes, the dialog didn't get moved back downward again in step 11.
Also, if you tap on the blue button, the dialog closes as if you had tapped outside of the dialog.
Comment 1 Chris Rebert 2015-10-12 19:02:34 PDT
Created attachment 262962 [details]
Screenshot #2
Comment 2 Chris Rebert 2015-10-12 19:03:57 PDT
Created attachment 262965 [details]
Video of the bug being reproduced
Comment 3 Chris Rebert 2015-10-12 19:05:25 PDT
The video can also be viewed at:
Comment 4 Radar WebKit Bug Importer 2015-10-12 19:07:52 PDT
Comment 5 Simon Fraser (smfr) 2016-08-05 17:20:16 PDT
When you focus the list, we change the layout rect used for position:fixed elements. When it's unfocused, we don't undo that correctly.
Comment 6 Simon Fraser (smfr) 2016-08-05 17:29:01 PDT
Easy fix.
Comment 7 Simon Fraser (smfr) 2016-08-22 10:56:12 PDT
Created attachment 286608 [details]
Comment 8 Tim Horton 2016-08-22 11:01:04 PDT
Comment on attachment 286608 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=286608&action=review

> LayoutTests/fast/forms/ios/ipad/unfocus-inside-fixed-hittest.html:37
> +        function getSingleTapUIScript(x, y)

Don't love the 'get' prefixes.
Comment 9 Simon Fraser (smfr) 2016-08-22 11:04:24 PDT