Title: [258153] branches/safari-609-branch/Source/WebKit
Revision
258153
Author
[email protected]
Date
2020-03-09 13:02:59 -0700 (Mon, 09 Mar 2020)

Log Message

Cherry-pick r256789. rdar://problem/60183772

    macCatalyst: I-beam is still too aggressive in non-editable content, shows up beyond the end of text
    https://bugs.webkit.org/show_bug.cgi?id=207867
    <rdar://problem/59528927>

    Reviewed by Wenson Hsieh.

    * WebProcess/WebPage/ios/WebPageIOS.mm:
    (WebKit::populateCaretContext):
    Only expand the I-beam region to the end of the line in editable text.
    This better matches the macOS behavior.

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

Modified Paths

Diff

Modified: branches/safari-609-branch/Source/WebKit/ChangeLog (258152 => 258153)


--- branches/safari-609-branch/Source/WebKit/ChangeLog	2020-03-09 19:59:31 UTC (rev 258152)
+++ branches/safari-609-branch/Source/WebKit/ChangeLog	2020-03-09 20:02:59 UTC (rev 258153)
@@ -1,3 +1,34 @@
+2020-03-09  Alan Coon  <[email protected]>
+
+        Cherry-pick r256789. rdar://problem/60183772
+
+    macCatalyst: I-beam is still too aggressive in non-editable content, shows up beyond the end of text
+    https://bugs.webkit.org/show_bug.cgi?id=207867
+    <rdar://problem/59528927>
+    
+    Reviewed by Wenson Hsieh.
+    
+    * WebProcess/WebPage/ios/WebPageIOS.mm:
+    (WebKit::populateCaretContext):
+    Only expand the I-beam region to the end of the line in editable text.
+    This better matches the macOS behavior.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256789 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-02-17  Tim Horton  <[email protected]>
+
+            macCatalyst: I-beam is still too aggressive in non-editable content, shows up beyond the end of text
+            https://bugs.webkit.org/show_bug.cgi?id=207867
+            <rdar://problem/59528927>
+
+            Reviewed by Wenson Hsieh.
+
+            * WebProcess/WebPage/ios/WebPageIOS.mm:
+            (WebKit::populateCaretContext):
+            Only expand the I-beam region to the end of the line in editable text.
+            This better matches the macOS behavior.
+
 2020-02-21  Russell Epstein  <[email protected]>
 
         Apply patch. rdar://problem/59680475

Modified: branches/safari-609-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (258152 => 258153)


--- branches/safari-609-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2020-03-09 19:59:31 UTC (rev 258152)
+++ branches/safari-609-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2020-03-09 20:02:59 UTC (rev 258153)
@@ -2832,8 +2832,11 @@
     auto& blockFlow = downcast<RenderBlockFlow>(*renderer);
     auto position = frame->visiblePositionForPoint(view->rootViewToContents(request.point));
     auto lineRect = position.absoluteSelectionBoundsForLine();
-    lineRect.setWidth(blockFlow.contentWidth());
+    bool isEditable = node->hasEditableStyle();
 
+    if (isEditable)
+        lineRect.setWidth(blockFlow.contentWidth());
+
     info.lineCaretExtent = view->contentsToRootView(lineRect);
     info.caretHeight = info.lineCaretExtent.height();
 
@@ -2846,7 +2849,7 @@
         auto approximateLineRectInContentCoordinates = renderer->absoluteBoundingBoxRect();
         approximateLineRectInContentCoordinates.setHeight(renderer->style().computedLineHeight());
         info.lineCaretExtent = view->contentsToRootView(approximateLineRectInContentCoordinates);
-        if (!info.lineCaretExtent.contains(request.point) || !node->hasEditableStyle())
+        if (!info.lineCaretExtent.contains(request.point) || !isEditable)
             info.lineCaretExtent.setY(request.point.y() - info.lineCaretExtent.height() / 2);
         info.caretHeight = info.lineCaretExtent.height();
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to