Changeset 205983 in webkit


Ignore:
Timestamp:
Sep 15, 2016 10:58:01 AM (8 years ago)
Author:
Beth Dakin
Message:

dictionaryPopupInfoForRange() can change selection temporarily; updates should not
be sent to the UIProcess.
https://bugs.webkit.org/show_bug.cgi?id=162008
-and corresponding-
rdar://problem/28312297

Reviewed by Tim Horton.

This patch prevents the selection changes that occur while gathering
dictionaryPopupInfo from being propagated to the UIProcess.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::didChangeSelection):

  • WebProcess/WebPage/WebPage.h:
  • WebProcess/WebPage/mac/WebPageMac.mm:

(WebKit::WebPage::dictionaryPopupInfoForRange):

Location:
trunk/Source/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r205938 r205983  
     12016-09-14  Beth Dakin  <bdakin@apple.com>
     2
     3        dictionaryPopupInfoForRange() can change selection temporarily; updates should not
     4        be sent to the UIProcess.
     5        https://bugs.webkit.org/show_bug.cgi?id=162008
     6        -and corresponding-
     7        rdar://problem/28312297
     8
     9        Reviewed by Tim Horton.
     10
     11        This patch prevents the selection changes that occur while gathering
     12        dictionaryPopupInfo from being propagated to the UIProcess.
     13        * WebProcess/WebPage/WebPage.cpp:
     14        (WebKit::WebPage::didChangeSelection):
     15        * WebProcess/WebPage/WebPage.h:
     16        * WebProcess/WebPage/mac/WebPageMac.mm:
     17        (WebKit::WebPage::dictionaryPopupInfoForRange):
     18
    1192016-09-14  Wenson Hsieh  <wenson_hsieh@apple.com>
    220
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r205935 r205983  
    48374837void WebPage::didChangeSelection()
    48384838{
     4839    // The act of getting Dictionary Popup info can make selection changes that we should not propagate to the UIProcess.
     4840    // Specifically, if there is a caret selection, it will change to a range selection of the word around the caret. And
     4841    // then it will change back.
     4842    if (m_isGettingDictionaryPopupInfo)
     4843        return;
     4844
    48394845    Frame& frame = m_page->focusController().focusedOrMainFrame();
    48404846    FrameView* view = frame.view();
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h

    r205934 r205983  
    14881488    bool m_shouldDispatchFakeMouseMoveEvents;
    14891489    bool m_isEditorStateMissingPostLayoutData { false };
     1490    bool m_isGettingDictionaryPopupInfo { false };
    14901491
    14911492    enum class EditorStateIsContentEditable { No, Yes, Unset };
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm

    r205765 r205983  
    8989#import <WebCore/htmlediting.h>
    9090#import <WebKitSystemInterface.h>
     91#import <wtf/TemporaryChange.h>
    9192
    9293#if ENABLE(WIRELESS_PLAYBACK_TARGET)
     
    418419DictionaryPopupInfo WebPage::dictionaryPopupInfoForRange(Frame* frame, Range& range, NSDictionary **options, TextIndicatorPresentationTransition presentationTransition)
    419420{
     421    TemporaryChange<bool> isGettingDictionaryPopupInfoChange { m_isGettingDictionaryPopupInfo, true };
     422
    420423    DictionaryPopupInfo dictionaryPopupInfo;
    421424    if (range.text().stripWhiteSpace().isEmpty())
Note: See TracChangeset for help on using the changeset viewer.