Changeset 255106 in webkit


Ignore:
Timestamp:
Jan 24, 2020 4:49:05 PM (4 years ago)
Author:
achristensen@apple.com
Message:

Update EditorState from WebProcess when requesting context menu
https://bugs.webkit.org/show_bug.cgi?id=206775
<rdar://problem/56305573>

Reviewed by Wenson Hsieh.

When generating a context menu, AppKit calls -validRequestorForSendType:returnType:
which queries the editor state in WebViewImpl::validRequestorForSendAndReturnTypes.
Without updating the editor state, the first time you right click on a link,
the Services menu item did not appear because we were looking at a stale editor state.
Verified manually this fixes the bug.

  • WebProcess/WebPage/WebContextMenu.cpp:

(WebKit::WebContextMenu::show):

  • WebProcess/WebPage/mac/WebPageMac.mm:

(WebKit::WebPage::handleSelectionServiceClick):

Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r255105 r255106  
     12020-01-24  Alex Christensen  <achristensen@webkit.org>
     2
     3        Update EditorState from WebProcess when requesting context menu
     4        https://bugs.webkit.org/show_bug.cgi?id=206775
     5        <rdar://problem/56305573>
     6
     7        Reviewed by Wenson Hsieh.
     8
     9        When generating a context menu, AppKit calls -validRequestorForSendType:returnType:
     10        which queries the editor state in WebViewImpl::validRequestorForSendAndReturnTypes.
     11        Without updating the editor state, the first time you right click on a link,
     12        the Services menu item did not appear because we were looking at a stale editor state.
     13        Verified manually this fixes the bug.
     14
     15        * WebProcess/WebPage/WebContextMenu.cpp:
     16        (WebKit::WebContextMenu::show):
     17        * WebProcess/WebPage/mac/WebPageMac.mm:
     18        (WebKit::WebPage::handleSelectionServiceClick):
     19
    1202020-01-24  Tim Horton  <timothy_horton@apple.com>
    221
  • trunk/Source/WebKit/WebProcess/WebPage/WebContextMenu.cpp

    r235205 r255106  
    7070    // Mark the WebPage has having a shown context menu then notify the UIProcess.
    7171    m_page->contextMenuShowing();
     72    m_page->flushPendingEditorStateUpdate();
    7273    m_page->send(Messages::WebPageProxy::ShowContextMenu(contextMenuContextData, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
    7374}
  • trunk/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm

    r254878 r255106  
    833833    selectionDataVector.append(reinterpret_cast<const uint8_t*>(selectionData.bytes), selectionData.length);
    834834
     835    flushPendingEditorStateUpdate();
    835836    send(Messages::WebPageProxy::ShowContextMenu(ContextMenuContextData(point, selectionDataVector, phoneNumbers, selection.selection().isContentEditable()), UserData()));
    836837}
Note: See TracChangeset for help on using the changeset viewer.