Title: [275216] trunk
- Revision
- 275216
- Author
- [email protected]
- Date
- 2021-03-30 11:32:20 -0700 (Tue, 30 Mar 2021)
Log Message
[iOS] Two taps required to view <select> options on Square Checkout
https://bugs.webkit.org/show_bug.cgi?id=223933
<rdar://problem/74828029>
Reviewed by Wenson Hsieh.
Source/WebKit:
Some sites, such as Square Checkout, wrap all the <option>s in a
<select> element in a single <optgroup>. With the new context menu
appearance for <select> on iOS, this means that users have to tap twice
to view the options on some sites (once to bring up the menu and once
to expand the grouped menu).
To fix, promote the the contents of the grouped submenu to the root menu
if all the options are contained within a single submenu.
Test: fast/forms/ios/form-control-refresh/select/all-options-in-single-optgroup.html
* UIProcess/ios/forms/WKFormSelectPicker.mm:
(-[WKSelectPicker createMenu]):
LayoutTests:
Added a layout test to exercise the new codepath when a <select>
has a single <optgroup> containing all of the <option>s.
* fast/forms/ios/form-control-refresh/select/all-options-in-single-optgroup-expected.txt: Added.
* fast/forms/ios/form-control-refresh/select/all-options-in-single-optgroup.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (275215 => 275216)
--- trunk/LayoutTests/ChangeLog 2021-03-30 18:14:26 UTC (rev 275215)
+++ trunk/LayoutTests/ChangeLog 2021-03-30 18:32:20 UTC (rev 275216)
@@ -1,3 +1,17 @@
+2021-03-30 Aditya Keerthi <[email protected]>
+
+ [iOS] Two taps required to view <select> options on Square Checkout
+ https://bugs.webkit.org/show_bug.cgi?id=223933
+ <rdar://problem/74828029>
+
+ Reviewed by Wenson Hsieh.
+
+ Added a layout test to exercise the new codepath when a <select>
+ has a single <optgroup> containing all of the <option>s.
+
+ * fast/forms/ios/form-control-refresh/select/all-options-in-single-optgroup-expected.txt: Added.
+ * fast/forms/ios/form-control-refresh/select/all-options-in-single-optgroup.html: Added.
+
2021-03-30 Antti Koivisto <[email protected]>
[LFC][Integration] Elements that overflow inline-blocks are not hit tested correctly
Added: trunk/LayoutTests/fast/forms/ios/form-control-refresh/select/all-options-in-single-optgroup-expected.txt (0 => 275216)
--- trunk/LayoutTests/fast/forms/ios/form-control-refresh/select/all-options-in-single-optgroup-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/forms/ios/form-control-refresh/select/all-options-in-single-optgroup-expected.txt 2021-03-30 18:32:20 UTC (rev 275216)
@@ -0,0 +1,12 @@
+This test verifies that selecting an option when all options are in a single optgroup works as expected.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS select.value is "January"
+PASS select.value is "April"
+PASS select.value is "October"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/forms/ios/form-control-refresh/select/all-options-in-single-optgroup.html (0 => 275216)
--- trunk/LayoutTests/fast/forms/ios/form-control-refresh/select/all-options-in-single-optgroup.html (rev 0)
+++ trunk/LayoutTests/fast/forms/ios/form-control-refresh/select/all-options-in-single-optgroup.html 2021-03-30 18:32:20 UTC (rev 275216)
@@ -0,0 +1,48 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true IOSFormControlRefreshEnabled=true ] -->
+<html>
+ <head>
+ <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
+ <script src=""
+ <script src=""
+ </head>
+<body>
+<select id="select">
+ <optgroup>
+ <option>January</option>
+ <option>February</option>
+ <option>March</option>
+ <option>April</option>
+ <option>May</option>
+ <option>June</option>
+ <option>July</option>
+ <option>August</option>
+ <option>September</option>
+ <option>October</option>
+ <option>November</option>
+ <option>December</option>
+ </optgroup>
+</select>
+</body>
+<script>
+jsTestIsAsync = true;
+
+addEventListener("load", async () => {
+ description("This test verifies that selecting an option when all options are in a single optgroup works as expected.");
+
+ shouldBeEqualToString("select.value", "January");
+ await UIHelper.activateElement(select);
+ await UIHelper.waitForContextMenuToShow();
+ await UIHelper.selectFormAccessoryPickerRow(3);
+ await UIHelper.waitForContextMenuToHide();
+ shouldBeEqualToString("select.value", "April");
+
+ await UIHelper.activateElement(select);
+ await UIHelper.waitForContextMenuToShow();
+ await UIHelper.selectFormAccessoryPickerRow(9);
+ await UIHelper.waitForContextMenuToHide();
+ shouldBeEqualToString("select.value", "October");
+
+ finishJSTest();
+});
+</script>
+</html>
Modified: trunk/Source/WebKit/ChangeLog (275215 => 275216)
--- trunk/Source/WebKit/ChangeLog 2021-03-30 18:14:26 UTC (rev 275215)
+++ trunk/Source/WebKit/ChangeLog 2021-03-30 18:32:20 UTC (rev 275216)
@@ -1,3 +1,25 @@
+2021-03-30 Aditya Keerthi <[email protected]>
+
+ [iOS] Two taps required to view <select> options on Square Checkout
+ https://bugs.webkit.org/show_bug.cgi?id=223933
+ <rdar://problem/74828029>
+
+ Reviewed by Wenson Hsieh.
+
+ Some sites, such as Square Checkout, wrap all the <option>s in a
+ <select> element in a single <optgroup>. With the new context menu
+ appearance for <select> on iOS, this means that users have to tap twice
+ to view the options on some sites (once to bring up the menu and once
+ to expand the grouped menu).
+
+ To fix, promote the the contents of the grouped submenu to the root menu
+ if all the options are contained within a single submenu.
+
+ Test: fast/forms/ios/form-control-refresh/select/all-options-in-single-optgroup.html
+
+ * UIProcess/ios/forms/WKFormSelectPicker.mm:
+ (-[WKSelectPicker createMenu]):
+
2021-03-29 Simon Fraser <[email protected]>
Allow non-60fps display updates to be driven by DisplayRefreshMonitor
Modified: trunk/Source/WebKit/UIProcess/ios/forms/WKFormSelectPicker.mm (275215 => 275216)
--- trunk/Source/WebKit/UIProcess/ios/forms/WKFormSelectPicker.mm 2021-03-30 18:14:26 UTC (rev 275215)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKFormSelectPicker.mm 2021-03-30 18:32:20 UTC (rev 275216)
@@ -583,6 +583,12 @@
currentIndex++;
}
+ // Some sites, such as Square Checkout, wrap all the element's <option>s in
+ // an a single <optgroup>. In this case, promote the grouped submenu to the
+ // root menu, avoiding the need for an additional tap to view the options.
+ if (items.count == 1 && [[items firstObject] isKindOfClass:UIMenu.class])
+ return [items firstObject];
+
return [UIMenu menuWithTitle:@"" children:items];
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes