Title: [227710] trunk
Revision
227710
Author
[email protected]
Date
2018-01-26 18:13:48 -0800 (Fri, 26 Jan 2018)

Log Message

Don't retain focus for input peripheral views
https://bugs.webkit.org/show_bug.cgi?id=182204

Reviewed by Tim Horton.

Source/WebKit:

Retaining focus on input peripheral views makes it so they cannot dismiss themselves with
the current architecture. This should probably be fixed in UIKit, as there is no reason for
focus to be retained on these views anyways, as they don't have keyboard input, but this
guards against over-aggressive retain requests.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _restoreFocusWithToken:]):
(-[WKContentView _preserveFocusWithToken:destructively:]):

LayoutTests:

Fixed a spelling error while fixing a bug this test caught.

* fast/forms/ios/ipad/unfocus-inside-fixed-hittest.html:
* fast/forms/ios/ipad/unfocus-inside-fixed-hittest-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (227709 => 227710)


--- trunk/LayoutTests/ChangeLog	2018-01-27 01:49:11 UTC (rev 227709)
+++ trunk/LayoutTests/ChangeLog	2018-01-27 02:13:48 UTC (rev 227710)
@@ -1,3 +1,15 @@
+2018-01-26  Megan Gardner  <[email protected]>
+
+        Don't retain focus for input peripheral views
+        https://bugs.webkit.org/show_bug.cgi?id=182204
+
+        Reviewed by Tim Horton.
+
+        Fixed a spelling error while fixing a bug this test caught.
+
+        * fast/forms/ios/ipad/unfocus-inside-fixed-hittest.html:
+        * fast/forms/ios/ipad/unfocus-inside-fixed-hittest-expected.txt:
+
 2018-01-26  Youenn Fablet  <[email protected]>
 
         Layout Test imported/w3c/web-platform-tests/service-workers/service-worker/appcache-ordering-main.https.html is flaky

Modified: trunk/LayoutTests/fast/forms/ios/ipad/unfocus-inside-fixed-hittest-expected.txt (227709 => 227710)


--- trunk/LayoutTests/fast/forms/ios/ipad/unfocus-inside-fixed-hittest-expected.txt	2018-01-27 01:49:11 UTC (rev 227709)
+++ trunk/LayoutTests/fast/forms/ios/ipad/unfocus-inside-fixed-hittest-expected.txt	2018-01-27 02:13:48 UTC (rev 227710)
@@ -2,4 +2,4 @@
 
 Click Me
 June
-PASS: hit testing found #target after select interation
+PASS: hit testing found #target after select interaction

Modified: trunk/LayoutTests/fast/forms/ios/ipad/unfocus-inside-fixed-hittest.html (227709 => 227710)


--- trunk/LayoutTests/fast/forms/ios/ipad/unfocus-inside-fixed-hittest.html	2018-01-27 01:49:11 UTC (rev 227709)
+++ trunk/LayoutTests/fast/forms/ios/ipad/unfocus-inside-fixed-hittest.html	2018-01-27 02:13:48 UTC (rev 227710)
@@ -76,7 +76,7 @@
         var clicked = false;
         function buttonClicked()
         {
-            document.getElementById('result').textContent = 'PASS: hit testing found #target after select interation';
+            document.getElementById('result').textContent = 'PASS: hit testing found #target after select interaction';
             if (window.testRunner)
                 testRunner.notifyDone();
         }

Modified: trunk/Source/WebKit/ChangeLog (227709 => 227710)


--- trunk/Source/WebKit/ChangeLog	2018-01-27 01:49:11 UTC (rev 227709)
+++ trunk/Source/WebKit/ChangeLog	2018-01-27 02:13:48 UTC (rev 227710)
@@ -1,3 +1,19 @@
+2018-01-26  Megan Gardner  <[email protected]>
+
+        Don't retain focus for input peripheral views
+        https://bugs.webkit.org/show_bug.cgi?id=182204
+
+        Reviewed by Tim Horton.
+
+        Retaining focus on input peripheral views makes it so they cannot dismiss themselves with
+        the current architecture. This should probably be fixed in UIKit, as there is no reason for
+        focus to be retained on these views anyways, as they don't have keyboard input, but this
+        guards against over-aggressive retain requests.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _restoreFocusWithToken:]):
+        (-[WKContentView _preserveFocusWithToken:destructively:]):
+
 2018-01-26  Chris Dumez  <[email protected]>
 
         Make sure service worker code does not launch a StorageProcess unnecessarily

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (227709 => 227710)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2018-01-27 01:49:11 UTC (rev 227709)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2018-01-27 02:13:48 UTC (rev 227710)
@@ -4169,12 +4169,14 @@
 
 - (void)_restoreFocusWithToken:(id <NSCopying, NSSecureCoding>)token
 {
-    --_webView->_activeFocusedStateRetainCount;
+    if (!_inputPeripheral)
+        --_webView->_activeFocusedStateRetainCount;
 }
 
 - (void)_preserveFocusWithToken:(id <NSCopying, NSSecureCoding>)token destructively:(BOOL)destructively
 {
-    ++_webView->_activeFocusedStateRetainCount;
+    if (!_inputPeripheral)
+        ++_webView->_activeFocusedStateRetainCount;
 }
 
 #pragma mark - Implementation of UIWebTouchEventsGestureRecognizerDelegate.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to