Title: [260212] branches/safari-610.1.10-branch
Revision
260212
Author
[email protected]
Date
2020-04-16 12:31:13 -0700 (Thu, 16 Apr 2020)

Log Message

Cherry-pick r260193. rdar://problem/61897737

    REGRESSION (r259762): Should always hit test for editable elements if the WKWebView is fully editable
    https://bugs.webkit.org/show_bug.cgi?id=210558
    <rdar://problem/61798347>

    Reviewed by Wenson Hsieh.

    Source/WebKit:

    If the entire WKWebView is marked editable (via SPI -[WKWebView _setEditable]) then
    always ask the web process to hit test the page because every element is considered
    editable.

    * UIProcess/ios/WKContentViewInteraction.mm:
    (-[WKContentView _requestTextInputContextsInRect:completionHandler:]):

    Tools:

    Add a test.

    * TestWebKitAPI/Tests/WebKitCocoa/RequestTextInputContext.mm:
    (TEST):

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

Modified Paths

Diff

Modified: branches/safari-610.1.10-branch/Source/WebKit/ChangeLog (260211 => 260212)


--- branches/safari-610.1.10-branch/Source/WebKit/ChangeLog	2020-04-16 19:31:10 UTC (rev 260211)
+++ branches/safari-610.1.10-branch/Source/WebKit/ChangeLog	2020-04-16 19:31:13 UTC (rev 260212)
@@ -1,5 +1,48 @@
 2020-04-16  Alan Coon  <[email protected]>
 
+        Cherry-pick r260193. rdar://problem/61897737
+
+    REGRESSION (r259762): Should always hit test for editable elements if the WKWebView is fully editable
+    https://bugs.webkit.org/show_bug.cgi?id=210558
+    <rdar://problem/61798347>
+    
+    Reviewed by Wenson Hsieh.
+    
+    Source/WebKit:
+    
+    If the entire WKWebView is marked editable (via SPI -[WKWebView _setEditable]) then
+    always ask the web process to hit test the page because every element is considered
+    editable.
+    
+    * UIProcess/ios/WKContentViewInteraction.mm:
+    (-[WKContentView _requestTextInputContextsInRect:completionHandler:]):
+    
+    Tools:
+    
+    Add a test.
+    
+    * TestWebKitAPI/Tests/WebKitCocoa/RequestTextInputContext.mm:
+    (TEST):
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-04-16  Daniel Bates  <[email protected]>
+
+            REGRESSION (r259762): Should always hit test for editable elements if the WKWebView is fully editable
+            https://bugs.webkit.org/show_bug.cgi?id=210558
+            <rdar://problem/61798347>
+
+            Reviewed by Wenson Hsieh.
+
+            If the entire WKWebView is marked editable (via SPI -[WKWebView _setEditable]) then
+            always ask the web process to hit test the page because every element is considered
+            editable.
+
+            * UIProcess/ios/WKContentViewInteraction.mm:
+            (-[WKContentView _requestTextInputContextsInRect:completionHandler:]):
+
+2020-04-16  Alan Coon  <[email protected]>
+
         Cherry-pick r260192. rdar://problem/61897737
 
     Move -_requestTextInputContextsInRect to WKContentView to simplify implementation

Modified: branches/safari-610.1.10-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (260211 => 260212)


--- branches/safari-610.1.10-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2020-04-16 19:31:10 UTC (rev 260211)
+++ branches/safari-610.1.10-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2020-04-16 19:31:13 UTC (rev 260212)
@@ -5081,7 +5081,7 @@
 - (void)_requestTextInputContextsInRect:(CGRect)rect completionHandler:(void(^)(NSArray<_WKTextInputContext *> *))completionHandler
 {
 #if ENABLE(EDITABLE_REGION)
-    if (!WebKit::mayContainEditableElementsInRect(self, rect)) {
+    if (!self.webView._editable && !WebKit::mayContainEditableElementsInRect(self, rect)) {
         completionHandler(@[ ]);
         return;
     }

Modified: branches/safari-610.1.10-branch/Tools/ChangeLog (260211 => 260212)


--- branches/safari-610.1.10-branch/Tools/ChangeLog	2020-04-16 19:31:10 UTC (rev 260211)
+++ branches/safari-610.1.10-branch/Tools/ChangeLog	2020-04-16 19:31:13 UTC (rev 260212)
@@ -1,5 +1,46 @@
 2020-04-16  Alan Coon  <[email protected]>
 
+        Cherry-pick r260193. rdar://problem/61897737
+
+    REGRESSION (r259762): Should always hit test for editable elements if the WKWebView is fully editable
+    https://bugs.webkit.org/show_bug.cgi?id=210558
+    <rdar://problem/61798347>
+    
+    Reviewed by Wenson Hsieh.
+    
+    Source/WebKit:
+    
+    If the entire WKWebView is marked editable (via SPI -[WKWebView _setEditable]) then
+    always ask the web process to hit test the page because every element is considered
+    editable.
+    
+    * UIProcess/ios/WKContentViewInteraction.mm:
+    (-[WKContentView _requestTextInputContextsInRect:completionHandler:]):
+    
+    Tools:
+    
+    Add a test.
+    
+    * TestWebKitAPI/Tests/WebKitCocoa/RequestTextInputContext.mm:
+    (TEST):
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-04-16  Daniel Bates  <[email protected]>
+
+            REGRESSION (r259762): Should always hit test for editable elements if the WKWebView is fully editable
+            https://bugs.webkit.org/show_bug.cgi?id=210558
+            <rdar://problem/61798347>
+
+            Reviewed by Wenson Hsieh.
+
+            Add a test.
+
+            * TestWebKitAPI/Tests/WebKitCocoa/RequestTextInputContext.mm:
+            (TEST):
+
+2020-04-16  Alan Coon  <[email protected]>
+
         Cherry-pick r260192. rdar://problem/61897737
 
     Move -_requestTextInputContextsInRect to WKContentView to simplify implementation

Modified: branches/safari-610.1.10-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/RequestTextInputContext.mm (260211 => 260212)


--- branches/safari-610.1.10-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/RequestTextInputContext.mm	2020-04-16 19:31:10 UTC (rev 260211)
+++ branches/safari-610.1.10-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/RequestTextInputContext.mm	2020-04-16 19:31:13 UTC (rev 260212)
@@ -185,6 +185,15 @@
     EXPECT_EQ(CGRectMake(0, 200, 100, 100), contexts[0].boundingRect);
 }
 
+TEST(RequestTextInputContext, ViewIsEditable)
+{
+    auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
+    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
+    [webView synchronouslyLoadHTMLString:applyStyle(@"<body></body>")];
+    [webView _setEditable:YES];
+    EXPECT_GE([webView synchronouslyRequestTextInputContextsInRect:[webView bounds]].count, 1UL);
+}
+
 static CGRect squareCenteredAtPoint(float x, float y, float length)
 {
     return CGRectMake(x - length / 2, y - length / 2, length, length);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to