Title: [206013] branches/safari-602-branch/Source/WebKit2

Diff

Modified: branches/safari-602-branch/Source/WebKit2/ChangeLog (206012 => 206013)


--- branches/safari-602-branch/Source/WebKit2/ChangeLog	2016-09-16 07:56:07 UTC (rev 206012)
+++ branches/safari-602-branch/Source/WebKit2/ChangeLog	2016-09-16 07:56:12 UTC (rev 206013)
@@ -1,3 +1,25 @@
+2016-09-16  Babak Shafiei  <bshaf...@apple.com>
+
+        Merge r205983. rdar://problem/28312297
+
+    2016-09-14  Beth Dakin  <bda...@apple.com>
+
+            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):
+
 2016-09-14  Babak Shafiei  <bshaf...@apple.com>
 
         Merge r205938. rdar://problem/28227805

Modified: branches/safari-602-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (206012 => 206013)


--- branches/safari-602-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2016-09-16 07:56:07 UTC (rev 206012)
+++ branches/safari-602-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2016-09-16 07:56:12 UTC (rev 206013)
@@ -4803,6 +4803,12 @@
 
 void WebPage::didChangeSelection()
 {
+    // The act of getting Dictionary Popup info can make selection changes that we should not propagate to the UIProcess.
+    // Specifically, if there is a caret selection, it will change to a range selection of the word around the caret. And
+    // then it will change back.
+    if (m_isGettingDictionaryPopupInfo)
+        return;
+
     Frame& frame = m_page->focusController().focusedOrMainFrame();
     FrameView* view = frame.view();
 

Modified: branches/safari-602-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h (206012 => 206013)


--- branches/safari-602-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h	2016-09-16 07:56:07 UTC (rev 206012)
+++ branches/safari-602-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h	2016-09-16 07:56:12 UTC (rev 206013)
@@ -1472,6 +1472,7 @@
     bool m_mainFrameProgressCompleted;
     bool m_shouldDispatchFakeMouseMoveEvents;
     bool m_isEditorStateMissingPostLayoutData { false };
+    bool m_isGettingDictionaryPopupInfo { false };
 
     enum class EditorStateIsContentEditable { No, Yes, Unset };
     mutable EditorStateIsContentEditable m_lastEditorStateWasContentEditable { EditorStateIsContentEditable::Unset };

Modified: branches/safari-602-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (206012 => 206013)


--- branches/safari-602-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm	2016-09-16 07:56:07 UTC (rev 206012)
+++ branches/safari-602-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm	2016-09-16 07:56:12 UTC (rev 206013)
@@ -87,6 +87,7 @@
 #import <WebCore/WindowsKeyboardCodes.h>
 #import <WebCore/htmlediting.h>
 #import <WebKitSystemInterface.h>
+#import <wtf/TemporaryChange.h>
 
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
 #include <WebCore/MediaPlaybackTargetMac.h>
@@ -416,6 +417,8 @@
 
 DictionaryPopupInfo WebPage::dictionaryPopupInfoForRange(Frame* frame, Range& range, NSDictionary **options, TextIndicatorPresentationTransition presentationTransition)
 {
+    TemporaryChange<bool> isGettingDictionaryPopupInfoChange { m_isGettingDictionaryPopupInfo, true };
+
     DictionaryPopupInfo dictionaryPopupInfo;
     if (range.text().stripWhiteSpace().isEmpty())
         return dictionaryPopupInfo;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to