Title: [245195] trunk/Source/WebKit
Revision
245195
Author
[email protected]
Date
2019-05-10 13:52:32 -0700 (Fri, 10 May 2019)

Log Message

Returning incorrect marked text rects
https://bugs.webkit.org/show_bug.cgi?id=197758
<rdar://problem/46548586>

Reviewed by Tim Horton.

We are not returning marked text rects in the correct view coordinate space.
This is the same translation we are applying to the caret rects.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformEditorState const):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (245194 => 245195)


--- trunk/Source/WebKit/ChangeLog	2019-05-10 20:49:35 UTC (rev 245194)
+++ trunk/Source/WebKit/ChangeLog	2019-05-10 20:52:32 UTC (rev 245195)
@@ -1,3 +1,17 @@
+2019-05-10  Megan Gardner  <[email protected]>
+
+        Returning incorrect marked text rects
+        https://bugs.webkit.org/show_bug.cgi?id=197758
+        <rdar://problem/46548586>
+
+        Reviewed by Tim Horton.
+
+        We are not returning marked text rects in the correct view coordinate space.
+        This is the same translation we are applying to the caret rects. 
+
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::platformEditorState const):
+
 2019-05-10  Wenson Hsieh  <[email protected]>
 
         Let WebKit clients supply an application name for user agent in modern compatibility mode

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


--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2019-05-10 20:49:35 UTC (rev 245194)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2019-05-10 20:52:32 UTC (rev 245195)
@@ -193,6 +193,7 @@
 
 void WebPage::platformEditorState(Frame& frame, EditorState& result, IncludePostLayoutDataHint shouldIncludePostLayoutData) const
 {
+    FrameView* view = frame.view();
     if (frame.editor().hasComposition()) {
         RefPtr<Range> compositionRange = frame.editor().compositionRange();
         Vector<WebCore::SelectionRect> compositionRects;
@@ -199,9 +200,9 @@
         if (compositionRange) {
             compositionRange->collectSelectionRects(compositionRects);
             if (compositionRects.size())
-                result.firstMarkedRect = compositionRects[0].rect();
+                result.firstMarkedRect = view->contentsToRootView(compositionRects[0].rect());
             if (compositionRects.size() > 1)
-                result.lastMarkedRect = compositionRects.last().rect();
+                result.lastMarkedRect = view->contentsToRootView(compositionRects.last().rect());
             else
                 result.lastMarkedRect = result.firstMarkedRect;
             result.markedText = plainTextReplacingNoBreakSpace(compositionRange.get());
@@ -223,7 +224,7 @@
     }
 
     auto& postLayoutData = result.postLayoutData();
-    FrameView* view = frame.view();
+    
     const VisibleSelection& selection = frame.selection().selection();
     postLayoutData.isStableStateUpdate = m_isInStableState;
     bool startNodeIsInsideFixedPosition = false;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to