Changeset 176513 in webkit
- Timestamp:
- Nov 24, 2014 3:18:55 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r176512 r176513 1 2014-11-24 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] WebKitWebView is created with the wrong web context when using webkit_web_view_new_with_related_view() 4 https://bugs.webkit.org/show_bug.cgi?id=139023 5 6 Reviewed by Sergio Villar Senin. 7 8 The WebKitWebContext is a construct only property, so it's always 9 set to the default value when not provided, during the 10 construction. When a related-view is used to create a new web view 11 we should ensure that the same web context is used for the new web 12 view, instead of the default. We should also ignore any web 13 context given as construct parameter if a related view is alos provided. 14 15 * UIProcess/API/gtk/WebKitWebView.cpp: 16 (webkitWebViewConstructed): Do not set the context to the default 17 one when not given during construction. 18 (webkitWebViewSetProperty): Only use the default web context when 19 not provided as construct parameter and there isn't a related view. 20 1 21 2014-11-23 Carlos Garcia Campos <cgarcia@igalia.com> 2 22 -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
r175694 r176513 565 565 static void webkitWebViewConstructed(GObject* object) 566 566 { 567 if (G_OBJECT_CLASS(webkit_web_view_parent_class)->constructed) 568 G_OBJECT_CLASS(webkit_web_view_parent_class)->constructed(object); 567 G_OBJECT_CLASS(webkit_web_view_parent_class)->constructed(object); 569 568 570 569 WebKitWebView* webView = WEBKIT_WEB_VIEW(object); 571 570 WebKitWebViewPrivate* priv = webView->priv; 571 if (priv->relatedView) 572 priv->context = webkit_web_view_get_context(priv->relatedView); 573 else if (!priv->context) 574 priv->context = webkit_web_context_get_default(); 572 575 if (!priv->settings) 573 576 priv->settings = adoptGRef(webkit_settings_new()); 577 574 578 webkitWebContextCreatePageForWebView(priv->context, webView, priv->userContentManager.get(), priv->relatedView); 575 579 … … 604 608 case PROP_WEB_CONTEXT: { 605 609 gpointer webContext = g_value_get_object(value); 606 webView->priv->context = webContext ? WEBKIT_WEB_CONTEXT(webContext) : webkit_web_context_get_default();610 webView->priv->context = webContext ? WEBKIT_WEB_CONTEXT(webContext) : nullptr; 607 611 break; 608 612 } -
trunk/Tools/ChangeLog
r176512 r176513 1 2014-11-24 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] WebKitWebView is created with the wrong web context when using webkit_web_view_new_with_related_view() 4 https://bugs.webkit.org/show_bug.cgi?id=139023 5 6 Reviewed by Sergio Villar Senin. 7 8 Rename WebKitWebView/default-context as WebKitWebView/web-context 9 and check we are always using the right context for new web views. 10 11 * TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp: 12 (testWebViewWebContext): 13 (beforeAll): 14 (testWebViewDefaultContext): Deleted. 15 1 16 2014-11-23 Carlos Garcia Campos <cgarcia@igalia.com> 2 17 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp
r176260 r176513 25 25 #include <wtf/gobject/GRefPtr.h> 26 26 27 static void testWebView DefaultContext(WebViewTest* test, gconstpointer)27 static void testWebViewWebContext(WebViewTest* test, gconstpointer) 28 28 { 29 29 g_assert(webkit_web_view_get_context(test->m_webView) == test->m_webContext.get()); 30 g_assert(webkit_web_context_get_default() != test->m_webContext.get()); 30 31 31 32 // Check that a web view created with g_object_new has the default context. 32 GRefPtr<WebKitWebView> webView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW, NULL));33 GRefPtr<WebKitWebView> webView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW, nullptr)); 33 34 g_assert(webkit_web_view_get_context(webView.get()) == webkit_web_context_get_default()); 35 36 // Check that a web view created with a related view has the related view context. 37 webView = WEBKIT_WEB_VIEW(webkit_web_view_new_with_related_view(test->m_webView)); 38 g_assert(webkit_web_view_get_context(webView.get()) == test->m_webContext.get()); 39 40 // Check that a web context given as construct parameter is ignored if a related view is also provided. 41 webView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW, 42 "web-context", webkit_web_context_get_default(), "related-view", test->m_webView, nullptr)); 43 g_assert(webkit_web_view_get_context(webView.get()) == test->m_webContext.get()); 34 44 } 35 45 … … 574 584 void beforeAll() 575 585 { 576 WebViewTest::add("WebKitWebView", " default-context", testWebViewDefaultContext);586 WebViewTest::add("WebKitWebView", "web-context", testWebViewWebContext); 577 587 WebViewTest::add("WebKitWebView", "custom-charset", testWebViewCustomCharset); 578 588 WebViewTest::add("WebKitWebView", "settings", testWebViewSettings);
Note: See TracChangeset
for help on using the changeset viewer.