Title: [217566] trunk/Source/WebKit2
Revision
217566
Author
[email protected]
Date
2017-05-30 12:57:18 -0700 (Tue, 30 May 2017)

Log Message

Dictionary lookup disappears after a few seconds on observer.com
https://bugs.webkit.org/show_bug.cgi?id=172725
<rdar://problem/32328324>

Reviewed by Beth Dakin.

Only dismiss content-relative child windows on main frame loads,
not all subframes. This was causing e.g. dictionary popovers
relative to main-frame content to be dismissed when subframe
ads finished loading, which is likely the cause of most incidents
of this problem.

If the popover is relative to subframe content and the subframe
navigates out from under the popover, the popover will persist until
dismissed by the user (or one of the other automatic dismissal
mechanisms), but that seems preferable to the old behavior.

* UIProcess/Cocoa/WebViewImpl.h:
Remove an unimplemented and unused declaration.

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::processDidExit):
Move dismissContentRelativeChildWindows call here from WebPageProxy.

* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::resetStateAfterProcessExited):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::didCommitLoadForMainFrame):
(WebKit::PageClientImpl::navigationGestureDidBegin):
(WebKit::PageClientImpl::dismissContentRelativeChildWindows):
Remove dismissContentRelativeChildWindows from PageClient(Impl),
call it from inside PageClientImpl and other Mac-specific places
instead of inside ifdefs in WebPageProxy.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (217565 => 217566)


--- trunk/Source/WebKit2/ChangeLog	2017-05-30 19:51:23 UTC (rev 217565)
+++ trunk/Source/WebKit2/ChangeLog	2017-05-30 19:57:18 UTC (rev 217566)
@@ -1,3 +1,42 @@
+2017-05-30  Tim Horton  <[email protected]>
+
+        Dictionary lookup disappears after a few seconds on observer.com
+        https://bugs.webkit.org/show_bug.cgi?id=172725
+        <rdar://problem/32328324>
+
+        Reviewed by Beth Dakin.
+
+        Only dismiss content-relative child windows on main frame loads,
+        not all subframes. This was causing e.g. dictionary popovers
+        relative to main-frame content to be dismissed when subframe
+        ads finished loading, which is likely the cause of most incidents
+        of this problem.
+
+        If the popover is relative to subframe content and the subframe
+        navigates out from under the popover, the popover will persist until
+        dismissed by the user (or one of the other automatic dismissal
+        mechanisms), but that seems preferable to the old behavior.
+
+        * UIProcess/Cocoa/WebViewImpl.h:
+        Remove an unimplemented and unused declaration.
+
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        (WebKit::WebViewImpl::processDidExit):
+        Move dismissContentRelativeChildWindows call here from WebPageProxy.
+
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::didCommitLoadForFrame):
+        (WebKit::WebPageProxy::resetStateAfterProcessExited):
+        * UIProcess/mac/PageClientImpl.h:
+        * UIProcess/mac/PageClientImpl.mm:
+        (WebKit::PageClientImpl::didCommitLoadForMainFrame):
+        (WebKit::PageClientImpl::navigationGestureDidBegin):
+        (WebKit::PageClientImpl::dismissContentRelativeChildWindows):
+        Remove dismissContentRelativeChildWindows from PageClient(Impl),
+        call it from inside PageClientImpl and other Mac-specific places
+        instead of inside ifdefs in WebPageProxy.
+
 2017-05-30  Konstantin Tokarev  <[email protected]>
 
         Don't use designated initializers in WebBackForwardListProxy.cpp

Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h (217565 => 217566)


--- trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h	2017-05-30 19:51:23 UTC (rev 217565)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h	2017-05-30 19:57:18 UTC (rev 217566)
@@ -332,7 +332,6 @@
     void setTextIndicator(WebCore::TextIndicator&, WebCore::TextIndicatorWindowLifetime = WebCore::TextIndicatorWindowLifetime::Permanent);
     void clearTextIndicatorWithAnimation(WebCore::TextIndicatorWindowDismissalAnimation);
     void setTextIndicatorAnimationProgress(float);
-    void dismissContentRelativeChildWindows();
     void dismissContentRelativeChildWindowsFromViewOnly();
     void dismissContentRelativeChildWindowsWithAnimation(bool);
     void dismissContentRelativeChildWindowsWithAnimationFromViewOnly(bool);

Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm (217565 => 217566)


--- trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm	2017-05-30 19:51:23 UTC (rev 217565)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm	2017-05-30 19:57:18 UTC (rev 217566)
@@ -1348,6 +1348,8 @@
 
 void WebViewImpl::processDidExit()
 {
+    dismissContentRelativeChildWindowsWithAnimation(true);
+
     notifyInputContextAboutDiscardedComposition();
 
     if (m_layerHostingView)

Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (217565 => 217566)


--- trunk/Source/WebKit2/UIProcess/PageClient.h	2017-05-30 19:51:23 UTC (rev 217565)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h	2017-05-30 19:57:18 UTC (rev 217566)
@@ -243,7 +243,6 @@
     virtual void pluginFocusOrWindowFocusChanged(uint64_t pluginComplexTextInputIdentifier, bool pluginHasFocusAndWindowHasFocus) = 0;
     virtual void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, PluginComplexTextInputState) = 0;
     virtual void didPerformDictionaryLookup(const WebCore::DictionaryPopupInfo&) = 0;
-    virtual void dismissContentRelativeChildWindows(bool withAnimation = true) = 0;
     virtual void showCorrectionPanel(WebCore::AlternativeTextType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings) = 0;
     virtual void dismissCorrectionPanel(WebCore::ReasonForDismissingAlternativeText) = 0;
     virtual String dismissCorrectionPanelSoon(WebCore::ReasonForDismissingAlternativeText) = 0;

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (217565 => 217566)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2017-05-30 19:51:23 UTC (rev 217565)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2017-05-30 19:57:18 UTC (rev 217566)
@@ -3338,7 +3338,6 @@
     // FIXME (bug 59111): didCommitLoadForFrame comes too late when restoring a page from b/f cache, making us disable secure event mode in password fields.
     // FIXME: A load going on in one frame shouldn't affect text editing in other frames on the page.
     m_pageClient.resetSecureInputState();
-    m_pageClient.dismissContentRelativeChildWindows();
 #endif
 
     clearLoadDependentCallbacks();
@@ -5518,10 +5517,6 @@
     m_touchEventQueue.clear();
 #endif
 
-#if PLATFORM(MAC)
-    m_pageClient.dismissContentRelativeChildWindows();
-#endif
-
     PageLoadState::Transaction transaction = m_pageLoadState.transaction();
     m_pageLoadState.reset(transaction);
 

Modified: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h (217565 => 217566)


--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h	2017-05-30 19:51:23 UTC (rev 217565)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h	2017-05-30 19:57:18 UTC (rev 217566)
@@ -157,7 +157,6 @@
     void setShouldSuppressFirstResponderChanges(bool shouldSuppress) override { m_shouldSuppressFirstResponderChanges = shouldSuppress; }
 
     void didPerformDictionaryLookup(const WebCore::DictionaryPopupInfo&) override;
-    void dismissContentRelativeChildWindows(bool withAnimation = true) override;
 
     void showCorrectionPanel(WebCore::AlternativeTextType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings) override;
     void dismissCorrectionPanel(WebCore::ReasonForDismissingAlternativeText) override;

Modified: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm (217565 => 217566)


--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm	2017-05-30 19:51:23 UTC (rev 217565)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm	2017-05-30 19:57:18 UTC (rev 217566)
@@ -265,6 +265,7 @@
 void PageClientImpl::didCommitLoadForMainFrame(const String& mimeType, bool useCustomContentProvider)
 {
     m_impl->updateSupportsArbitraryLayoutModes();
+    m_impl->dismissContentRelativeChildWindowsWithAnimation(true);
 }
 
 void PageClientImpl::didFinishLoadingDataForCustomContentProvider(const String& suggestedFilename, const IPC::DataReference& dataReference)
@@ -546,11 +547,6 @@
     });
 }
 
-void PageClientImpl::dismissContentRelativeChildWindows(bool withAnimation)
-{
-    m_impl->dismissContentRelativeChildWindowsWithAnimation(withAnimation);
-}
-
 void PageClientImpl::showCorrectionPanel(AlternativeTextType type, const FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings)
 {
 #if USE(AUTOCORRECTION_PANEL)
@@ -698,7 +694,7 @@
 
 void PageClientImpl::navigationGestureDidBegin()
 {
-    dismissContentRelativeChildWindows();
+    m_impl->dismissContentRelativeChildWindowsWithAnimation(true);
 
 #if WK_API_ENABLED
     if (m_webView)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to