Title: [244648] trunk/Source/WebKit
- Revision
- 244648
- Author
- [email protected]
- Date
- 2019-04-25 09:58:09 -0700 (Thu, 25 Apr 2019)
Log Message
[GTK] Back/forward gesture snapshot always times out
https://bugs.webkit.org/show_bug.cgi?id=197233
Patch by Alexander Mikhaylenko <[email protected]> on 2019-04-25
Reviewed by Michael Catanzaro.
Delaying web process launch caused a regression where we create ViewGestureController when the
web process doesn't yet exist. The controller immediately tries to connect to it and fails,
and because of that never receives DidHitRenderTreeSizeThreshold() message, so navigation
snapshot always stays until timeout after performing the gesture.
To prevent this, create the controller in webkitWebViewBaseDidRelaunchWebProcess() instead of
webkitWebViewBaseCreateWebPage(). Additionally, since settings are now created earlier than
ViewGestureController, store the value of whether swipe gesture is enabled in WebKitWebViewBase
and immediately apply it when creating the controller.
* UIProcess/API/glib/WebKitWebView.cpp:
(enableBackForwardNavigationGesturesChanged):
Move the logic into webkitWebViewBaseSetEnableBackForwardNavigationGesture().
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseSetEnableBackForwardNavigationGesture): Added. In addition to what was in
WebKitWebViewBase::enableBackForwardNavigationGesturesChanged(), store the value in a field
for the case ViewGestureController doesn't exist yet.
(webkitWebViewBaseCreateWebPage): Stop creating ViewGestureController.
(webkitWebViewBaseDidRelaunchWebProcess): Move creating ViewGestureController here. Also
immediately call setSwipeGestureEnabled() with the stored value.
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (244647 => 244648)
--- trunk/Source/WebKit/ChangeLog 2019-04-25 16:48:39 UTC (rev 244647)
+++ trunk/Source/WebKit/ChangeLog 2019-04-25 16:58:09 UTC (rev 244648)
@@ -1,3 +1,32 @@
+2019-04-25 Alexander Mikhaylenko <[email protected]>
+
+ [GTK] Back/forward gesture snapshot always times out
+ https://bugs.webkit.org/show_bug.cgi?id=197233
+
+ Reviewed by Michael Catanzaro.
+
+ Delaying web process launch caused a regression where we create ViewGestureController when the
+ web process doesn't yet exist. The controller immediately tries to connect to it and fails,
+ and because of that never receives DidHitRenderTreeSizeThreshold() message, so navigation
+ snapshot always stays until timeout after performing the gesture.
+
+ To prevent this, create the controller in webkitWebViewBaseDidRelaunchWebProcess() instead of
+ webkitWebViewBaseCreateWebPage(). Additionally, since settings are now created earlier than
+ ViewGestureController, store the value of whether swipe gesture is enabled in WebKitWebViewBase
+ and immediately apply it when creating the controller.
+
+ * UIProcess/API/glib/WebKitWebView.cpp:
+ (enableBackForwardNavigationGesturesChanged):
+ Move the logic into webkitWebViewBaseSetEnableBackForwardNavigationGesture().
+ * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+ (webkitWebViewBaseSetEnableBackForwardNavigationGesture): Added. In addition to what was in
+ WebKitWebViewBase::enableBackForwardNavigationGesturesChanged(), store the value in a field
+ for the case ViewGestureController doesn't exist yet.
+ (webkitWebViewBaseCreateWebPage): Stop creating ViewGestureController.
+ (webkitWebViewBaseDidRelaunchWebProcess): Move creating ViewGestureController here. Also
+ immediately call setSwipeGestureEnabled() with the stored value.
+ * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
+
2019-04-25 Youenn Fablet <[email protected]>
[Mac iOS WK2] Layout Test http/wpt/cache-storage/cache-quota-after-restart.any.html is a flaky failure
Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp (244647 => 244648)
--- trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp 2019-04-25 16:48:39 UTC (rev 244647)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp 2019-04-25 16:58:09 UTC (rev 244648)
@@ -514,11 +514,7 @@
static void enableBackForwardNavigationGesturesChanged(WebKitSettings* settings, GParamSpec*, WebKitWebView* webView)
{
gboolean enable = webkit_settings_get_enable_back_forward_navigation_gestures(settings);
-
- ViewGestureController& controller = webkitWebViewBaseViewGestureController(WEBKIT_WEB_VIEW_BASE(webView));
- controller.setSwipeGestureEnabled(enable);
-
- getPage(webView).setShouldRecordNavigationSnapshots(enable);
+ webkitWebViewBaseSetEnableBackForwardNavigationGesture(WEBKIT_WEB_VIEW_BASE(webView), enable);
}
static void webkitWebViewUpdateFavicon(WebKitWebView* webView, cairo_surface_t* favicon)
Modified: trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp (244647 => 244648)
--- trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp 2019-04-25 16:48:39 UTC (rev 244647)
+++ trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp 2019-04-25 16:58:09 UTC (rev 244648)
@@ -206,6 +206,7 @@
std::unique_ptr<GestureController> gestureController;
#endif
std::unique_ptr<ViewGestureController> viewGestureController;
+ bool isBackForwardNavigationGestureEnabled { false };
};
WEBKIT_DEFINE_TYPE(WebKitWebViewBase, webkit_web_view_base, GTK_TYPE_CONTAINER)
@@ -1189,6 +1190,18 @@
}
#endif
+void webkitWebViewBaseSetEnableBackForwardNavigationGesture(WebKitWebViewBase* webViewBase, bool enabled)
+{
+ WebKitWebViewBasePrivate* priv = webViewBase->priv;
+
+ priv->isBackForwardNavigationGestureEnabled = enabled;
+
+ if (priv->pageProxy->hasRunningProcess())
+ webViewBase->priv->viewGestureController->setSwipeGestureEnabled(enabled);
+
+ priv->pageProxy->setShouldRecordNavigationSnapshots(enabled);
+}
+
ViewGestureController& webkitWebViewBaseViewGestureController(WebKitWebViewBase* webViewBase)
{
return *webViewBase->priv->viewGestureController;
@@ -1420,8 +1433,6 @@
priv->pageProxy->setIntrinsicDeviceScaleFactor(gtk_widget_get_scale_factor(GTK_WIDGET(webkitWebViewBase)));
g_signal_connect(webkitWebViewBase, "notify::scale-factor", G_CALLBACK(deviceScaleFactorChanged), nullptr);
#endif
-
- priv->viewGestureController = std::make_unique<WebKit::ViewGestureController>(*priv->pageProxy);
}
void webkitWebViewBaseSetTooltipText(WebKitWebViewBase* webViewBase, const char* tooltip)
@@ -1639,11 +1650,12 @@
// Queue a resize to ensure the new DrawingAreaProxy is resized.
gtk_widget_queue_resize_no_redraw(GTK_WIDGET(webkitWebViewBase));
+ WebKitWebViewBasePrivate* priv = webkitWebViewBase->priv;
+
#if PLATFORM(X11) && USE(TEXTURE_MAPPER_GL) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
if (PlatformDisplay::sharedDisplay().type() != PlatformDisplay::Type::X11)
return;
- WebKitWebViewBasePrivate* priv = webkitWebViewBase->priv;
auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(priv->pageProxy->drawingArea());
ASSERT(drawingArea);
@@ -1655,6 +1667,9 @@
#else
UNUSED_PARAM(webkitWebViewBase);
#endif
+
+ priv->viewGestureController = std::make_unique<WebKit::ViewGestureController>(*priv->pageProxy);
+ priv->viewGestureController->setSwipeGestureEnabled(priv->isBackForwardNavigationGestureEnabled);
}
void webkitWebViewBasePageClosed(WebKitWebViewBase* webkitWebViewBase)
Modified: trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h (244647 => 244648)
--- trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h 2019-04-25 16:48:39 UTC (rev 244647)
+++ trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h 2019-04-25 16:58:09 UTC (rev 244648)
@@ -84,6 +84,7 @@
RefPtr<WebKit::ViewSnapshot> webkitWebViewBaseTakeViewSnapshot(WebKitWebViewBase*);
+void webkitWebViewBaseSetEnableBackForwardNavigationGesture(WebKitWebViewBase*, bool enabled);
WebKit::ViewGestureController& webkitWebViewBaseViewGestureController(WebKitWebViewBase*);
void webkitWebViewBaseDidStartProvisionalLoadForMainFrame(WebKitWebViewBase*);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes