⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 245195 in webkit


Ignore:
Timestamp:
May 10, 2019, 1:52:32 PM (7 years ago)
Author:
Megan Gardner
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):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r245189 r245195  
     12019-05-10  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Returning incorrect marked text rects
     4        https://bugs.webkit.org/show_bug.cgi?id=197758
     5        <rdar://problem/46548586>
     6
     7        Reviewed by Tim Horton.
     8
     9        We are not returning marked text rects in the correct view coordinate space.
     10        This is the same translation we are applying to the caret rects.
     11
     12        * WebProcess/WebPage/ios/WebPageIOS.mm:
     13        (WebKit::WebPage::platformEditorState const):
     14
    1152019-05-10  Wenson Hsieh  <wenson_hsieh@apple.com>
    216
  • trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

    r245079 r245195  
    194194void WebPage::platformEditorState(Frame& frame, EditorState& result, IncludePostLayoutDataHint shouldIncludePostLayoutData) const
    195195{
     196    FrameView* view = frame.view();
    196197    if (frame.editor().hasComposition()) {
    197198        RefPtr<Range> compositionRange = frame.editor().compositionRange();
     
    200201            compositionRange->collectSelectionRects(compositionRects);
    201202            if (compositionRects.size())
    202                 result.firstMarkedRect = compositionRects[0].rect();
     203                result.firstMarkedRect = view->contentsToRootView(compositionRects[0].rect());
    203204            if (compositionRects.size() > 1)
    204                 result.lastMarkedRect = compositionRects.last().rect();
     205                result.lastMarkedRect = view->contentsToRootView(compositionRects.last().rect());
    205206            else
    206207                result.lastMarkedRect = result.firstMarkedRect;
     
    224225
    225226    auto& postLayoutData = result.postLayoutData();
    226     FrameView* view = frame.view();
     227   
    227228    const VisibleSelection& selection = frame.selection().selection();
    228229    postLayoutData.isStableStateUpdate = m_isInStableState;
Note: See TracChangeset for help on using the changeset viewer.