summaryrefslogtreecommitdiffstats
path: root/WebKit/gtk
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-08-04 11:41:34 +0100
committerSteve Block <steveblock@google.com>2010-08-09 12:04:44 +0100
commitdb14019a23d96bc8a444b6576a5da8bd1cfbc8b0 (patch)
tree9f793c5b0f5e1f2aca8247158920e2c4bf962bbf /WebKit/gtk
parentbf916837aa84f1e4b00e6ed6268516c2acd27545 (diff)
downloadexternal_webkit-db14019a23d96bc8a444b6576a5da8bd1cfbc8b0.zip
external_webkit-db14019a23d96bc8a444b6576a5da8bd1cfbc8b0.tar.gz
external_webkit-db14019a23d96bc8a444b6576a5da8bd1cfbc8b0.tar.bz2
Merge WebKit at r64523 : Initial merge by git.
Change-Id: Ibb796c6802e757b1d9b40f58205cfbe4da95fcd4
Diffstat (limited to 'WebKit/gtk')
-rw-r--r--WebKit/gtk/ChangeLog123
-rw-r--r--WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp27
-rw-r--r--WebKit/gtk/WebCoreSupport/ChromeClientGtk.h12
-rw-r--r--WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp18
-rw-r--r--WebKit/gtk/tests/testatk.c106
-rw-r--r--WebKit/gtk/tests/testwebframe.c45
-rw-r--r--WebKit/gtk/webkit/webkitprivate.h3
-rw-r--r--WebKit/gtk/webkit/webkitwebframe.cpp15
-rw-r--r--WebKit/gtk/webkit/webkitwebview.cpp21
9 files changed, 346 insertions, 24 deletions
diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index bf1777d..3d3436f 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,126 @@
+2010-07-27 Luiz Agostini <luiz.agostini@openbossa.org>
+
+ Reviewed by Darin Fisher.
+
+ PopupMenu refactoring in preparation to WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=42592
+
+ As ChromeClient was made responsible for providing PopupMenu and SearchPopupMenu
+ instances, concrete classes that inherit from ChromeClient needed to be changed to
+ implement the new methods.
+
+ * WebCoreSupport/ChromeClientGtk.cpp:
+ (WebKit::ChromeClient::selectItemWritingDirectionIsNatural):
+ (WebKit::ChromeClient::createPopupMenu):
+ (WebKit::ChromeClient::createSearchPopupMenu):
+ * WebCoreSupport/ChromeClientGtk.h:
+
+2010-08-02 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] Create a frame-created signal
+ https://bugs.webkit.org/show_bug.cgi?id=43284
+
+ Add a frame-created signal, which will allow developers to track
+ the beginning of a frame lifecycle and attach signal handlers to
+ all new frames.
+
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::FrameLoaderClient::createFrame): Emit the frame-created signal.
+ * tests/testwebframe.c: Add a test which verifies that the correct number of
+ frame-created signals is fired when a page with iframes loads.
+ (createFrameSignalTestFrameCreatedCallback): Added.
+ (createFrameSignalTestTimeout): Added.
+ (test_webkit_web_frame_created_signal): Added.
+ (main): Add a reference to the new test.
+ * webkit/webkitprivate.h: De-normalize webkit_web_frame_init_with_web_view into
+ the one place that it is used, so that the frame-created signal may be fired there.
+ * webkit/webkitwebframe.cpp: Remove webkit_web_frame_init_with_web_view.
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_class_init): Add the frame-created signal declaration.
+
+2010-08-02 Mario Sanchez Prada <msanchez@igalia.com>
+
+ Reviewed by Chris Fleizach.
+
+ [GTK] Implement support for get_character_extents and get_range_extents
+ https://bugs.webkit.org/show_bug.cgi?id=25677
+
+ Added new unit tests to check get_character_extents and
+ get_range_extents functions for the ATK_TEXT interface
+
+ Based on a previous patch by Joanmarie Diggs.
+
+ * tests/testatk.c:
+ (test_webkit_atk_get_extents):
+ (main):
+
+2010-08-02 Jeremy Orlow <jorlow@chromium.org>
+
+ Speculative revert of 64425 due to Chromium instability
+ https://bugs.webkit.org/show_bug.cgi?id=43347
+
+ * WebCoreSupport/ChromeClientGtk.cpp:
+ * WebCoreSupport/ChromeClientGtk.h:
+
+2010-07-27 Luiz Agostini <luiz.agostini@openbossa.org>
+
+ Reviewed by Darin Fisher.
+
+ PopupMenu refactoring in preparation to WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=42592
+
+ As ChromeClient was made responsible for providing PopupMenu and SearchPopupMenu
+ instances, concrete classes that inherit from ChromeClient needed to be changed to
+ implement the new methods.
+
+ * WebCoreSupport/ChromeClientGtk.cpp:
+ (WebKit::ChromeClient::selectItemWritingDirectionIsNatural):
+ (WebKit::ChromeClient::createPopupMenu):
+ (WebKit::ChromeClient::createSearchPopupMenu):
+ * WebCoreSupport/ChromeClientGtk.h:
+
+2010-07-31 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r64422.
+ http://trac.webkit.org/changeset/64422
+ https://bugs.webkit.org/show_bug.cgi?id=43304
+
+ Build fixes are needed for Snow Leopard and Windows.
+ (Requested by lca on #webkit).
+
+ * WebCoreSupport/ChromeClientGtk.cpp:
+ * WebCoreSupport/ChromeClientGtk.h:
+
+2010-07-27 Luiz Agostini <luiz.agostini@openbossa.org>
+
+ Reviewed by Darin Fisher.
+
+ PopupMenu refactoring in preparation to WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=42592
+
+ As ChromeClient was made responsible for providing PopupMenu and SearchPopupMenu
+ instances, concrete classes that inherit from ChromeClient needed to be changed to
+ implement the new methods.
+
+ * WebCoreSupport/ChromeClientGtk.cpp:
+ (WebKit::ChromeClient::selectItemWritingDirectionIsNatural):
+ (WebKit::ChromeClient::createPopupMenu):
+ (WebKit::ChromeClient::createSearchPopupMenu):
+ * WebCoreSupport/ChromeClientGtk.h:
+
+2010-07-30 Joseph Pecoraro <joepeck@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas)
+ https://bugs.webkit.org/show_bug.cgi?id=40627
+
+ * WebCoreSupport/ChromeClientGtk.cpp:
+ (WebKit::ChromeClient::reachedApplicationCacheOriginQuota):
+ * WebCoreSupport/ChromeClientGtk.h:
+
2010-07-26 Steve Block <steveblock@google.com>
Reviewed by Jeremy Orlow.
diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
index 88440ba..081c942 100644
--- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
@@ -4,6 +4,7 @@
* Copyright (C) 2008 Nuanti Ltd.
* Copyright (C) 2008 Alp Toker <alp@atoker.com>
* Copyright (C) 2008 Gustavo Noronha Silva <gns@gnome.org>
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -30,10 +31,14 @@
#include "FrameLoadRequest.h"
#include "GtkVersioning.h"
#include "IntRect.h"
-#include "PlatformString.h"
#include "HitTestResult.h"
#include "Icon.h"
#include "KURL.h"
+#include "PlatformString.h"
+#include "PopupMenuClient.h"
+#include "PopupMenuGtk.h"
+#include "SearchPopupMenuGtk.h"
+#include "SecurityOrigin.h"
#include "webkitgeolocationpolicydecision.h"
#include "webkitwebview.h"
#include "webkitnetworkrequest.h"
@@ -549,6 +554,11 @@ void ChromeClient::reachedMaxAppCacheSize(int64_t spaceNeeded)
// FIXME: Free some space.
notImplemented();
}
+
+void ChromeClient::reachedApplicationCacheOriginQuota(SecurityOrigin*)
+{
+ notImplemented();
+}
#endif
void ChromeClient::runOpenPanel(Frame*, PassRefPtr<FileChooser> prpFileChooser)
@@ -616,4 +626,19 @@ void ChromeClient::cancelGeolocationPermissionRequestForFrame(WebCore::Frame* fr
g_signal_emit_by_name(webView, "geolocation-policy-decision-cancelled", webFrame);
}
+bool ChromeClient::selectItemWritingDirectionIsNatural()
+{
+ return true;
+}
+
+PassRefPtr<WebCore::PopupMenu> ChromeClient::createPopupMenu(WebCore::PopupMenuClient* client) const
+{
+ return adoptRef(new PopupMenuGtk(client));
+}
+
+PassRefPtr<WebCore::SearchPopupMenu> ChromeClient::createSearchPopupMenu(WebCore::PopupMenuClient* client) const
+{
+ return adoptRef(new SearchPopupMenuGtk(client));
+}
+
}
diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
index ce5c5a7..8c667c4 100644
--- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
+++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -22,9 +23,15 @@
#include "ChromeClient.h"
#include "KURL.h"
+#include "PopupMenu.h"
+#include "SearchPopupMenu.h"
typedef struct _WebKitWebView WebKitWebView;
+namespace WebCore {
+class PopupMenuClient;
+}
+
namespace WebKit {
class ChromeClient : public WebCore::ChromeClient {
@@ -108,6 +115,7 @@ namespace WebKit {
#endif
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
+ virtual void reachedApplicationCacheOriginQuota(WebCore::SecurityOrigin*);
#endif
virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>);
virtual void chooseIconForFiles(const Vector<WebCore::String>&, WebCore::FileChooser*);
@@ -122,6 +130,10 @@ namespace WebKit {
virtual void requestGeolocationPermissionForFrame(WebCore::Frame*, WebCore::Geolocation*);
virtual void cancelGeolocationPermissionRequestForFrame(WebCore::Frame*, WebCore::Geolocation*);
+ virtual bool selectItemWritingDirectionIsNatural();
+ virtual PassRefPtr<WebCore::PopupMenu> createPopupMenu(WebCore::PopupMenuClient*) const;
+ virtual PassRefPtr<WebCore::SearchPopupMenu> createSearchPopupMenu(WebCore::PopupMenuClient*) const;
+
private:
WebKitWebView* m_webView;
WebCore::KURL m_hoveredLinkURL;
diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
index 340b789..98ac4a1 100644
--- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
@@ -5,6 +5,7 @@
* Copyright (C) 2008, 2009 Collabora Ltd. All rights reserved.
* Copyright (C) 2009, 2010 Gustavo Noronha Silva <gns@gnome.org>
* Copyright (C) Research In Motion Limited 2009. All rights reserved.
+ * Copyright (C) 2010 Igalia S.L.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -472,14 +473,20 @@ PassRefPtr<Widget> FrameLoaderClient::createPlugin(const IntSize& pluginSize, HT
PassRefPtr<Frame> FrameLoaderClient::createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement,
const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight)
{
- Frame* coreFrame = core(m_frame);
-
- ASSERT(core(getViewFromFrame(m_frame)) == coreFrame->page());
+ ASSERT(m_frame);
+ Frame* parentFrame = core(m_frame);
+ WebKitWebView* webView = getViewFromFrame(m_frame);
+ WebCore::Page* page = core(webView);
+ ASSERT(page == parentFrame->page());
- RefPtr<Frame> childFrame = webkit_web_frame_init_with_web_view(getViewFromFrame(m_frame), ownerElement);
+ WebKitWebFrame* kitFrame = WEBKIT_WEB_FRAME(g_object_new(WEBKIT_TYPE_WEB_FRAME, NULL));
+ WebKitWebFramePrivate* framePrivate = kitFrame->priv;
+ framePrivate->webView = webView;
- coreFrame->tree()->appendChild(childFrame);
+ RefPtr<Frame> childFrame = Frame::create(page, ownerElement, new FrameLoaderClient(kitFrame));
+ framePrivate->coreFrame = childFrame.get();
+ parentFrame->tree()->appendChild(childFrame);
childFrame->tree()->setName(name);
childFrame->init();
@@ -493,6 +500,7 @@ PassRefPtr<Frame> FrameLoaderClient::createFrame(const KURL& url, const String&
if (!childFrame->tree()->parent())
return 0;
+ g_signal_emit_by_name(webView, "frame-created", kitFrame);
return childFrame.release();
}
diff --git a/WebKit/gtk/tests/testatk.c b/WebKit/gtk/tests/testatk.c
index 8f13a95..e159f8a 100644
--- a/WebKit/gtk/tests/testatk.c
+++ b/WebKit/gtk/tests/testatk.c
@@ -26,6 +26,8 @@
#if GLIB_CHECK_VERSION(2, 16, 0) && GTK_CHECK_VERSION(2, 14, 0)
+static const char* centeredContents = "<html><body><p style='text-align: center;'>Short line</p><p style='text-align: center;'>Long-size line with some foo bar baz content</p><p style='text-align: center;'>Short line</p><p style='text-align: center;'>This is a multi-line paragraph<br />where the first line<br />is the biggest one</p></body></html>";
+
static const char* contents = "<html><body><p>This is a test. This is the second sentence. And this the third.</p></body></html>";
static const char* contentsWithNewlines = "<html><body><p>This is a test. \n\nThis\n is the second sentence. And this the third.</p></body></html>";
@@ -738,6 +740,109 @@ static void testWebkitAtkTextAttributes(void)
atk_attribute_set_free(set3);
}
+static void test_webkit_atk_get_extents(void)
+{
+ WebKitWebView* webView;
+ AtkObject* obj;
+ GMainLoop* loop;
+
+ webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
+ g_object_ref_sink(webView);
+ GtkAllocation alloc = { 0, 0, 800, 600 };
+ gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc);
+ webkit_web_view_load_string(webView, centeredContents, NULL, NULL, NULL);
+ loop = g_main_loop_new(NULL, TRUE);
+
+ g_timeout_add(100, (GSourceFunc)bail_out, loop);
+ g_main_loop_run(loop);
+
+ obj = gtk_widget_get_accessible(GTK_WIDGET(webView));
+ g_assert(obj);
+
+ AtkText* short_text1 = ATK_TEXT(atk_object_ref_accessible_child(obj, 0));
+ g_assert(ATK_IS_TEXT(short_text1));
+ AtkText* long_text = ATK_TEXT(atk_object_ref_accessible_child(obj, 1));
+ g_assert(ATK_IS_TEXT(long_text));
+ AtkText* short_text2 = ATK_TEXT(atk_object_ref_accessible_child(obj, 2));
+ g_assert(ATK_IS_TEXT(short_text2));
+ AtkText* multiline_text = ATK_TEXT(atk_object_ref_accessible_child(obj, 3));
+ g_assert(ATK_IS_TEXT(multiline_text));
+
+ // Start with window extents.
+ AtkTextRectangle sline_window1, sline_window2, lline_window, mline_window;
+ atk_text_get_range_extents(short_text1, 0, 10, ATK_XY_WINDOW, &sline_window1);
+ atk_text_get_range_extents(long_text, 0, 44, ATK_XY_WINDOW, &lline_window);
+ atk_text_get_range_extents(short_text2, 0, 10, ATK_XY_WINDOW, &sline_window2);
+ atk_text_get_range_extents(multiline_text, 0, 60, ATK_XY_WINDOW, &mline_window);
+
+ // Check vertical line position.
+ g_assert_cmpint(sline_window1.y + sline_window1.height, <=, lline_window.y);
+ g_assert_cmpint(lline_window.y + lline_window.height + sline_window2.height, <=, mline_window.y);
+
+ // Paragraphs 1 and 3 have identical text and alignment.
+ g_assert_cmpint(sline_window1.x, ==, sline_window2.x);
+ g_assert_cmpint(sline_window1.width, ==, sline_window2.width);
+ g_assert_cmpint(sline_window1.height, ==, sline_window2.height);
+
+ // All lines should be the same height; line 2 is the widest line.
+ g_assert_cmpint(sline_window1.height, ==, lline_window.height);
+ g_assert_cmpint(sline_window1.width, <, lline_window.width);
+
+ // Make sure the character extents jive with the range extents.
+ gint x, y, width, height;
+
+ // First paragraph (short text)
+ atk_text_get_character_extents(short_text1, 0, &x, &y, &width, &height, ATK_XY_WINDOW);
+ g_assert_cmpint(x, ==, sline_window1.x);
+ g_assert_cmpint(y, ==, sline_window1.y);
+ g_assert_cmpint(height, ==, sline_window1.height);
+
+ atk_text_get_character_extents(short_text1, 9, &x, &y, &width, &height, ATK_XY_WINDOW);
+ g_assert_cmpint(x, ==, sline_window1.x + sline_window1.width - width);
+ g_assert_cmpint(y, ==, sline_window1.y);
+ g_assert_cmpint(height, ==, sline_window1.height);
+
+ // Second paragraph (long text)
+ atk_text_get_character_extents(long_text, 0, &x, &y, &width, &height, ATK_XY_WINDOW);
+ g_assert_cmpint(x, ==, lline_window.x);
+ g_assert_cmpint(y, ==, lline_window.y);
+ g_assert_cmpint(height, ==, lline_window.height);
+
+ atk_text_get_character_extents(long_text, 43, &x, &y, &width, &height, ATK_XY_WINDOW);
+ g_assert_cmpint(x, ==, lline_window.x + lline_window.width - width);
+ g_assert_cmpint(y, ==, lline_window.y);
+ g_assert_cmpint(height, ==, lline_window.height);
+
+ // Third paragraph (short text)
+ atk_text_get_character_extents(short_text2, 0, &x, &y, &width, &height, ATK_XY_WINDOW);
+ g_assert_cmpint(x, ==, sline_window2.x);
+ g_assert_cmpint(y, ==, sline_window2.y);
+ g_assert_cmpint(height, ==, sline_window2.height);
+
+ atk_text_get_character_extents(short_text2, 9, &x, &y, &width, &height, ATK_XY_WINDOW);
+ g_assert_cmpint(x, ==, sline_window2.x + sline_window2.width - width);
+ g_assert_cmpint(y, ==, sline_window2.y);
+ g_assert_cmpint(height, ==, sline_window2.height);
+
+ // Four paragraph (3 lines multi-line text)
+ atk_text_get_character_extents(multiline_text, 0, &x, &y, &width, &height, ATK_XY_WINDOW);
+ g_assert_cmpint(x, ==, mline_window.x);
+ g_assert_cmpint(y, ==, mline_window.y);
+ g_assert_cmpint(3 * height, ==, mline_window.height);
+
+ atk_text_get_character_extents(multiline_text, 59, &x, &y, &width, &height, ATK_XY_WINDOW);
+ // Last line won't fill the whole width of the rectangle
+ g_assert_cmpint(x, <=, mline_window.x + mline_window.width - width);
+ g_assert_cmpint(y, ==, mline_window.y + mline_window.height - height);
+ g_assert_cmpint(height, <=, mline_window.height);
+
+ g_object_unref(short_text1);
+ g_object_unref(short_text2);
+ g_object_unref(long_text);
+ g_object_unref(multiline_text);
+ g_object_unref(webView);
+}
+
int main(int argc, char** argv)
{
g_thread_init(NULL);
@@ -754,6 +859,7 @@ int main(int argc, char** argv)
g_test_add_func("/webkit/atk/getTextInTable", testWebkitAtkGetTextInTable);
g_test_add_func("/webkit/atk/getHeadersInTable", testWebkitAtkGetHeadersInTable);
g_test_add_func("/webkit/atk/textAttributes", testWebkitAtkTextAttributes);
+ g_test_add_func("/webkit/atk/get_extents", test_webkit_atk_get_extents);
return g_test_run ();
}
diff --git a/WebKit/gtk/tests/testwebframe.c b/WebKit/gtk/tests/testwebframe.c
index 620c9c9..59c7c2b 100644
--- a/WebKit/gtk/tests/testwebframe.c
+++ b/WebKit/gtk/tests/testwebframe.c
@@ -27,6 +27,50 @@
#if GLIB_CHECK_VERSION(2, 16, 0) && GTK_CHECK_VERSION(2, 14, 0)
+static int numberOfFramesCreated = 0;
+
+static void createFrameSignalTestFrameCreatedCallback(WebKitWebView* webView, WebKitWebFrame* frame, gpointer data)
+{
+ numberOfFramesCreated++;
+}
+
+static gboolean createFrameSignalTestTimeout(gpointer data)
+{
+ g_assert_cmpint(numberOfFramesCreated, ==, 2);
+ g_main_loop_quit((GMainLoop*) data);
+ return FALSE;
+}
+
+static void test_webkit_web_frame_created_signal(void)
+{
+ GtkWidget* webView;
+ GtkWidget* window;
+ GMainLoop* loop = g_main_loop_new(NULL, TRUE);
+
+ window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+
+ webView = webkit_web_view_new();
+ g_signal_connect(webView, "frame-created", G_CALLBACK(createFrameSignalTestFrameCreatedCallback), loop);
+
+ // We want to ensure that exactly two create-frame signals are
+ // fired and no more, so we set a timeout here. There does not appear
+ // to be a simple way via the API to figure out when all frames have
+ // loaded.
+ g_timeout_add(500, createFrameSignalTestTimeout, loop);
+
+ gtk_container_add(GTK_CONTAINER(window), webView);
+ gtk_widget_show(window);
+ gtk_widget_show(webView);
+
+ webkit_web_view_load_string(WEBKIT_WEB_VIEW(webView),
+ "<html><body>Frames!"
+ "<iframe></iframe>"
+ "<iframe></iframe>"
+ "</body></html>",
+ "text/html", "utf-8", "file://");
+ g_main_loop_run(loop);
+}
+
static void test_webkit_web_frame_create_destroy(void)
{
GtkWidget *webView;
@@ -170,6 +214,7 @@ int main(int argc, char** argv)
g_test_bug_base("https://bugs.webkit.org/");
g_test_add_func("/webkit/webview/create_destroy", test_webkit_web_frame_create_destroy);
+ g_test_add_func("/webkit/webview/frame-created_signal", test_webkit_web_frame_created_signal);
g_test_add_func("/webkit/webframe/lifetime", test_webkit_web_frame_lifetime);
g_test_add_func("/webkit/webview/printing", test_webkit_web_frame_printing);
g_test_add_func("/webkit/webview/response", test_webkit_web_frame_response);
diff --git a/WebKit/gtk/webkit/webkitprivate.h b/WebKit/gtk/webkit/webkitprivate.h
index 73f9fcc..3ce77e6 100644
--- a/WebKit/gtk/webkit/webkitprivate.h
+++ b/WebKit/gtk/webkit/webkitprivate.h
@@ -196,9 +196,6 @@ extern "C" {
gboolean disposed;
};
- PassRefPtr<WebCore::Frame>
- webkit_web_frame_init_with_web_view(WebKitWebView*, WebCore::HTMLFrameOwnerElement*);
-
void
webkit_web_frame_core_frame_gone(WebKitWebFrame*);
diff --git a/WebKit/gtk/webkit/webkitwebframe.cpp b/WebKit/gtk/webkit/webkitwebframe.cpp
index 344f94e..5e82d57 100644
--- a/WebKit/gtk/webkit/webkitwebframe.cpp
+++ b/WebKit/gtk/webkit/webkitwebframe.cpp
@@ -408,21 +408,6 @@ WebKitWebFrame* webkit_web_frame_new(WebKitWebView* webView)
return frame;
}
-PassRefPtr<Frame> webkit_web_frame_init_with_web_view(WebKitWebView* webView, HTMLFrameOwnerElement* element)
-{
- WebKitWebFrame* frame = WEBKIT_WEB_FRAME(g_object_new(WEBKIT_TYPE_WEB_FRAME, NULL));
- WebKitWebFramePrivate* priv = frame->priv;
- WebKitWebViewPrivate* viewPriv = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
-
- priv->webView = webView;
- WebKit::FrameLoaderClient* client = new WebKit::FrameLoaderClient(frame);
-
- RefPtr<Frame> coreFrame = Frame::create(viewPriv->corePage, element, client);
- priv->coreFrame = coreFrame.get();
-
- return coreFrame.release();
-}
-
/**
* webkit_web_frame_get_title:
* @frame: a #WebKitWebFrame
diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp
index cde9148..8747d42 100644
--- a/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/WebKit/gtk/webkit/webkitwebview.cpp
@@ -172,6 +172,7 @@ enum {
GEOLOCATION_POLICY_DECISION_REQUESTED,
GEOLOCATION_POLICY_DECISION_CANCELLED,
ONLOAD_EVENT,
+ FRAME_CREATED,
LAST_SIGNAL
};
@@ -2447,6 +2448,26 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
G_TYPE_NONE, 1,
WEBKIT_TYPE_WEB_FRAME);
+ /*
+ * WebKitWebView::frame-created
+ * @web_view: the object which received the signal
+ * @web_frame: the #WebKitWebFrame which was just created.
+ *
+ * Emitted when a WebKitWebView has created a new frame. This signal will
+ * be emitted for all sub-frames created during page load. It will not be
+ * emitted for the main frame, which originates in the WebKitWebView constructor
+ * and may be accessed at any time using webkit_web_view_get_main_frame.
+ *
+ * Since: 1.3.4
+ */
+ webkit_web_view_signals[FRAME_CREATED] = g_signal_new("frame-created",
+ G_TYPE_FROM_CLASS(webViewClass),
+ (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1,
+ WEBKIT_TYPE_WEB_FRAME);
/*
* implementations of virtual methods