Title: [256789] trunk/Source/WebKit
Revision
256789
Author
timothy_hor...@apple.com
Date
2020-02-17 16:43:50 -0800 (Mon, 17 Feb 2020)

Log Message

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.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (256788 => 256789)


--- trunk/Source/WebKit/ChangeLog	2020-02-18 00:26:51 UTC (rev 256788)
+++ trunk/Source/WebKit/ChangeLog	2020-02-18 00:43:50 UTC (rev 256789)
@@ -1,3 +1,16 @@
+2020-02-17  Tim Horton  <timothy_hor...@apple.com>
+
+        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-17  Youenn Fablet  <you...@apple.com>
 
         Fix regression in NSURLSessionWebSocketTask WSS support

Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (256788 => 256789)


--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2020-02-18 00:26:51 UTC (rev 256788)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2020-02-18 00:43:50 UTC (rev 256789)
@@ -2829,8 +2829,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();
 
@@ -2843,7 +2846,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
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to