REGRESSION (r243606): Interacting with date and time pickers hangs the UI process...
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 17 Nov 2019 04:04:15 +0000 (04:04 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 17 Nov 2019 04:04:15 +0000 (04:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=204280
<rdar://problem/49718359>

Reviewed by Chris Dumez.

Source/WebKit:

After r243606, interacting with date and time inputs on watchOS hangs the UI process indefinitely while
attempting to create an input peripheral (WKFormInputControl) for the date or time picker. This is because, in
the process of setting up a new WKDateTimePicker, we call into +[UIKeyboard defaultSizeForInterfaceOrientation:]
which hangs when attempting to fetch the current UIKit keyboard layout type.

To address this, we simply avoid setting _inputPeripheral on watchOS, as we did prior to r243606. Covered by the
existing layout test fast/forms/watchos/time-picker-value-change.html, which currently times out.

* UIProcess/ios/WKContentViewInteraction.mm:
(createInputPeripheralWithView):

LayoutTests:

Clean up a few details in the layout test.

* fast/forms/watchos/time-picker-value-change-expected.txt:
* fast/forms/watchos/time-picker-value-change.html:

Tweak the test description, and simplify logic for completing the layout test.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@252529 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/forms/watchos/time-picker-value-change-expected.txt
LayoutTests/fast/forms/watchos/time-picker-value-change.html
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

index 5dd28d1..48382c1 100644 (file)
@@ -1,3 +1,18 @@
+2019-11-16  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        REGRESSION (r243606): Interacting with date and time pickers hangs the UI process on watchOS
+        https://bugs.webkit.org/show_bug.cgi?id=204280
+        <rdar://problem/49718359>
+
+        Reviewed by Chris Dumez.
+
+        Clean up a few details in the layout test.
+
+        * fast/forms/watchos/time-picker-value-change-expected.txt:
+        * fast/forms/watchos/time-picker-value-change.html:
+
+        Tweak the test description, and simplify logic for completing the layout test.
+
 2019-11-16  Philippe Normand  <pnormand@igalia.com>
 
         Unreviewed, rolling out r252526.
index abc14cd..b7c67d4 100644 (file)
@@ -1,3 +1,10 @@
+This test verifies that the time picker is presented and can be used to choose a time. To manually run the test, tap the time input to show the time picker, and then select '9:41 am'.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Handled change event
+PASS Handled blur event
 PASS time.value is '09:41'
 PASS successfullyParsed is true
 
index 3ffe4e9..831b860 100644 (file)
@@ -5,34 +5,27 @@
 <script src="../../../resources/js-test.js"></script>
 <script src="../../../resources/ui-helper.js"></script>
 <script>
-doneCount = 0;
 jsTestIsAsync = true;
 
 async function runTest() {
-    if (!window.testRunner) {
-        description(`This test requires WebKitTestRunner.`);
-        return;
-    }
+    description(`This test verifies that the time picker is presented and can be used to choose a time. To manually run the test, tap the time input to show the time picker, and then select '9:41 am'.`);
 
     time = document.querySelector("input");
-    time.addEventListener("change", checkDone);
-    time.addEventListener("blur", checkDone);
-
-    await UIHelper.activateAndWaitForInputSessionAt(75, 75);
-    UIHelper.waitForKeyboardToHide().then(checkDone)
-    UIHelper.setTimePickerValue(9, 41);
-}
+    time.addEventListener("change", () => testPassed("Handled change event"));
+    time.addEventListener("blur", () => testPassed("Handled blur event"));
 
-function checkDone() {
-    if (++doneCount < 3)
+    if (!window.testRunner)
         return;
 
+    await UIHelper.activateElementAndWaitForInputSession(time);
+    await UIHelper.setTimePickerValue(9, 41);
+    await UIHelper.waitForKeyboardToHide();
     shouldBe("time.value", "'09:41'");
     finishJSTest();
 }
 </script>
 </head>
 <body onload="runTest()">
-<input type="time" value="04:01" style="width: 320px; height: 568px;"></input>
+<input type="time" value="04:01" style="width: 320px; height: 100px;"></input>
 </body>
 </html>
index e5eba30..db8b9e7 100644 (file)
@@ -1,5 +1,24 @@
 2019-11-16  Wenson Hsieh  <wenson_hsieh@apple.com>
 
+        REGRESSION (r243606): Interacting with date and time pickers hangs the UI process on watchOS
+        https://bugs.webkit.org/show_bug.cgi?id=204280
+        <rdar://problem/49718359>
+
+        Reviewed by Chris Dumez.
+
+        After r243606, interacting with date and time inputs on watchOS hangs the UI process indefinitely while
+        attempting to create an input peripheral (WKFormInputControl) for the date or time picker. This is because, in
+        the process of setting up a new WKDateTimePicker, we call into +[UIKeyboard defaultSizeForInterfaceOrientation:]
+        which hangs when attempting to fetch the current UIKit keyboard layout type.
+
+        To address this, we simply avoid setting _inputPeripheral on watchOS, as we did prior to r243606. Covered by the
+        existing layout test fast/forms/watchos/time-picker-value-change.html, which currently times out.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (createInputPeripheralWithView):
+
+2019-11-16  Wenson Hsieh  <wenson_hsieh@apple.com>
+
         [iOS] [UIWKDocumentContext] Add the ability to request all marked text rects
         https://bugs.webkit.org/show_bug.cgi?id=204278
         <rdar://problem/56527803>
index 3129595..4f306f5 100644 (file)
@@ -5463,16 +5463,22 @@ static WebCore::FloatRect rectToRevealWhenZoomingToFocusedElement(const WebKit::
 
 static RetainPtr<NSObject <WKFormPeripheral>> createInputPeripheralWithView(WebKit::InputType type, WKContentView *view)
 {
+#if PLATFORM(WATCHOS)
+    UNUSED_PARAM(type);
+    UNUSED_PARAM(view);
+    return nil;
+#else
     switch (type) {
     case WebKit::InputType::Select:
         return adoptNS([[WKFormSelectControl alloc] initWithView:view]);
 #if ENABLE(INPUT_TYPE_COLOR)
     case WebKit::InputType::Color:
         return adoptNS([[WKFormColorControl alloc] initWithView:view]);
-#endif
+#endif // ENABLE(INPUT_TYPE_COLOR)
     default:
         return adoptNS([[WKFormInputControl alloc] initWithView:view]);
     }
+#endif
 }
 
 - (void)_elementDidFocus:(const WebKit::FocusedElementInformation&)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode activityStateChanges:(OptionSet<WebCore::ActivityState::Flag>)activityStateChanges userObject:(NSObject <NSSecureCoding> *)userObject