Title: [207748] branches/safari-602-branch

Diff

Modified: branches/safari-602-branch/LayoutTests/ChangeLog (207747 => 207748)


--- branches/safari-602-branch/LayoutTests/ChangeLog	2016-10-24 07:18:47 UTC (rev 207747)
+++ branches/safari-602-branch/LayoutTests/ChangeLog	2016-10-24 07:18:51 UTC (rev 207748)
@@ -1,5 +1,22 @@
 2016-10-20  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r207486. rdar://problem/28409742
+
+    2016-10-18  Ryosuke Niwa  <rn...@webkit.org>
+
+            REGRESSION (r201471): Keyboard remains visible when swiping back on twitter.com
+            https://bugs.webkit.org/show_bug.cgi?id=163581
+            <rdar://problem/27739558>
+
+            Reviewed by Simon Fraser.
+
+            Added a regression test for hiding a keyboard when the focused element is removed from the DOM.
+
+            * fast/forms/ios/hide-keyboard-on-node-removal-expected.txt: Added.
+            * fast/forms/ios/hide-keyboard-on-node-removal.html: Added.
+
+2016-10-20  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r207275. rdar://problem/28810752
 
     2016-10-12  Zalan Bujtas  <za...@apple.com>

Added: branches/safari-602-branch/LayoutTests/fast/forms/ios/hide-keyboard-on-node-removal-expected.txt (0 => 207748)


--- branches/safari-602-branch/LayoutTests/fast/forms/ios/hide-keyboard-on-node-removal-expected.txt	                        (rev 0)
+++ branches/safari-602-branch/LayoutTests/fast/forms/ios/hide-keyboard-on-node-removal-expected.txt	2016-10-24 07:18:51 UTC (rev 207748)
@@ -0,0 +1,4 @@
+Test that the keyboard disappears when the focused element is removed.
+To manually test, focus the text field below and type any character on iOS. The keyboard should be dismissed.
+
+PASS

Added: branches/safari-602-branch/LayoutTests/fast/forms/ios/hide-keyboard-on-node-removal.html (0 => 207748)


--- branches/safari-602-branch/LayoutTests/fast/forms/ios/hide-keyboard-on-node-removal.html	                        (rev 0)
+++ branches/safari-602-branch/LayoutTests/fast/forms/ios/hide-keyboard-on-node-removal.html	2016-10-24 07:18:51 UTC (rev 207748)
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta name="viewport" content="width=device-width">
+</head>
+<body>
+<p>Test that the keyboard disappears when the focused element is removed.<br>
+To manually test, focus the text field below and type any character on iOS. The keyboard should be dismissed.</p>
+<input _oninput_="this.remove();">
+<div id="result"></div>
+<script>
+
+if (window.testRunner)
+    testRunner.dumpAsText();
+
+if (window.testRunner && testRunner.runUIScript) {
+    testRunner.waitUntilDone();
+
+    var input = document.querySelector('input');
+
+    const x = input.offsetLeft + 5;
+    const y = input.offsetTop + 5;
+    testRunner.runUIScript(`
+        uiController.didShowKeyboardCallback = function() { uiController.uiScriptComplete(); }
+        uiController.singleTapAtPoint(${x}, ${y}, function() {});`,
+    function () {
+        function endTest(result) {
+            document.getElementById('result').textContent = result;
+            testRunner.notifyDone();
+        }
+        setTimeout(endTest.bind(this, 'FAIL'), 5000);
+        testRunner.runUIScript(`
+            uiController.didHideKeyboardCallback = function() { uiController.uiScriptComplete(); }
+            uiController.typeCharacterUsingHardwareKeyboard('a', function () { });`,
+            endTest.bind(this, 'PASS'));
+    });
+}
+
+</script>
+</body>
+</html>

Modified: branches/safari-602-branch/Source/WebCore/ChangeLog (207747 => 207748)


--- branches/safari-602-branch/Source/WebCore/ChangeLog	2016-10-24 07:18:47 UTC (rev 207747)
+++ branches/safari-602-branch/Source/WebCore/ChangeLog	2016-10-24 07:18:51 UTC (rev 207748)
@@ -1,5 +1,28 @@
 2016-10-20  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r207486. rdar://problem/28409742
+
+    2016-10-18  Ryosuke Niwa  <rn...@webkit.org>
+
+            REGRESSION (r201471): Keyboard remains visible when swiping back on twitter.com
+            https://bugs.webkit.org/show_bug.cgi?id=163581
+            <rdar://problem/27739558>
+
+            Reviewed by Simon Fraser.
+
+            The bug was caused by Chrome::elementDidBlur not getting called, which resulted in
+            StopAssistingNode not getting sent to the UI process.
+
+            Test: fast/forms/ios/hide-keyboard-on-node-removal.html
+
+            * dom/Document.cpp:
+            (WebCore::Document::setFocusedElement): Restore the behavior prior to r201471 by calling
+            Chrome::elementDidBlur explicitly.
+            * html/HTMLTextFormControlElement.cpp:
+            (WebCore::HTMLTextFormControlElement::dispatchBlurEvent): Added a comment about ordering.
+
+2016-10-20  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r207275. rdar://problem/28810752
 
     2016-10-12  Zalan Bujtas  <za...@apple.com>

Modified: branches/safari-602-branch/Source/WebCore/dom/Document.cpp (207747 => 207748)


--- branches/safari-602-branch/Source/WebCore/dom/Document.cpp	2016-10-24 07:18:47 UTC (rev 207747)
+++ branches/safari-602-branch/Source/WebCore/dom/Document.cpp	2016-10-24 07:18:51 UTC (rev 207748)
@@ -3831,8 +3831,11 @@
                 newFocusedElement = nullptr;
             }
         } else {
+            // Match the order in HTMLTextFormControlElement::dispatchBlurEvent.
             if (is<HTMLInputElement>(*oldFocusedElement))
                 downcast<HTMLInputElement>(*oldFocusedElement).endEditing();
+            if (page())
+                page()->chrome().client().elementDidBlur(oldFocusedElement.get());
             ASSERT(!m_focusedElement);
         }
 

Modified: branches/safari-602-branch/Source/WebCore/html/HTMLTextFormControlElement.cpp (207747 => 207748)


--- branches/safari-602-branch/Source/WebCore/html/HTMLTextFormControlElement.cpp	2016-10-24 07:18:47 UTC (rev 207747)
+++ branches/safari-602-branch/Source/WebCore/html/HTMLTextFormControlElement.cpp	2016-10-24 07:18:51 UTC (rev 207748)
@@ -100,6 +100,7 @@
 {
     if (supportsPlaceholder())
         updatePlaceholderVisibility();
+    // Match the order in Document::setFocusedElement.
     handleBlurEvent();
     HTMLFormControlElementWithState::dispatchBlurEvent(WTFMove(newFocusedElement));
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to