diff options
author | Shimeng (Simon) Wang <swang@google.com> | 2010-12-07 17:22:45 -0800 |
---|---|---|
committer | Shimeng (Simon) Wang <swang@google.com> | 2010-12-22 14:15:40 -0800 |
commit | 4576aa36e9a9671459299c7963ac95aa94beaea9 (patch) | |
tree | 3863574e050f168c0126ecb47c83319fab0972d8 /WebKit/gtk | |
parent | 55323ac613cc31553107b68603cb627264d22bb0 (diff) | |
download | external_webkit-4576aa36e9a9671459299c7963ac95aa94beaea9.zip external_webkit-4576aa36e9a9671459299c7963ac95aa94beaea9.tar.gz external_webkit-4576aa36e9a9671459299c7963ac95aa94beaea9.tar.bz2 |
Merge WebKit at r73109: Initial merge by git.
Change-Id: I61f1a66d9642e3d8405d3ac6ccab2a53421c75d8
Diffstat (limited to 'WebKit/gtk')
-rw-r--r-- | WebKit/gtk/ChangeLog | 359 | ||||
-rw-r--r-- | WebKit/gtk/GNUmakefile.am | 550 | ||||
-rw-r--r-- | WebKit/gtk/NEWS | 17 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp | 9 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp | 108 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/EditorClientGtk.h | 2 | ||||
-rw-r--r-- | WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp | 6 | ||||
-rw-r--r-- | WebKit/gtk/tests/testatk.c | 114 | ||||
-rw-r--r-- | WebKit/gtk/tests/testdomdocument.c | 147 | ||||
-rw-r--r-- | WebKit/gtk/tests/testdomnode.c | 5 | ||||
-rw-r--r-- | WebKit/gtk/webkit/webkithittestresult.cpp | 8 | ||||
-rw-r--r-- | WebKit/gtk/webkit/webkitprivate.cpp | 3 | ||||
-rw-r--r-- | WebKit/gtk/webkit/webkitprivate.h | 2 | ||||
-rw-r--r-- | WebKit/gtk/webkit/webkitwebdatasource.cpp | 2 | ||||
-rw-r--r-- | WebKit/gtk/webkit/webkitwebframe.cpp | 11 | ||||
-rw-r--r-- | WebKit/gtk/webkit/webkitwebinspector.cpp | 18 | ||||
-rw-r--r-- | WebKit/gtk/webkit/webkitwebinspector.h | 4 | ||||
-rw-r--r-- | WebKit/gtk/webkit/webkitwebview.cpp | 136 | ||||
-rw-r--r-- | WebKit/gtk/webkit/webkitwebview.h | 15 | ||||
-rw-r--r-- | WebKit/gtk/webkitmarshal.list | 3 |
20 files changed, 1471 insertions, 48 deletions
diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog index ae266e4..d455df9 100644 --- a/WebKit/gtk/ChangeLog +++ b/WebKit/gtk/ChangeLog @@ -1,3 +1,362 @@ +2010-12-01 Jia Pu <jpu@apple.com> + + Reviewed by Darin Adler. + + Support multiple correction candidates panel for misspelled word on Mac OS X. + https://bugs.webkit.org/show_bug.cgi?id=50137 + <rdar://problem/8568059> + + Adopted new function signature defined in base class. + + * WebCoreSupport/EditorClientGtk.cpp: + (WebKit::EditorClient::getGuessesForWord): + * WebCoreSupport/EditorClientGtk.h: + +2010-11-30 Nicolas Dufresne <nicolas.dufresne@collabora.co.uk> + + Reviewed by Martin Robinson. + + [GTK] Fix wrong type in assert return value + https://bugs.webkit.org/show_bug.cgi?id=50208 + + Use appropriate return type in different g_return_val_if_fail(). This + removes some compiler warning. + + * webkit/webkitwebdatasource.cpp: + (webkit_web_data_source_is_loading): + * webkit/webkitwebframe.cpp: + (webkit_web_frame_page_number_for_element_by_id): + (webkit_web_frame_number_of_pages): + +2010-11-30 Mario Sanchez Prada <msanchez@igalia.com> + + Reviewed by Chris Fleizach. + + [GTK] Implement ROLE_COMBO_BOX + https://bugs.webkit.org/show_bug.cgi?id=25678 + + New test to check the implementation of the combo boxes. + + * tests/testatk.c: + (testWebkitAtkComboBox): New test, checking that the roles and the + implemented interfaces for a combo box and its descendants work. + (main): Added the new unit test. + +2010-11-30 Carlos Garcia Campos <cgarcia@igalia.com> + + Reviewed by Martin Robinson. + + [GTK] Test fast/events/mouseover-mouseout2.html crashes + https://bugs.webkit.org/show_bug.cgi?id=50214 + + * WebCoreSupport/ChromeClientGtk.cpp: + (WebKit::ChromeClient::mouseDidMoveOverElement): + * webkit/webkitwebview.cpp: + (webkit_web_view_query_tooltip): + +2010-11-30 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r72764. + http://trac.webkit.org/changeset/72764 + https://bugs.webkit.org/show_bug.cgi?id=50215 + + This change is causing assertion failures on the debug bots. + (Requested by mrobinson on #webkit). + + * WebCoreSupport/FrameLoaderClientGtk.cpp: + (WebKit::notifyStatus): + * tests/testatk.c: + (main): + +2010-11-29 Xan Lopez <xlopez@igalia.com> + + Reviewed by Martin Robinson. + + * NEWS: update for 1.3.7 release. + +2010-11-29 Carlos Garcia Campos <cgarcia@igalia.com> + + Reviewed by Xan Lopez. + + [Gtk] Tooltips should be fully keyboard accessible + https://bugs.webkit.org/show_bug.cgi?id=25525 + + Position the tooltip under the current focused element when the + tooltip has been triggered using the keyboard. + + * webkit/webkitwebview.cpp: + (webkit_web_view_query_tooltip): + (webkit_web_view_show_help): + (webkit_web_view_class_init): + +2010-11-29 Carlos Garcia Campos <cgarcia@igalia.com> + + Reviewed by Xan Lopez. + + [GTK] Tooltips not shown when scrolling + https://bugs.webkit.org/show_bug.cgi?id=50143 + + Convert tooltip area to window coordinates so that tooltips are + shown even after scrolling. + + * WebCoreSupport/ChromeClientGtk.cpp: + (WebKit::ChromeClient::mouseDidMoveOverElement): + +2010-11-26 Carlos Garcia Campos <cgarcia@igalia.com> + + Reviewed by Xan Lopez. + + [GTK] Inspector: add a way to inspect a WebKitDOMNode + https://bugs.webkit.org/show_bug.cgi?id=49903 + + * webkit/webkitwebinspector.cpp: + (webkit_web_inspector_inspect_node): + * webkit/webkitwebinspector.h: + +2010-11-26 Mario Sanchez Prada <msanchez@igalia.com> + + Reviewed by Xan Lopez. + + [GTK] events missing when a document is (re)loaded + https://bugs.webkit.org/show_bug.cgi?id=25831 + + Emit the right signals when reloading a document. + + * WebCoreSupport/FrameLoaderClientGtk.cpp: + (WebKit::notifyAccessibilityStatus): New function, to make sure + the signals involved in reloading a document are properly emitted. + (WebKit::notifyStatus): Also notify accessibility if enabled. + + New unit test to check the signals are being actually emitted. + + * tests/testatk.c: + (stateChangedCb): Callback for 'state-change' signal emitted by + the accessible object associated to the webView. + (documentReloadCb): Callback for 'reload' signal. + (documentLoadCompleteCb): Callback for 'load-complete' signal. + (webviewLoadStatusChangedCb): Callback for 'notify::load-status' + signal, emitted by the WebKitWebView object (not the AtkObject). + (testWebkitAtkDocumentReloadEvents): New unit test. + (main): Added the new unit test. + +2010-11-24 Xan Lopez <xlopez@igalia.com> + + Reviewed by Martin Robinson. + + [GTK] Make kit() methods return the proper type instead of gpointer + https://bugs.webkit.org/show_bug.cgi?id=50034 + + * WebCoreSupport/EditorClientGtk.cpp: + (WebKit::EditorClient::shouldDeleteRange): get rid of unneeded cast. + (WebKit::EditorClient::shouldShowDeleteInterface): ditto. + (WebKit::EditorClient::shouldBeginEditing): ditto. + (WebKit::EditorClient::shouldEndEditing): ditto. + (WebKit::EditorClient::shouldInsertText): ditto. + (WebKit::EditorClient::shouldChangeSelectedRange): ditto. + (WebKit::EditorClient::shouldApplyStyle): ditto. + (WebKit::EditorClient::shouldInsertNode): ditto. + * webkit/webkitprivate.cpp: + (WebKit::kit): ditto. + * webkit/webkitwebview.cpp: + (webkit_web_view_get_dom_document): ditto. + +2010-11-24 Xan Lopez <xlopez@igalia.com> + + Reviewed by Martin Robinson. + + Fix crashes in GTK+ bots. Use kit() instead of wrapFoo, otherwise + the DOM objects won't be in the cache and we'll ASSERT when + unreffing them. + + * WebCoreSupport/EditorClientGtk.cpp: + (WebKit::EditorClient::shouldDeleteRange): use kit to get the + GObject wrapper for the DOM object. + (WebKit::EditorClient::shouldShowDeleteInterface): ditto. + (WebKit::EditorClient::shouldBeginEditing): ditto. + (WebKit::EditorClient::shouldEndEditing): ditto. + (WebKit::EditorClient::shouldInsertText): ditto. + (WebKit::EditorClient::shouldChangeSelectedRange): ditto. + (WebKit::EditorClient::shouldApplyStyle): ditto. + (WebKit::EditorClient::shouldInsertNode): ditto. + +2010-11-24 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Xan Lopez. + + [GTK] The WebKitWebView should expose a set of signals encapsulating the behavior of the EditorClient + https://bugs.webkit.org/show_bug.cgi?id=49143 + + Add signals that encapsulate the functionality of the Mac EditingDelegate. These signals + are private for now, but DRT consumes them to produce proper output for editing tests. + After some time, these may be part of the public API. + + * WebCoreSupport/EditorClientGtk.cpp: + (WebKit::EditorClient::shouldDeleteRange): Fire the appropriate editing signal. + (WebKit::EditorClient::shouldShowDeleteInterface): Ditto. + (WebKit::EditorClient::shouldBeginEditing): Ditto. + (WebKit::EditorClient::shouldEndEditing): Ditto. + (WebKit::kit): Added helper function. + (WebKit::EditorClient::shouldInsertText): Fire the appropriate editing signal. + (WebKit::EditorClient::shouldChangeSelectedRange): Ditto. + (WebKit::EditorClient::shouldApplyStyle): Ditto. + (WebKit::EditorClient::didBeginEditing): Ditto. + (WebKit::EditorClient::respondToChangedContents): Ditto. + (WebKit::EditorClient::respondToChangedSelection): Ditto. + (WebKit::EditorClient::didEndEditing): Ditto. + (WebKit::EditorClient::shouldInsertNode): Ditto. + * webkit/webkitwebview.cpp: + (webkit_web_view_real_should_allow_editing_action): Added this default signal + callback which explicitly allows cancellable editing actions. + (webkit_web_view_class_init): Add new editing signal declarations to the view. + * webkit/webkitwebview.h: + * webkitmarshal.list: Added some new marshaling definitions. + +2010-11-24 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r72499. + http://trac.webkit.org/changeset/72499 + https://bugs.webkit.org/show_bug.cgi?id=50022 + + This change is causing crashes on the bots. (Requested by + mrobinson on #webkit). + + * tests/testatk.c: + (main): + +2010-11-23 Xan Lopez <xlopez@igalia.com> + + Reviewed by Martin Robinson. + + [GTK] Fix IFrame DOM bindings API + https://bugs.webkit.org/show_bug.cgi?id=49980 + + * tests/testdomdocument.c: + (test_dom_document_garbage_collection): change to use the fixed + IFrame APIs. + +2010-11-23 Carlos Garcia Campos <cgarcia@igalia.com> + + Reviewed by Martin Robinson. + + focus issue with links that have tooltips + https://bugs.webkit.org/show_bug.cgi?id=49498 + + Set the area of the widget where the tooltip should be shown when + a new tooltip is set. Since the widget is the same (the view), if + the tooltip area is not set and a new tooltip is triggered while + the previous one is still visible, the text of the tooltip is + updated but its position doesn't change. + + * WebCoreSupport/ChromeClientGtk.cpp: + (WebKit::ChromeClient::mouseDidMoveOverElement): + * webkit/webkitprivate.h: + * webkit/webkitwebview.cpp: + (webkit_web_view_query_tooltip): + +2010-11-21 Mario Sanchez Prada <msanchez@igalia.com> + + Reviewed by Chris Fleizach. + + [GTK] Implement ROLE_COMBO_BOX + https://bugs.webkit.org/show_bug.cgi?id=25678 + + New test to check the implementation of the combo boxes. + + * tests/testatk.c: + (testWebkitAtkComboBox): New test, checking that the roles and the + implemented interfaces for a combo box and its descendants work. + (main): Added the new unit test. + +2010-11-20 Xan Lopez <xlopez@igalia.com> + + Reviewed by Martin Robinson. + + Remove leftover code in unit test. + + * GNUmakefile.am: remove unneeded utils file in dependency list. + * tests/testdomdocument.c: + (main): do not change to the directory of a non existing resource + list. + +2010-11-20 Xan Lopez <xlopez@igalia.com> + + Reviewed by Martin Robinson. + + [GTK] Memory managament for DOM GObject wrappers + https://bugs.webkit.org/show_bug.cgi?id=40302 + + Initial attempt to have a kind of poor man's garbage collection + for GObject DOM objects. We tie the object's lifecycle to their + parent Frame and/or its document; that is, all objects will be + collected when their parent frame is destroyed or when that frame + transitions to a new document. Manual management (calling + g_object_unref on them) is also allowed, and is required for + objects that are not in the DOM tree (eg NodeLists). + + * GNUmakefile.am: add testutils file to testdomdocument.c + * WebCoreSupport/FrameLoaderClientGtk.cpp: + (WebKit::FrameLoaderClient::setMainFrameDocumentReady): collect + DOM objects on document transition. + * tests/testdomdocument.c: + (dom_document_fixture_teardown): only destroy the view if it's not + already destroyed, since the new test detroys it on its own. + (test_dom_document_get_elements_by_tag_name): manually unref node list. + (test_dom_document_get_elements_by_class_name): ditto. + (test_dom_document_get_links): ditto. + (test_dom_document_garbage_collection): test all possible + scenarios for DOM object "garbage collection". + (main): add new test. + * tests/testdomnode.c: + (test_dom_node_hierarchy_navigation): manually unref node list. + (test_dom_node_insertion): ditto. + * webkit/webkithittestresult.cpp: + (webkit_hit_test_result_dispose): unref the inner node on dispose + now that the memory management model is clarified. + (webkit_hit_test_result_class_init): hook dispose. + * webkit/webkitwebframe.cpp: + (webkit_web_frame_core_frame_gone): clear DOM objects attached to this frame. + (webkit_web_frame_finalize): ditto. + +2010-11-18 Xan Lopez <xlopez@igalia.com> + + Reviewed by Martin Robinson. + + Fix introspection build, we were missing a -I flag. + + * GNUmakefile.am: + +2010-11-18 Mario Sanchez Prada <msanchez@igalia.com> + + Reviewed by Martin Robinson. + + [Gtk] atk_text_get_selection returns the wrong offsets after a link + https://bugs.webkit.org/show_bug.cgi?id=49514 + + Updated test case to also chech this specific subcase. + + We need to explicitly check the case of having a selection in a + paragraph after an embedded object (i.e. a link) to make sure the + right calculations are being done when the paragraph is composed + of more than just one text object, and the current selection is + made only in one of them. + + * tests/testatk.c: + (testWebkitAtkTextSelections): Make sure that a selection after a + link in a paragraph is working ok when asking for the text + selection from the point of view of the paragraph. + +2010-11-17 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Gustavo Noronha Silva. + + [GTK] Changing any GNUmakefile.am in the source tree forces a rebuld of the DOM bindings and WebKit APi + https://bugs.webkit.org/show_bug.cgi?id=49400 + + Add GNUmakefile.am and include all WebKit API build rules. Make webkitenum.* + depend on this new file, instead of the generated GNUmakefile.am. + + * GNUmakefile.am: Copied from GNUmakefile.am. + 2010-11-17 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> Reviewed by Martin Robinson. diff --git a/WebKit/gtk/GNUmakefile.am b/WebKit/gtk/GNUmakefile.am new file mode 100644 index 0000000..a3be816 --- /dev/null +++ b/WebKit/gtk/GNUmakefile.am @@ -0,0 +1,550 @@ + +# Programs to run the WebKitGtk unit tests +GTESTER = gtester +GTESTER_REPORT = gtester-report + +lib_LTLIBRARIES += \ + libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la + +nodist_EXTRA_libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \ + $(webcore_built_nosources) + +nodist_libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \ + $(webcore_built_sources) \ + $(webkitgtk_built_sources) + +libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_ladir = $(prefix)/include/webkit-@WEBKITGTK_API_VERSION@/webkit +libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_HEADERS = \ + $(webkitgtk_static_h_api) + +nodist_libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_HEADERS = \ + $(webkitgtk_built_h_api) \ + $(GENSOURCES_WEBKIT)/webkitenumtypes.h + +libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \ + $(webcore_sources) \ + $(webcoregtk_sources) \ + $(webkitgtk_sources) + +libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CXXFLAGS = \ + $(global_cxxflags) + +libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CFLAGS = \ + $(global_cflags) + +# When building WebCore/WebKit, we want WebCore/config.h and NOT JavaScriptCore/config.h, +# hence, it's important that WebCore/ should come first before JavaScriptCore in the +# include path. +libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPPFLAGS = \ + -DBUILDING_WEBKIT \ + -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \ + -DDATA_DIR=\"${datadir}\" \ + -I$(WebCore)/bindings \ + -I$(WebCore)/bindings/gobject \ + -I$(WebKit) \ + -I$(WebKit)/WebCoreSupport \ + -I$(WebKit)/webkit \ + -I$(GENSOURCES_WEBKIT) \ + -IWebKit/gtk/webkit \ + $(global_cppflags) \ + $(webcore_cppflags) \ + $(webcoregtk_cppflags) \ + $(javascriptcore_cppflags) \ + -fno-strict-aliasing \ + $(HILDON_CPPFLAGS) \ + $(COVERAGE_CFLAGS) \ + $(ENCHANT_CFLAGS) \ + $(GAIL_CFLAGS) \ + $(GEOCLUE_CFLAGS) \ + $(GLIB_CFLAGS) \ + $(GSTREAMER_CFLAGS) \ + $(GTK_CFLAGS) \ + $(HILDON_CFLAGS) \ + $(LIBSOUP_CFLAGS) \ + $(LIBXML_CFLAGS) \ + $(LIBXSLT_CFLAGS) \ + $(SQLITE3_CFLAGS) \ + $(UNICODE_CFLAGS) \ + $(XT_CFLAGS) + +# For the Gtk port we want to use XP_UNIX both in X11 and Mac +if !TARGET_WIN32 +libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPPFLAGS += \ + -DXP_UNIX +endif + +libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LDFLAGS = \ + -version-info @LIBWEBKITGTK_VERSION@ \ + $(version_script) \ + $(no_undefined) + +libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LIBADD = \ + -lpthread \ + libJavaScriptCore.la \ + $(webcore_ldflags) \ + $(CAIRO_LIBS) \ + $(COVERAGE_LDFLAGS) \ + $(ENCHANT_LIBS) \ + $(FREETYPE_LIBS) \ + $(GAIL_LIBS) \ + $(GEOCLUE_LIBS) \ + $(GLIB_LIBS) \ + $(GSTREAMER_LIBS) \ + $(GTK_LIBS) \ + $(HILDON_LIBS) \ + $(JPEG_LIBS) \ + $(LIBSOUP_LIBS) \ + $(LIBXML_LIBS) \ + $(LIBXSLT_LIBS) \ + $(PANGO_LIBS) \ + $(PNG_LIBS) \ + $(SQLITE3_LIBS) \ + $(UNICODE_LIBS) \ + $(XT_LIBS) \ + $(WINMM_LIBS) \ + $(SHLWAPI_LIBS) \ + $(OLE32_LIBS) + +webkitgtk_static_h_api += \ + $(srcdir)/WebCore/platform/network/soup/cache/webkit/soup-cache.h \ + $(srcdir)/WebKit/gtk/webkit/webkit.h \ + $(srcdir)/WebKit/gtk/webkit/webkitdefines.h \ + $(srcdir)/WebKit/gtk/webkit/webkitdownload.h \ + $(srcdir)/WebKit/gtk/webkit/webkiterror.h \ + $(srcdir)/WebKit/gtk/webkit/webkitgeolocationpolicydecision.h \ + $(srcdir)/WebKit/gtk/webkit/webkithittestresult.h \ + $(srcdir)/WebKit/gtk/webkit/webkitnetworkrequest.h \ + $(srcdir)/WebKit/gtk/webkit/webkitnetworkresponse.h \ + $(srcdir)/WebKit/gtk/webkit/webkitsecurityorigin.h \ + $(srcdir)/WebKit/gtk/webkit/webkitsoupauthdialog.h \ + $(srcdir)/WebKit/gtk/webkit/webkitwebbackforwardlist.h \ + $(srcdir)/WebKit/gtk/webkit/webkitwebdatabase.h \ + $(srcdir)/WebKit/gtk/webkit/webkitwebdatasource.h \ + $(srcdir)/WebKit/gtk/webkit/webkitwebframe.h \ + $(srcdir)/WebKit/gtk/webkit/webkitwebhistoryitem.h \ + $(srcdir)/WebKit/gtk/webkit/webkitwebinspector.h \ + $(srcdir)/WebKit/gtk/webkit/webkitwebnavigationaction.h \ + $(srcdir)/WebKit/gtk/webkit/webkitwebpolicydecision.h \ + $(srcdir)/WebKit/gtk/webkit/webkitwebresource.h \ + $(srcdir)/WebKit/gtk/webkit/webkitwebsettings.h \ + $(srcdir)/WebKit/gtk/webkit/webkitwebwindowfeatures.h \ + $(srcdir)/WebKit/gtk/webkit/webkitwebview.h + +webkitgtk_built_h_api += \ + WebKit/gtk/webkit/webkitversion.h + +webkitgtk_h_api += \ + $(webkitgtk_built_h_api) \ + $(webkitgtk_static_h_api) + +# webkitenumtypes.{h,cpp} cannot be in webkitgtk_built_h_api, because +# the rule that builds it depends on webkitgtk_built_h_api (circular dependency). +webkitgtk_built_sources += \ + DerivedSources/webkit/webkitenumtypes.cpp \ + DerivedSources/webkit/webkitenumtypes.h \ + DerivedSources/webkit/webkitmarshal.cpp \ + DerivedSources/webkit/webkitmarshal.h \ + $(webkitgtk_built_h_api) \ + $(webkitgtk_gdom_built_sources) +BUILT_SOURCES += $(webkitgtk_built_sources) + +webkitgtk_sources += \ + WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \ + WebKit/gtk/WebCoreSupport/ChromeClientGtk.h \ + WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp \ + WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h \ + WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.cpp \ + WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.h \ + WebKit/gtk/WebCoreSupport/DragClientGtk.cpp \ + WebKit/gtk/WebCoreSupport/DragClientGtk.h \ + WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp \ + WebKit/gtk/WebCoreSupport/EditorClientGtk.h \ + WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp \ + WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h \ + WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp \ + WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h \ + WebKit/gtk/WebCoreSupport/FrameNetworkingContextGtk.h \ + WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp \ + WebKit/gtk/WebCoreSupport/FullscreenVideoController.h \ + WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp \ + WebKit/gtk/WebCoreSupport/InspectorClientGtk.h \ + WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp \ + WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h \ + WebKit/gtk/webkit/webkitapplicationcache.cpp \ + WebKit/gtk/webkit/webkitdownload.cpp \ + WebKit/gtk/webkit/webkiterror.cpp \ + WebKit/gtk/webkit/webkithittestresult.cpp \ + WebKit/gtk/webkit/webkitnetworkrequest.cpp \ + WebKit/gtk/webkit/webkitnetworkresponse.cpp \ + WebKit/gtk/webkit/webkitprivate.cpp \ + WebKit/gtk/webkit/webkitprivate.h \ + WebKit/gtk/webkit/webkitsoupauthdialog.c \ + WebKit/gtk/webkit/webkitversion.cpp \ + WebKit/gtk/webkit/webkitwebbackforwardlist.cpp \ + WebKit/gtk/webkit/webkitwebdatasource.cpp \ + WebKit/gtk/webkit/webkitwebframe.cpp \ + WebKit/gtk/webkit/webkitwebhistoryitem.cpp \ + WebKit/gtk/webkit/webkitwebinspector.cpp \ + WebKit/gtk/webkit/webkitwebnavigationaction.cpp \ + WebKit/gtk/webkit/webkitwebpolicydecision.cpp \ + WebKit/gtk/webkit/webkitgeolocationpolicydecision.cpp \ + WebKit/gtk/webkit/webkitwebresource.cpp \ + WebKit/gtk/webkit/webkitwebdatabase.cpp \ + WebKit/gtk/webkit/webkitsecurityorigin.cpp \ + WebKit/gtk/webkit/webkitwebsettings.cpp \ + WebKit/gtk/webkit/webkitwebview.cpp \ + WebKit/gtk/webkit/webkitwebwindowfeatures.cpp \ + WebKit/gtk/webkit/webkitworkers.cpp + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = WebKit/gtk/@WEBKITGTK_PC_NAME@-@WEBKITGTK_API_VERSION@.pc + +if ENABLE_INTROSPECTION + +JSCore-@WEBKITGTK_API_VERSION@.gir: $(builddir)/WebKit/gtk/JSCore-@WEBKITGTK_API_VERSION@.gir + $(AM_V_GEN)cp $(builddir)/WebKit/gtk/JSCore-@WEBKITGTK_API_VERSION@.gir $(builddir)/ + +JSCORE_GIRSOURCES += JSCore-@WEBKITGTK_API_VERSION@.gir +WEBKIT_GIRSOURCES += WebKit-@WEBKITGTK_API_VERSION@.gir + +$(WEBKIT_GIRSOURCES): $(G_IR_SCANNER) $(JSCORE_GIRSOURCES) libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la + $(AM_V_GEN)$(G_IR_SCANNER) -v --warn-all \ + --symbol-prefix=webkit \ + --identifier-prefix=WebKit \ + --namespace=WebKit \ + --nsversion=@WEBKITGTK_API_VERSION@ \ + --include=GObject-2.0 \ + --include=Gtk-@GTK_API_VERSION@ \ + --include=JSCore-@WEBKITGTK_API_VERSION@ \ + --include=Soup-2.4 \ + --library=webkitgtk-@WEBKITGTK_API_VERSION@ \ + --libtool="$(LIBTOOL)" \ + --pkg=gobject-2.0 \ + --pkg=gtk+-@GTK_API_VERSION@ \ + --pkg=libsoup-2.4 \ + --output=$@ \ + --add-include-path=$(WebKit) \ + --add-include-path=$(builddir) \ + -I$(top_srcdir)/WebCore/platform/network/soup/cache \ + -I$(WebKit) \ + -I$(GENSOURCES) \ + -I$(GENSOURCES_WEBKIT) \ + -I$(builddir)/WebKit/gtk \ + -I$(top_srcdir)/JavaScriptCore/ForwardingHeaders \ + -I$(top_srcdir) \ + $(GENSOURCES_WEBKIT)/webkitenumtypes.h \ + $(webkitgtk_h_api) \ + $(WebKit)/webkit/*.cpp \ + $(WebKit)/webkit/*.c + +girdir = $(datadir)/gir-1.0 +gir_DATA = $(WEBKIT_GIRSOURCES) $(JSCORE_GIRSOURCES) + +typelibsdir += $(libdir)/girepository-1.0 +typelibs_DATA += $(JSCORE_GIRSOURCES:.gir=.typelib) $(WEBKIT_GIRSOURCES:.gir=.typelib) + +%.typelib: %.gir $(G_IR_COMPILER) + $(AM_V_GEN)$(G_IR_COMPILER) --includedir $(WebKit) --includedir $(builddir) $< -o $@ + +CLEANFILES += $(JSCORE_GIRSOURCES) $(WEBKIT_GIRSOURCES) $(typelibs_DATA) + +endif + +EXTRA_DIST += $(builddir)/WebKit/gtk/JSCore-@WEBKITGTK_API_VERSION@.gir + +WEBKIT_MARSHAL_LIST = $(WebKit)/webkitmarshal.list +$(GENSOURCES_WEBKIT)/webkitmarshal.cpp: stamp-webkitmarshal.cpp + @true +$(GENSOURCES_WEBKIT)/webkitmarshal.h: stamp-webkitmarshal.h + @true + +stamp-webkitmarshal.cpp: $(WEBKIT_MARSHAL_LIST) + $(AM_V_GEN) echo "extern \"C\" {" > $(GENSOURCES_WEBKIT)/webkitmarshal.cpp && \ + $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --body >> $(GENSOURCES_WEBKIT)/webkitmarshal.cpp && \ + echo '}' >> $(GENSOURCES_WEBKIT)/webkitmarshal.cpp && \ + echo timestamp > $(@F) + +stamp-webkitmarshal.h: $(WEBKIT_MARSHAL_LIST) + $(AM_V_GEN)$(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --header > $(GENSOURCES_WEBKIT)/webkitmarshal.h && \ + echo timestamp > $(@F) + +$(GENSOURCES_WEBKIT)/webkitenumtypes.h: stamp-webkitenumtypes.h + @true +stamp-webkitenumtypes.h: $(webkitgtk_h_api) $(WebKit)/GNUmakefile.am + $(AM_V_GEN)glib-mkenums \ + --fhead "#ifndef WEBKIT_ENUM_TYPES_H\n" \ + --fhead "#define WEBKIT_ENUM_TYPES_H\n\n" \ + --fhead "#include <glib-object.h>\n\n" \ + --fhead "#include <webkit/webkitdefines.h>\n\n" \ + --fhead "G_BEGIN_DECLS\n\n" \ + --ftail "G_END_DECLS\n\n" \ + --ftail "#endif\n" \ + --fprod "#include <webkit/@basename@>\n\n" \ + --eprod "#define WEBKIT_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n\n" \ + --eprod "WEBKIT_API GType\n@enum_name@_get_type(void);\n\n" \ + $(webkitgtk_h_api) | \ + sed 's,web_kit,webkit,' | \ + sed 's,WEBKIT_TYPE_KIT,WEBKIT_TYPE,' \ + > xgen-gth \ + && (cmp -s xgen-gth $(GENSOURCES_WEBKIT)/webkitenumtypes.h || cp xgen-gth $(GENSOURCES_WEBKIT)/webkitenumtypes.h) \ + && rm -f xgen-gth \ + && echo timestamp > $(@F) + +$(GENSOURCES_WEBKIT)/webkitenumtypes.cpp: $(webkitgtk_h_api) $(WebKit)/GNUmakefile.am + $(AM_V_GEN)glib-mkenums \ + --fhead "#include <config.h>\n" \ + --fhead "#include <glib-object.h>\n" \ + --fhead "#include \"$(GENSOURCES_WEBKIT)/webkitenumtypes.h\"\n\n" \ + --fhead "extern \"C\" {\n\n" \ + --fprod "\n/* enumerations from \"@filename@\" */" \ + --vhead "static const G@Type@Value _@enum_name@_values[] = {" \ + --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ + --vtail " { 0, NULL, NULL }\n};\n\n" \ + --vtail "GType @enum_name@_get_type(void)\n{\n" \ + --vtail " static GType type = 0;\n\n" \ + --vtail " if (!type)\n" \ + --vtail " type = g_@type@_register_static(\"@EnumName@\", _@enum_name@_values);\n\n" \ + --vtail " return type;\n}\n\n" \ + --ftail "}\n" \ + $(webkitgtk_h_api) | \ + sed 's,web_kit,webkit,' \ + > xgen-gtc \ + && cp xgen-gtc $@ \ + && rm -f xgen-gtc + +# GSettings +if USE_GSETTINGS +gsettings_SCHEMAS = $(top_builddir)/WebKit/gtk/org.webkitgtk-@WEBKITGTK_API_VERSION@.gschema.xml +@GSETTINGS_RULES@ +endif + +EXTRA_DIST += \ + $(WebKit)/ChangeLog \ + $(WebKit)/NEWS \ + $(WebKit)/webkitmarshal.list \ + $(WebKit)/docs/GNUmakefile.* \ + $(WebKit)/docs/webkitenvironment.xml \ + $(WebKit)/docs/webkitgtk-docs.sgml \ + $(WebKit)/docs/webkitgtk-sections.txt \ + $(WebKit)/docs/version.xml.in \ + $(WebKit)/po/* \ + $(WebKit)/resources/* \ + $(WebKit)/tests/resources/* \ + $(WebKit)/tests/test_utils.h \ + $(WebKit)/org.webkitgtk.gschema.xml.in + +# extra resource files +resourcesdir = ${datadir}/webkit-@WEBKITGTK_API_VERSION@/resources +dist_resources_DATA = \ + $(shell ls $(srcdir)/WebKit/gtk/resources/*.html) + +# Build unit tests +noinst_PROGRAMS += $(TEST_PROGS) +webkit_tests_cflags = \ + -fno-strict-aliasing \ + -I$(srcdir)/JavaScriptCore/ForwardingHeaders \ + -I$(WebCore)/platform/network/soup/cache \ + -I$(WebKit) \ + -I$(GENSOURCES) \ + -I$(top_builddir)/WebKit/gtk \ + -I$(top_srcdir)/WebCore/bindings \ + -I$(top_srcdir)/WebCore/bindings/gobject \ + $(global_cppflags) \ + $(global_cflags) \ + $(GLIB_CFLAGS) \ + $(GTK_CFLAGS) \ + $(LIBSOUP_CFLAGS) + +webkit_tests_ldadd = \ + libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \ + $(GTK_LIBS) \ + $(GLIB_LIBS) \ + $(LIBSOUP_LIBS) + +webkit_tests_ldflags = \ + -no-install \ + -no-fast-install + +TEST_PROGS += \ + Programs/unittests/testdomdocument \ + Programs/unittests/testdomdomwindow \ + Programs/unittests/testdomnode \ + Programs/unittests/testhttpbackend \ + Programs/unittests/testloading \ + Programs/unittests/testglobals \ + Programs/unittests/testmimehandling \ + Programs/unittests/testnetworkrequest \ + Programs/unittests/testnetworkresponse \ + Programs/unittests/testwebframe \ + Programs/unittests/testwebbackforwardlist \ + Programs/unittests/testwebhistoryitem \ + Programs/unittests/testwindow \ + Programs/unittests/testdownload \ + Programs/unittests/testatk \ + Programs/unittests/testatkroles \ + Programs/unittests/testhittestresult \ + Programs/unittests/testwebsettings \ + Programs/unittests/testwebresource \ + Programs/unittests/testwebdatasource \ + Programs/unittests/testwebview \ + Programs/unittests/testkeyevents \ + Programs/unittests/testcopyandpaste + +# Add additional tests here +Programs_unittests_testdomdocument_SOURCES = WebKit/gtk/tests/testdomdocument.c +Programs_unittests_testdomdocument_CFLAGS = $(webkit_tests_cflags) +Programs_unittests_testdomdocument_LDADD = $(webkit_tests_ldadd) +Programs_unittests_testdomdocument_LDFLAGS = $(webkit_tests_ldflags) + +Programs_unittests_testdomdomwindow_SOURCES = WebKit/gtk/tests/testdomdomwindow.c +Programs_unittests_testdomdomwindow_CFLAGS = $(webkit_tests_cflags) +Programs_unittests_testdomdomwindow_LDADD = $(webkit_tests_ldadd) +Programs_unittests_testdomdomwindow_LDFLAGS = $(webkit_tests_ldflags) + +Programs_unittests_testdomnode_SOURCES = WebKit/gtk/tests/testdomnode.c +Programs_unittests_testdomnode_CFLAGS = $(webkit_tests_cflags) +Programs_unittests_testdomnode_LDADD = $(webkit_tests_ldadd) +Programs_unittests_testdomnode_LDFLAGS = $(webkit_tests_ldflags) + +Programs_unittests_testhttpbackend_SOURCES = WebKit/gtk/tests/testhttpbackend.c +Programs_unittests_testhttpbackend_CFLAGS = $(webkit_tests_cflags) +Programs_unittests_testhttpbackend_LDADD = $(webkit_tests_ldadd) +Programs_unittests_testhttpbackend_LDFLAGS = $(webkit_tests_ldflags) + +Programs_unittests_testglobals_SOURCES = WebKit/gtk/tests/testglobals.c +Programs_unittests_testglobals_CFLAGS = $(webkit_tests_cflags) +Programs_unittests_testglobals_LDADD = $(webkit_tests_ldadd) +Programs_unittests_testglobals_LDFLAGS = $(webkit_tests_ldflags) + +Programs_unittests_testloading_SOURCES = WebKit/gtk/tests/testloading.c +Programs_unittests_testloading_CFLAGS = $(webkit_tests_cflags) +Programs_unittests_testloading_LDADD = $(webkit_tests_ldadd) +Programs_unittests_testloading_LDFLAGS = $(webkit_tests_ldflags) + +Programs_unittests_testmimehandling_SOURCES = WebKit/gtk/tests/testmimehandling.c WebKit/gtk/tests/test_utils.c +Programs_unittests_testmimehandling_CFLAGS = $(webkit_tests_cflags) +Programs_unittests_testmimehandling_LDADD = $(webkit_tests_ldadd) +Programs_unittests_testmimehandling_LDFLAGS = $(webkit_tests_ldflags) + +Programs_unittests_testnetworkrequest_SOURCES = WebKit/gtk/tests/testnetworkrequest.c +Programs_unittests_testnetworkrequest_CFLAGS = $(webkit_tests_cflags) +Programs_unittests_testnetworkrequest_LDADD = $(webkit_tests_ldadd) +Programs_unittests_testnetworkrequest_LDFLAGS = $(webkit_tests_ldflags) + +Programs_unittests_testnetworkresponse_SOURCES = WebKit/gtk/tests/testnetworkresponse.c +Programs_unittests_testnetworkresponse_CFLAGS = $(webkit_tests_cflags) +Programs_unittests_testnetworkresponse_LDADD = $(webkit_tests_ldadd) +Programs_unittests_testnetworkresponse_LDFLAGS = $(webkit_tests_ldflags) + +Programs_unittests_testwebframe_SOURCES = WebKit/gtk/tests/testwebframe.c +Programs_unittests_testwebframe_CFLAGS = $(webkit_tests_cflags) +Programs_unittests_testwebframe_LDADD = $(webkit_tests_ldadd) +Programs_unittests_testwebframe_LDFLAGS = $(webkit_tests_ldflags) + +Programs_unittests_testwebbackforwardlist_SOURCES = WebKit/gtk/tests/testwebbackforwardlist.c +Programs_unittests_testwebbackforwardlist_CFLAGS = $(webkit_tests_cflags) +Programs_unittests_testwebbackforwardlist_LDADD = $(webkit_tests_ldadd) +Programs_unittests_testwebbackforwardlist_LDFLAGS = $(webkit_tests_ldflags) + +Programs_unittests_testwebhistoryitem_SOURCES = WebKit/gtk/tests/testwebhistoryitem.c +Programs_unittests_testwebhistoryitem_CFLAGS = $(webkit_tests_cflags) +Programs_unittests_testwebhistoryitem_LDADD = $(webkit_tests_ldadd) +Programs_unittests_testwebhistoryitem_LDFLAGS = $(webkit_tests_ldflags) + +Programs_unittests_testwindow_SOURCES = WebKit/gtk/tests/testwindow.c +Programs_unittests_testwindow_CFLAGS = $(webkit_tests_cflags) +Programs_unittests_testwindow_LDADD = $(webkit_tests_ldadd) +Programs_unittests_testwindow_LDFLAGS = $(webkit_tests_ldflags) + +Programs_unittests_testdownload_SOURCES = WebKit/gtk/tests/testdownload.c +Programs_unittests_testdownload_CFLAGS = $(webkit_tests_cflags) +Programs_unittests_testdownload_LDADD = $(webkit_tests_ldadd) +Programs_unittests_testdownload_LDFLAGS = $(webkit_tests_ldflags) + +Programs_unittests_testatk_SOURCES = WebKit/gtk/tests/testatk.c +Programs_unittests_testatk_CFLAGS = $(webkit_tests_cflags) +Programs_unittests_testatk_LDADD = $(webkit_tests_ldadd) +Programs_unittests_testatk_LDFLAGS = $(webkit_tests_ldflags) + +Programs_unittests_testatkroles_SOURCES = WebKit/gtk/tests/testatkroles.c +Programs_unittests_testatkroles_CFLAGS = $(webkit_tests_cflags) +Programs_unittests_testatkroles_LDADD = $(webkit_tests_ldadd) +Programs_unittests_testatkroles_LDFLAGS = $(webkit_tests_ldflags) + +Programs_unittests_testwebsettings_SOURCES = WebKit/gtk/tests/testwebsettings.c +Programs_unittests_testwebsettings_CFLAGS = $(webkit_tests_cflags) +Programs_unittests_testwebsettings_LDADD = $(webkit_tests_ldadd) +Programs_unittests_testwebsettings_LDFLAGS = $(webkit_tests_ldflags) + +Programs_unittests_testwebresource_SOURCES = WebKit/gtk/tests/testwebresource.c +Programs_unittests_testwebresource_CFLAGS = $(webkit_tests_cflags) +Programs_unittests_testwebresource_LDADD = $(webkit_tests_ldadd) + +Programs_unittests_testwebdatasource_SOURCES = WebKit/gtk/tests/testwebdatasource.c +Programs_unittests_testwebdatasource_CFLAGS = $(webkit_tests_cflags) +Programs_unittests_testwebdatasource_LDADD = $(webkit_tests_ldadd) + +Programs_unittests_testwebview_SOURCES = WebKit/gtk/tests/testwebview.c WebKit/gtk/tests/test_utils.c +Programs_unittests_testwebview_CFLAGS = $(webkit_tests_cflags) +Programs_unittests_testwebview_LDADD = $(webkit_tests_ldadd) +Programs_unittests_testwebview_LDFLAGS = $(webkit_tests_ldflags) + +Programs_unittests_testhittestresult_SOURCES = WebKit/gtk/tests/testhittestresult.c +Programs_unittests_testhittestresult_CFLAGS = $(webkit_tests_cflags) +Programs_unittests_testhittestresult_LDADD = $(webkit_tests_ldadd) + +Programs_unittests_testkeyevents_SOURCES = WebKit/gtk/tests/testkeyevents.c +Programs_unittests_testkeyevents_CFLAGS = $(webkit_tests_cflags) +Programs_unittests_testkeyevents_LDADD = $(webkit_tests_ldadd) +Programs_unittests_testkeyevents_LDFLAGS = $(webkit_tests_ldflags) + +Programs_unittests_testcopyandpaste_SOURCES = WebKit/gtk/tests/testcopyandpaste.c \ + WebCore/platform/gtk/GtkVersioning.c +Programs_unittests_testcopyandpaste_CFLAGS = $(webkit_tests_cflags) \ + -I$(srcdir)/WebCore/platform/gtk \ + -I$(srcdir)/WebCore +Programs_unittests_testcopyandpaste_LDADD = $(webkit_tests_ldadd) +Programs_unittests_testcopyandpaste_LDFLAGS = $(webkit_tests_ldflags) + +# Project-wide clean rules +# Files that will be cleaned +CLEANFILES += \ + $(BUILT_SOURCES) \ + $(top_builddir)/stamp-webkitmarshal.cpp \ + $(top_builddir)/stamp-webkitmarshal.h \ + $(top_builddir)/stamp-webkitenumtypes.cpp \ + $(top_builddir)/stamp-webkitenumtypes.h \ + $(top_builddir)/Programs/GtkLauncher + +DISTCLEANFILES += \ + $(top_builddir)/WebKit/gtk/docs/version.xml \ + $(top_builddir)/WebKit/gtk/docs/GNUmakefile \ + $(top_builddir)/WebKit/gtk/@WEBKITGTK_PC_NAME@-@WEBKITGTK_API_VERSION@.pc \ + $(top_builddir)/WebKit/gtk/org.webkitgtk-@WEBKITGTK_API_VERSION@.gschema.xml \ + $(top_builddir)/WebKit/gtk/webkit/webkitversion.h + +dist-hook: + cp $(WebKit)/NEWS $(distdir) +install-data-local: po-install-data-local +installdirs-data-local: po-installdirs-data-local +uninstall-local: po-uninstall-local + +# Run all tests in cwd +# FIXME: we should run this under xvfb +test: $(TEST_PROGS) + $(GTESTER) --verbose $(TEST_PROGS); + +# test-report: run tests in cwd and generate report +# full-report: run tests in cwd with -m perf and -m slow and generate report +# perf-report: run tests in cwd with -m perf and generate report +test-report full-report perf-report: $(TEST_PROGS) + @ case $@ in \ + test-report) test_options="-k";; \ + full-report) test_options="-k -m=perf";; \ + perf-report) test_options="-k -m=perf -m=slow";; \ + esac ; \ + $(GTESTER) --verbose $$test_options -o test-report.xml $(TEST_PROGS); \ + $(GTESTER_REPORT) test-report.xml > test-report.html ; + +.PHONY: test test-report perf-report full-report +check-local: test diff --git a/WebKit/gtk/NEWS b/WebKit/gtk/NEWS index ead8923..03db88b 100644 --- a/WebKit/gtk/NEWS +++ b/WebKit/gtk/NEWS @@ -1,4 +1,21 @@ ================ +WebKitGTK+ 1.3.7 +================ + +What's new in WebKitGTK+ 1.3.7? + + - Fix error pages template's not being filled properly. + - Fix context menu activation through keyboard. + - Add automatic garbage collection for most GObject DOM objects (all + those that are actually in the DOM tree). This gets rid of most of + the leaks when using the bindings. + - Add an Inspector API to inspect a DOM node. + - Tons of a11y bugfixes. + - Tons of fixes for the in-tree SoupCache, should work much better + now. + - Many other bugfixes. + +================ WebKitGTK+ 1.3.6 ================ diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp index d63317c..190ae9b 100644 --- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp @@ -26,10 +26,12 @@ #include "Console.h" #include "DumpRenderTreeSupportGtk.h" +#include "Element.h" #include "FileSystem.h" #include "FileChooser.h" #include "FloatRect.h" #include "FrameLoadRequest.h" +#include "FrameView.h" #include "GtkVersioning.h" #include "HTMLNames.h" #include "IntRect.h" @@ -520,6 +522,13 @@ void ChromeClient::mouseDidMoveOverElement(const HitTestResult& hit, unsigned mo g_signal_emit_by_name(m_webView, "hovering-over-link", 0, 0); m_hoveredLinkURL = KURL(); } + + if (Node* node = hit.innerNonSharedNode()) { + Frame* frame = node->document()->frame(); + FrameView* view = frame ? frame->view() : 0; + m_webView->priv->tooltipArea = view ? view->contentsToWindow(node->getRect()) : IntRect(); + } else + m_webView->priv->tooltipArea = IntRect(); } void ChromeClient::setToolTip(const String& toolTip, TextDirection) diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp index e04b5f9..da07e56 100644 --- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp @@ -38,6 +38,11 @@ #include "Page.h" #include "PasteboardHelperGtk.h" #include "PlatformKeyboardEvent.h" +#include "WebKitDOMBinding.h" +#include "WebKitDOMCSSStyleDeclarationPrivate.h" +#include "WebKitDOMHTMLElementPrivate.h" +#include "WebKitDOMNodePrivate.h" +#include "WebKitDOMRangePrivate.h" #include "WindowsKeyboardCodes.h" #include "webkitmarshal.h" #include "webkitprivate.h" @@ -267,15 +272,20 @@ void EditorClient::setInputMethodState(bool active) #endif } -bool EditorClient::shouldDeleteRange(Range*) +bool EditorClient::shouldDeleteRange(Range* range) { - notImplemented(); - return true; + gboolean accept = TRUE; + PlatformRefPtr<WebKitDOMRange> kitRange(adoptPlatformRef(kit(range))); + g_signal_emit_by_name(m_webView, "should-delete-range", kitRange.get(), &accept); + return accept; } -bool EditorClient::shouldShowDeleteInterface(HTMLElement*) +bool EditorClient::shouldShowDeleteInterface(HTMLElement* element) { - return false; + gboolean accept = TRUE; + PlatformRefPtr<WebKitDOMHTMLElement> kitElement(adoptPlatformRef(kit(element))); + g_signal_emit_by_name(m_webView, "should-show-delete-interface-for-element", kitElement.get(), &accept); + return accept; } bool EditorClient::isContinuousSpellCheckingEnabled() @@ -300,38 +310,77 @@ int EditorClient::spellCheckerDocumentTag() return 0; } -bool EditorClient::shouldBeginEditing(WebCore::Range*) +bool EditorClient::shouldBeginEditing(WebCore::Range* range) { clearPendingComposition(); - notImplemented(); - return true; + gboolean accept = TRUE; + PlatformRefPtr<WebKitDOMRange> kitRange(adoptPlatformRef(kit(range))); + g_signal_emit_by_name(m_webView, "should-begin-editing", kitRange.get(), &accept); + return accept; } -bool EditorClient::shouldEndEditing(WebCore::Range*) +bool EditorClient::shouldEndEditing(WebCore::Range* range) { clearPendingComposition(); - notImplemented(); - return true; + gboolean accept = TRUE; + PlatformRefPtr<WebKitDOMRange> kitRange(adoptPlatformRef(kit(range))); + g_signal_emit_by_name(m_webView, "should-end-editing", kitRange.get(), &accept); + return accept; } -bool EditorClient::shouldInsertText(const String&, Range*, EditorInsertAction) +static WebKitInsertAction kit(EditorInsertAction action) { - notImplemented(); - return true; + switch (action) { + case EditorInsertActionTyped: + return WEBKIT_INSERT_ACTION_TYPED; + case EditorInsertActionPasted: + return WEBKIT_INSERT_ACTION_PASTED; + case EditorInsertActionDropped: + return WEBKIT_INSERT_ACTION_DROPPED; + } + ASSERT_NOT_REACHED(); + return WEBKIT_INSERT_ACTION_TYPED; } -bool EditorClient::shouldChangeSelectedRange(Range*, Range*, EAffinity, bool) +bool EditorClient::shouldInsertText(const String& string, Range* range, EditorInsertAction action) { - notImplemented(); - return true; + gboolean accept = TRUE; + PlatformRefPtr<WebKitDOMRange> kitRange(adoptPlatformRef(kit(range))); + g_signal_emit_by_name(m_webView, "should-insert-text", string.utf8().data(), kitRange.get(), kit(action), &accept); + return accept; } -bool EditorClient::shouldApplyStyle(WebCore::CSSStyleDeclaration*, WebCore::Range*) +static WebKitSelectionAffinity kit(EAffinity affinity) { - notImplemented(); - return true; + switch (affinity) { + case UPSTREAM: + return WEBKIT_SELECTION_AFFINITY_UPSTREAM; + case DOWNSTREAM: + return WEBKIT_SELECTION_AFFINITY_DOWNSTREAM; + } + ASSERT_NOT_REACHED(); + return WEBKIT_SELECTION_AFFINITY_UPSTREAM; +} + +bool EditorClient::shouldChangeSelectedRange(Range* fromRange, Range* toRange, EAffinity affinity, bool stillSelecting) +{ + gboolean accept = TRUE; + PlatformRefPtr<WebKitDOMRange> kitFromRange(fromRange ? adoptPlatformRef(kit(fromRange)) : 0); + PlatformRefPtr<WebKitDOMRange> kitToRange(toRange ? adoptPlatformRef(kit(toRange)) : 0); + g_signal_emit_by_name(m_webView, "should-change-selected-range", kitFromRange.get(), kitToRange.get(), + kit(affinity), stillSelecting, &accept); + return accept; +} + +bool EditorClient::shouldApplyStyle(WebCore::CSSStyleDeclaration* declaration, WebCore::Range* range) +{ + gboolean accept = TRUE; + PlatformRefPtr<WebKitDOMCSSStyleDeclaration> kitDeclaration(kit(declaration)); + PlatformRefPtr<WebKitDOMRange> kitRange(adoptPlatformRef(kit(range))); + g_signal_emit_by_name(m_webView, "should-apply-style", kitDeclaration.get(), kitRange.get(), &accept); + return accept; } bool EditorClient::shouldMoveRangeAfterDelete(WebCore::Range*, WebCore::Range*) @@ -342,12 +391,12 @@ bool EditorClient::shouldMoveRangeAfterDelete(WebCore::Range*, WebCore::Range*) void EditorClient::didBeginEditing() { - notImplemented(); + g_signal_emit_by_name(m_webView, "editing-began"); } void EditorClient::respondToChangedContents() { - notImplemented(); + g_signal_emit_by_name(m_webView, "user-changed-contents"); } static WebKitWebView* viewSettingClipboard = 0; @@ -394,6 +443,8 @@ static void setSelectionPrimaryClipboardIfNeeded(WebKitWebView* webView) void EditorClient::respondToChangedSelection() { + g_signal_emit_by_name(m_webView, "selection-changed"); + WebKitWebViewPrivate* priv = m_webView->priv; WebCore::Page* corePage = core(m_webView); Frame* targetFrame = corePage->focusController()->focusedOrMainFrame(); @@ -422,7 +473,7 @@ void EditorClient::respondToChangedSelection() void EditorClient::didEndEditing() { - notImplemented(); + g_signal_emit_by_name(m_webView, "editing-ended"); } void EditorClient::didWriteSelectionToPasteboard() @@ -494,10 +545,13 @@ void EditorClient::redo() } } -bool EditorClient::shouldInsertNode(Node*, Range*, EditorInsertAction) +bool EditorClient::shouldInsertNode(Node* node, Range* range, EditorInsertAction action) { - notImplemented(); - return true; + gboolean accept = TRUE; + PlatformRefPtr<WebKitDOMRange> kitRange(adoptPlatformRef(kit(range))); + PlatformRefPtr<WebKitDOMNode> kitNode(adoptPlatformRef(kit(node))); + g_signal_emit_by_name(m_webView, "should-insert-node", kitNode.get(), kitRange.get(), kit(action), &accept); + return accept; } void EditorClient::pageDestroyed() @@ -954,7 +1008,7 @@ bool EditorClient::spellingUIIsShowing() return false; } -void EditorClient::getGuessesForWord(const String& word, WTF::Vector<String>& guesses) +void EditorClient::getGuessesForWord(const String& word, const String& context, WTF::Vector<String>& guesses) { GSList* dicts = webkit_web_settings_get_enchant_dicts(m_webView); guesses.clear(); diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.h b/WebKit/gtk/WebCoreSupport/EditorClientGtk.h index f9ff82e..22543c6 100644 --- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.h +++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.h @@ -129,7 +129,7 @@ namespace WebKit { virtual void updateSpellingUIWithMisspelledWord(const WTF::String&); virtual void showSpellingUI(bool show); virtual bool spellingUIIsShowing(); - virtual void getGuessesForWord(const WTF::String&, WTF::Vector<WTF::String>& guesses); + virtual void getGuessesForWord(const WTF::String& word, const WTF::String& context, WTF::Vector<WTF::String>& guesses); virtual void willSetInputMethodState(); virtual void setInputMethodState(bool enabled); diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp index b23bd70..fdef9dc 100644 --- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp @@ -28,6 +28,7 @@ #include "ArchiveResource.h" #include "CachedFrame.h" #include "Color.h" +#include "DOMObjectCache.h" #include "DocumentLoader.h" #include "DocumentLoaderGtk.h" #include "FormState.h" @@ -696,9 +697,10 @@ void FrameLoaderClient::registerForIconNotification(bool shouldRegister) notImplemented(); } -void FrameLoaderClient::setMainFrameDocumentReady(bool) +void FrameLoaderClient::setMainFrameDocumentReady(bool ready) { - // this is only interesting once we provide an external API for the DOM + if (!ready) + DOMObjectCache::clearByFrame(core(m_frame)); } bool FrameLoaderClient::hasWebView() const diff --git a/WebKit/gtk/tests/testatk.c b/WebKit/gtk/tests/testatk.c index 509cb86..abd6091 100644 --- a/WebKit/gtk/tests/testatk.c +++ b/WebKit/gtk/tests/testatk.c @@ -44,6 +44,8 @@ static const char* contentsInTable = "<html><body><table><tr><td>foo</td><td>bar static const char* contentsInTableWithHeaders = "<html><body><table><tr><th>foo</th><th>bar</th><th colspan='2'>baz</th></tr><tr><th>qux</th><td>1</td><td>2</td><td>3</td></tr><tr><th rowspan='2'>quux</th><td>4</td><td>5</td><td>6</td></tr><tr><td>6</td><td>7</td><td>8</td></tr><tr><th>corge</th><td>9</td><td>10</td><td>11</td></tr></table><table><tr><td>1</td><td>2</td></tr><tr><td>3</td><td>4</td></tr></table></body></html>"; +static const char* comboBoxSelector = "<html><body><select><option selected value='foo'>foo</option><option value='bar'>bar</option></select></body></html>"; + static const char* formWithTextInputs = "<html><body><form><input type='text' name='entry' /></form></body></html>"; static const char* hypertextAndHyperlinks = "<html><body><p>A paragraph with no links at all</p><p><a href='http://foo.bar.baz/'>A line</a> with <a href='http://bar.baz.foo/'>a link in the middle</a> as well as at the beginning and <a href='http://baz.foo.bar/'>at the end</a></p></body></html>"; @@ -221,6 +223,107 @@ static void runGetTextTests(AtkText* textObject) 0, "This is a test. This is the second sentence. And this the third.", 0, 64); } +static void testWebkitAtkComboBox() +{ + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + g_object_ref_sink(webView); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, comboBoxSelector, 0, 0, 0); + + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); + + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); + + AtkObject* formObject = atk_object_ref_accessible_child(object, 0); + g_assert(formObject); + + AtkObject* comboBox = atk_object_ref_accessible_child(formObject, 0); + g_assert(ATK_IS_OBJECT(comboBox)); + + AtkObject* menuPopup = atk_object_ref_accessible_child(comboBox, 0); + g_assert(ATK_IS_OBJECT(menuPopup)); + + AtkObject* item1 = atk_object_ref_accessible_child(menuPopup, 0); + g_assert(ATK_IS_OBJECT(item1)); + + AtkObject* item2 = atk_object_ref_accessible_child(menuPopup, 1); + g_assert(ATK_IS_OBJECT(item2)); + + /* Check roles. */ + g_assert(atk_object_get_role(comboBox) == ATK_ROLE_COMBO_BOX); + g_assert(atk_object_get_role(menuPopup) == ATK_ROLE_MENU); + g_assert(atk_object_get_role(item1) == ATK_ROLE_MENU_ITEM); + g_assert(atk_object_get_role(item2) == ATK_ROLE_MENU_ITEM); + + /* Check the implementation of the AtkSelection interface. */ + g_assert(ATK_IS_SELECTION(comboBox)); + AtkSelection* atkSelection = ATK_SELECTION(comboBox); + g_assert_cmpint(atk_selection_get_selection_count(atkSelection), ==, 1); + g_assert(atk_selection_is_child_selected(atkSelection, 0)); + g_assert(!atk_selection_is_child_selected(atkSelection, 1)); + AtkObject* selectedItem = atk_selection_ref_selection(atkSelection, 0); + g_assert(selectedItem == item1); + g_object_unref(selectedItem); + + /* Check the implementations of the AtkAction interface. */ + g_assert(ATK_IS_ACTION(comboBox)); + AtkAction* atkAction = ATK_ACTION(comboBox); + g_assert_cmpint(atk_action_get_n_actions(atkAction), ==, 1); + g_assert(atk_action_do_action(atkAction, 0)); + + g_assert(ATK_IS_ACTION(menuPopup)); + atkAction = ATK_ACTION(menuPopup); + g_assert_cmpint(atk_action_get_n_actions(atkAction), ==, 1); + g_assert(atk_action_do_action(atkAction, 0)); + + g_assert(ATK_IS_ACTION(item1)); + atkAction = ATK_ACTION(item1); + g_assert_cmpint(atk_action_get_n_actions(atkAction), ==, 1); + g_assert(atk_action_do_action(atkAction, 0)); + + g_assert(ATK_IS_ACTION(item2)); + atkAction = ATK_ACTION(item2); + g_assert_cmpint(atk_action_get_n_actions(atkAction), ==, 1); + g_assert(atk_action_do_action(atkAction, 0)); + + /* After selecting the second item, selection should have changed. */ + g_assert_cmpint(atk_selection_get_selection_count(atkSelection), ==, 1); + g_assert(!atk_selection_is_child_selected(atkSelection, 0)); + g_assert(atk_selection_is_child_selected(atkSelection, 1)); + selectedItem = atk_selection_ref_selection(atkSelection, 0); + g_assert(selectedItem == item2); + g_object_unref(selectedItem); + + /* Check the implementation of the AtkText interface. */ + g_assert(ATK_IS_TEXT(item1)); + AtkText* atkText = ATK_TEXT(item1); + char *text = atk_text_get_text(atkText, 0, -1); + g_assert_cmpstr(text, ==, "foo"); + g_free(text); + text = atk_text_get_text(atkText, 0, 2); + g_assert_cmpstr(text, ==, "fo"); + g_free(text); + + g_assert(ATK_IS_TEXT(item2)); + atkText = ATK_TEXT(item2); + text = atk_text_get_text(atkText, 0, -1); + g_assert_cmpstr(text, ==, "bar"); + g_free(text); + text = atk_text_get_text(atkText, 1, 3); + g_assert_cmpstr(text, ==, "ar"); + g_free(text); + + g_object_unref(formObject); + g_object_unref(comboBox); + g_object_unref(menuPopup); + g_object_unref(item1); + g_object_unref(item2); + g_object_unref(webView); +} + static void testWebkitAtkGetTextAtOffsetForms() { WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); @@ -776,6 +879,16 @@ static void testWebkitAtkTextSelections() g_assert_cmpstr(selectedText, ==, "a li"); g_free (selectedText); + /* Make a selection after the link and check selection for the whole paragraph. */ + result = atk_text_set_selection(paragraph2, 0, 27, 37); + g_assert(result); + g_assert_cmpint(atk_text_get_n_selections(paragraph2), ==, 1); + selectedText = atk_text_get_selection(paragraph2, 0, &startOffset, &endOffset); + g_assert_cmpint(startOffset, ==, 27); + g_assert_cmpint(endOffset, ==, 37); + g_assert_cmpstr(selectedText, ==, "the middle"); + g_free (selectedText); + /* Remove selections and text everything again. */ result = atk_text_remove_selection(paragraph2, 0); g_assert(result); @@ -1201,6 +1314,7 @@ int main(int argc, char** argv) gtk_test_init(&argc, &argv, 0); g_test_bug_base("https://bugs.webkit.org/"); + g_test_add_func("/webkit/atk/comboBox", testWebkitAtkComboBox); g_test_add_func("/webkit/atk/getTextAtOffset", testWebkitAtkGetTextAtOffset); g_test_add_func("/webkit/atk/getTextAtOffsetForms", testWebkitAtkGetTextAtOffsetForms); g_test_add_func("/webkit/atk/getTextAtOffsetNewlines", testWebkitAtkGetTextAtOffsetNewlines); diff --git a/WebKit/gtk/tests/testdomdocument.c b/WebKit/gtk/tests/testdomdocument.c index ec2f579..56e233f 100644 --- a/WebKit/gtk/tests/testdomdocument.c +++ b/WebKit/gtk/tests/testdomdocument.c @@ -30,7 +30,8 @@ #define HTML_DOCUMENT_ELEMENTS "<html><body><ul><li>1</li><li>2</li><li>3</li></ul></body></html>" #define HTML_DOCUMENT_ELEMENTS_CLASS "<html><body><div class=\"test\"></div><div class=\"strange\"></div><div class=\"test\"></div></body></html>" #define HTML_DOCUMENT_ELEMENTS_ID "<html><body><div id=\"testok\"></div><div id=\"testbad\">first</div><div id=\"testbad\">second</div></body></html>" -#define HTML_DOCUMENT_LINKS "<html><body><a href=\"about:blank\">blank</a><a href=\"http://www.google.com\">google</a><a href=\"http://www.webkit.org\">webkit</a></body></html>" +#define HTML_DOCUMENT_LINKS "<html><head><title>Title</title></head><body><a href=\"about:blank\">blank</a><a href=\"http://www.google.com\">google</a><a href=\"http://www.webkit.org\">webkit</a></body></html>" +#define HTML_DOCUMENT_IFRAME "<html><head><title>IFrame</title></head><body><iframe id='iframe'></iframe><div id='test'></div></body></html>" typedef struct { GtkWidget* webView; @@ -60,7 +61,8 @@ static void dom_document_fixture_setup(DomDocumentFixture* fixture, gconstpointe static void dom_document_fixture_teardown(DomDocumentFixture* fixture, gconstpointer data) { - g_object_unref(fixture->webView); + if (fixture->webView) + g_object_unref(fixture->webView); g_main_loop_unref(fixture->loop); } @@ -107,6 +109,8 @@ static void test_dom_document_get_elements_by_tag_name(DomDocumentFixture* fixtu g_assert_cmpstr(webkit_dom_html_element_get_inner_text(htmlElement), ==, n); g_free(n); } + + g_object_unref(list); } static void test_dom_document_get_elements_by_class_name(DomDocumentFixture* fixture, gconstpointer data) @@ -130,6 +134,8 @@ static void test_dom_document_get_elements_by_class_name(DomDocumentFixture* fix g_assert(element); g_assert_cmpstr(webkit_dom_element_get_tag_name(element), ==, "DIV"); } + + g_object_unref(list); } static void test_dom_document_get_element_by_id(DomDocumentFixture* fixture, gconstpointer data) @@ -178,6 +184,137 @@ static void test_dom_document_get_links(DomDocumentFixture* fixture, gconstpoint WebKitDOMHTMLAnchorElement *anchor = (WebKitDOMHTMLAnchorElement*)element; g_assert_cmpstr(webkit_dom_html_anchor_element_get_href(anchor), ==, uris[i]); } + g_object_unref(collection); +} + +static void weak_notify(gpointer data, GObject* zombie) +{ + guint* count = (guint*)data; + (*count)++; +} + +static void test_dom_document_garbage_collection(DomDocumentFixture* fixture, gconstpointer data) +{ + guint count = 0; + g_assert(fixture); + WebKitWebView* view = (WebKitWebView*)fixture->webView; + g_assert(view); + WebKitDOMDocument* document = webkit_web_view_get_dom_document(view); + g_assert(document); + g_object_weak_ref(G_OBJECT(document), (GWeakNotify)weak_notify, &count); + WebKitDOMHTMLHeadElement* head = webkit_dom_document_get_head(document); + g_assert(head); + g_object_weak_ref(G_OBJECT(head), (GWeakNotify)weak_notify, &count); + WebKitDOMHTMLElement* body = webkit_dom_document_get_body(document); + g_assert(body); + g_object_weak_ref(G_OBJECT(body), (GWeakNotify)weak_notify, &count); + WebKitDOMHTMLCollection *collection = webkit_dom_document_get_links(document); + g_assert(collection); + g_object_weak_ref(G_OBJECT(collection), (GWeakNotify)weak_notify, &count); + + webkit_web_view_load_string(WEBKIT_WEB_VIEW(view), HTML_DOCUMENT_LINKS, NULL, NULL, NULL); + + while (g_main_context_pending(NULL)) + g_main_context_iteration(NULL, FALSE); + + g_assert_cmpuint(count, ==, 3); + + g_object_unref(collection); + g_assert_cmpuint(count, ==, 4); + + count = 0; + + document = webkit_web_view_get_dom_document(view); + g_assert(document); + g_object_weak_ref(G_OBJECT(document), (GWeakNotify)weak_notify, &count); + head = webkit_dom_document_get_head(document); + g_assert(head); + g_object_weak_ref(G_OBJECT(head), (GWeakNotify)weak_notify, &count); + body = webkit_dom_document_get_body(document); + g_assert(body); + g_object_weak_ref(G_OBJECT(body), (GWeakNotify)weak_notify, &count); + collection = webkit_dom_document_get_links(document); + g_assert(collection); + g_object_weak_ref(G_OBJECT(collection), (GWeakNotify)weak_notify, &count); + /* Ask twice for the same object */ + WebKitDOMHTMLCollection* collection2 = webkit_dom_document_get_links(document); + g_assert(collection2); + g_object_weak_ref(G_OBJECT(collection2), (GWeakNotify)weak_notify, &count); + + g_object_unref(document); + g_object_unref(head); + g_object_unref(body); + g_object_unref(collection); + g_object_unref(collection2); + + g_assert_cmpuint(count, ==, 5); + + webkit_web_view_load_string(WEBKIT_WEB_VIEW(view), HTML_DOCUMENT_IFRAME, NULL, NULL, NULL); + + while (g_main_context_pending(NULL)) + g_main_context_iteration(NULL, FALSE); + + count = 0; + + document = webkit_web_view_get_dom_document(view); + WebKitDOMElement* div = webkit_dom_document_get_element_by_id(document, "test"); + g_assert(div); + g_object_weak_ref(G_OBJECT(div), (GWeakNotify)weak_notify, &count); + WebKitDOMElement* iframe = webkit_dom_document_get_element_by_id(document, "iframe"); + g_assert(iframe); + + webkit_dom_element_set_attribute(iframe, "src", "data:<html><head></head></html>", NULL); + + while (g_main_context_pending(NULL)) + g_main_context_iteration(NULL, FALSE); + + WebKitDOMDocument* iframeDocument = webkit_dom_html_iframe_element_get_content_document(WEBKIT_DOM_HTML_IFRAME_ELEMENT(iframe)); + g_assert(iframeDocument); + head = webkit_dom_document_get_head(iframeDocument); + g_assert(head); + g_object_weak_ref(G_OBJECT(head), (GWeakNotify)weak_notify, &count); + + webkit_dom_element_set_attribute(iframe, "src", "about:blank", NULL); + + while (g_main_context_pending(NULL)) + g_main_context_iteration(NULL, FALSE); + + g_assert_cmpuint(count, ==, 1); + + webkit_web_view_load_string(WEBKIT_WEB_VIEW(view), HTML_DOCUMENT_LINKS, NULL, NULL, NULL); + + while (g_main_context_pending(NULL)) + g_main_context_iteration(NULL, FALSE); + + g_assert_cmpuint(count, ==, 2); + + count = 0; + + document = webkit_web_view_get_dom_document(view); + g_assert(document); + g_object_weak_ref(G_OBJECT(document), (GWeakNotify)weak_notify, &count); + /* Ask twice for the Document */ + WebKitDOMDocument* document2 = webkit_web_view_get_dom_document(view); + g_assert(document2); + g_object_weak_ref(G_OBJECT(document2), (GWeakNotify)weak_notify, &count); + head = webkit_dom_document_get_head(document); + g_assert(head); + g_object_weak_ref(G_OBJECT(head), (GWeakNotify)weak_notify, &count); + body = webkit_dom_document_get_body(document); + g_assert(body); + g_object_weak_ref(G_OBJECT(body), (GWeakNotify)weak_notify, &count); + collection = webkit_dom_document_get_links(document); + g_assert(collection); + g_object_weak_ref(G_OBJECT(collection), (GWeakNotify)weak_notify, &count); + + gtk_widget_destroy(fixture->webView); + fixture->webView = NULL; + + g_assert_cmpuint(count, ==, 4); + + g_object_unref(collection); + + g_assert_cmpuint(count, ==, 5); } int main(int argc, char** argv) @@ -219,6 +356,12 @@ int main(int argc, char** argv) test_dom_document_get_links, dom_document_fixture_teardown); + g_test_add("/webkit/domdocument/test_garbage_collection", + DomDocumentFixture, HTML_DOCUMENT_LINKS, + dom_document_fixture_setup, + test_dom_document_garbage_collection, + dom_document_fixture_teardown); + return g_test_run(); } diff --git a/WebKit/gtk/tests/testdomnode.c b/WebKit/gtk/tests/testdomnode.c index c6056d6..7d62720 100644 --- a/WebKit/gtk/tests/testdomnode.c +++ b/WebKit/gtk/tests/testdomnode.c @@ -84,6 +84,7 @@ static void test_dom_node_hierarchy_navigation(DomNodeFixture* fixture, gconstpo ptr = webkit_dom_node_list_item(list, 0); g_assert(ptr); g_assert(WEBKIT_DOM_IS_HTML_TITLE_ELEMENT(ptr)); + g_object_unref(list); /* Body, Head sibling */ ptr = webkit_dom_node_get_next_sibling(WEBKIT_DOM_NODE(head)); @@ -118,6 +119,7 @@ static void test_dom_node_hierarchy_navigation(DomNodeFixture* fixture, gconstpo /* Nothing */; g_assert_cmpint(i, ==, 3); + g_object_unref(list); } static void test_dom_node_insertion(DomNodeFixture* fixture, gconstpointer data) @@ -148,6 +150,7 @@ static void test_dom_node_insertion(DomNodeFixture* fixture, gconstpointer data) node = webkit_dom_node_list_item(list, 0); g_assert(node); g_assert(webkit_dom_node_is_same_node(WEBKIT_DOM_NODE(p), node)); + g_object_unref(list); /* Replace the P tag with a DIV tag */ div = webkit_dom_document_create_element(document, "DIV", NULL); @@ -158,11 +161,13 @@ static void test_dom_node_insertion(DomNodeFixture* fixture, gconstpointer data) node = webkit_dom_node_list_item(list, 0); g_assert(node); g_assert(webkit_dom_node_is_same_node(WEBKIT_DOM_NODE(div), node)); + g_object_unref(list); /* Now remove the tag */ webkit_dom_node_remove_child(WEBKIT_DOM_NODE(body), node, NULL); list = webkit_dom_node_get_child_nodes(WEBKIT_DOM_NODE(body)); g_assert_cmpint(webkit_dom_node_list_get_length(list), ==, 0); + g_object_unref(list); /* TODO: insert_before, which does not seem to be working correctly */ } diff --git a/WebKit/gtk/webkit/webkithittestresult.cpp b/WebKit/gtk/webkit/webkithittestresult.cpp index 862d94a..931289e 100644 --- a/WebKit/gtk/webkit/webkithittestresult.cpp +++ b/WebKit/gtk/webkit/webkithittestresult.cpp @@ -71,6 +71,13 @@ static void webkit_hit_test_result_finalize(GObject* object) G_OBJECT_CLASS(webkit_hit_test_result_parent_class)->finalize(object); } +static void webkit_hit_test_result_dispose(GObject* object) +{ + g_object_unref(WEBKIT_HIT_TEST_RESULT(object)->priv->innerNode); + + G_OBJECT_CLASS(webkit_hit_test_result_parent_class)->dispose(object); +} + static void webkit_hit_test_result_get_property(GObject* object, guint propertyID, GValue* value, GParamSpec* pspec) { WebKitHitTestResult* web_hit_test_result = WEBKIT_HIT_TEST_RESULT(object); @@ -131,6 +138,7 @@ static void webkit_hit_test_result_class_init(WebKitHitTestResultClass* webHitTe GObjectClass* objectClass = G_OBJECT_CLASS(webHitTestResultClass); objectClass->finalize = webkit_hit_test_result_finalize; + objectClass->dispose = webkit_hit_test_result_dispose; objectClass->get_property = webkit_hit_test_result_get_property; objectClass->set_property = webkit_hit_test_result_set_property; diff --git a/WebKit/gtk/webkit/webkitprivate.cpp b/WebKit/gtk/webkit/webkitprivate.cpp index aa3d3da..4ec6362 100644 --- a/WebKit/gtk/webkit/webkitprivate.cpp +++ b/WebKit/gtk/webkit/webkitprivate.cpp @@ -24,6 +24,7 @@ #include "ApplicationCacheStorage.h" #include "Chrome.h" #include "ChromeClientGtk.h" +#include "Element.h" #include "Frame.h" #include "FrameLoader.h" #include "FrameLoaderClientGtk.h" @@ -173,7 +174,7 @@ WebKitHitTestResult* kit(const WebCore::HitTestResult& result) context |= WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE; if (result.innerNonSharedNode()) - node = static_cast<WebKitDOMNode*>(kit(result.innerNonSharedNode())); + node = kit(result.innerNonSharedNode()); return WEBKIT_HIT_TEST_RESULT(g_object_new(WEBKIT_TYPE_HIT_TEST_RESULT, "link-uri", linkURI.get(), diff --git a/WebKit/gtk/webkit/webkitprivate.h b/WebKit/gtk/webkit/webkitprivate.h index 7385677..e090ed4 100644 --- a/WebKit/gtk/webkit/webkitprivate.h +++ b/WebKit/gtk/webkit/webkitprivate.h @@ -55,6 +55,7 @@ #include "HistoryItem.h" #include "InspectorClientGtk.h" #include "IntPoint.h" +#include "IntRect.h" #include "FrameLoaderClient.h" #include "FullscreenVideoController.h" #include "Node.h" @@ -181,6 +182,7 @@ extern "C" { CString mainResourceIdentifier; PlatformRefPtr<GHashTable> subResources; CString tooltipText; + WebCore::IntRect tooltipArea; int currentClickCount; WebCore::IntPoint previousClickPoint; diff --git a/WebKit/gtk/webkit/webkitwebdatasource.cpp b/WebKit/gtk/webkit/webkitwebdatasource.cpp index 38c9c48..3673a99 100644 --- a/WebKit/gtk/webkit/webkitwebdatasource.cpp +++ b/WebKit/gtk/webkit/webkitwebdatasource.cpp @@ -318,7 +318,7 @@ G_CONST_RETURN gchar* webkit_web_data_source_get_encoding(WebKitWebDataSource* w */ gboolean webkit_web_data_source_is_loading(WebKitWebDataSource* webDataSource) { - g_return_val_if_fail(WEBKIT_IS_WEB_DATA_SOURCE(webDataSource), NULL); + g_return_val_if_fail(WEBKIT_IS_WEB_DATA_SOURCE(webDataSource), FALSE); WebKitWebDataSourcePrivate* priv = webDataSource->priv; diff --git a/WebKit/gtk/webkit/webkitwebframe.cpp b/WebKit/gtk/webkit/webkitwebframe.cpp index 63a2413..0e0c3c6 100644 --- a/WebKit/gtk/webkit/webkitwebframe.cpp +++ b/WebKit/gtk/webkit/webkitwebframe.cpp @@ -35,6 +35,7 @@ #include "AccessibilityObjectWrapperAtk.h" #include "AnimationController.h" #include "AXObjectCache.h" +#include "DOMObjectCache.h" #include "DocumentLoader.h" #include "DocumentLoaderGtk.h" #include "FrameLoader.h" @@ -146,7 +147,10 @@ static void webkit_web_frame_get_property(GObject* object, guint prop_id, GValue void webkit_web_frame_core_frame_gone(WebKitWebFrame* frame) { ASSERT(WEBKIT_IS_WEB_FRAME(frame)); - frame->priv->coreFrame = 0; + WebKitWebFramePrivate* priv = frame->priv; + if (priv->coreFrame) + DOMObjectCache::clearByFrame(priv->coreFrame); + priv->coreFrame = 0; } static WebKitWebDataSource* webkit_web_frame_get_data_source_from_core_loader(WebCore::DocumentLoader* loader) @@ -160,6 +164,7 @@ static void webkit_web_frame_finalize(GObject* object) WebKitWebFramePrivate* priv = frame->priv; if (priv->coreFrame) { + DOMObjectCache::clearByFrame(priv->coreFrame); priv->coreFrame->loader()->cancelAndClear(); priv->coreFrame = 0; } @@ -842,7 +847,7 @@ gchar* webkit_web_frame_counter_value_for_element_by_id(WebKitWebFrame* frame, c */ int webkit_web_frame_page_number_for_element_by_id(WebKitWebFrame* frame, const gchar* id, float pageWidth, float pageHeight) { - g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), NULL); + g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), 0); Frame* coreFrame = core(frame); if (!coreFrame) @@ -864,7 +869,7 @@ int webkit_web_frame_page_number_for_element_by_id(WebKitWebFrame* frame, const */ int webkit_web_frame_number_of_pages(WebKitWebFrame* frame, float pageWidth, float pageHeight) { - g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), NULL); + g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), 0); Frame* coreFrame = core(frame); if (!coreFrame) diff --git a/WebKit/gtk/webkit/webkitwebinspector.cpp b/WebKit/gtk/webkit/webkitwebinspector.cpp index f207906..626df32 100644 --- a/WebKit/gtk/webkit/webkitwebinspector.cpp +++ b/WebKit/gtk/webkit/webkitwebinspector.cpp @@ -32,6 +32,7 @@ #include "Page.h" #include "RenderLayer.h" #include "RenderView.h" +#include "webkit/WebKitDOMNodePrivate.h" #include "webkitmarshal.h" #include "webkitprivate.h" @@ -499,6 +500,23 @@ void webkit_web_inspector_show(WebKitWebInspector* webInspector) } /** + * webkit_web_inspector_inspect_node: + * @web_inspector: the #WebKitWebInspector that will do the inspection + * @node: the #WebKitDOMNode to inspect + * + * Causes the Web Inspector to inspect the given node. + * + * Since: 1.3.7 + */ +void webkit_web_inspector_inspect_node(WebKitWebInspector* webInspector, WebKitDOMNode* node) +{ + g_return_if_fail(WEBKIT_IS_WEB_INSPECTOR(webInspector)); + g_return_if_fail(WEBKIT_DOM_IS_NODE(node)); + + webInspector->priv->page->inspectorController()->inspect(core(node)); +} + +/** * webkit_web_inspector_inspect_coordinates: * @web_inspector: the #WebKitWebInspector that will do the inspection * @x: the X coordinate of the node to be inspected diff --git a/WebKit/gtk/webkit/webkitwebinspector.h b/WebKit/gtk/webkit/webkitwebinspector.h index bde4854..458e370 100644 --- a/WebKit/gtk/webkit/webkitwebinspector.h +++ b/WebKit/gtk/webkit/webkitwebinspector.h @@ -22,6 +22,7 @@ #include <glib-object.h> +#include <webkit/webkitdomdefines.h> #include <webkit/webkitdefines.h> G_BEGIN_DECLS @@ -61,6 +62,9 @@ WEBKIT_API const gchar* webkit_web_inspector_get_inspected_uri(WebKitWebInspector* web_inspector); WEBKIT_API void +webkit_web_inspector_inspect_node(WebKitWebInspector* webInspector, WebKitDOMNode* node); + +WEBKIT_API void webkit_web_inspector_inspect_coordinates(WebKitWebInspector* web_inspector, gdouble x, gdouble y); WEBKIT_API void diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp index 0dc19f3..90be935 100644 --- a/WebKit/gtk/webkit/webkitwebview.cpp +++ b/WebKit/gtk/webkit/webkitwebview.cpp @@ -173,6 +173,19 @@ enum { GEOLOCATION_POLICY_DECISION_CANCELLED, ONLOAD_EVENT, FRAME_CREATED, + + SHOULD_BEGIN_EDITING, + SHOULD_END_EDITING, + SHOULD_INSERT_NODE, + SHOULD_INSERT_TEXT, + SHOULD_DELETE_RANGE, + SHOULD_SHOW_DELETE_INTERFACE_FOR_ELEMENT, + SHOULD_CHANGE_SELECTED_RANGE, + SHOULD_APPLY_STYLE, + EDITING_BEGAN, + USER_CHANGED_CONTENTS, + EDITING_ENDED, + LAST_SIGNAL }; @@ -1311,6 +1324,11 @@ static void webkit_web_view_real_paste_clipboard(WebKitWebView* webView) frame->editor()->command("Paste").execute(); } +static gboolean webkit_web_view_real_should_allow_editing_action(WebKitWebView*) +{ + return TRUE; +} + static void webkit_web_view_dispose(GObject* object) { WebKitWebView* webView = WEBKIT_WEB_VIEW(object); @@ -1636,13 +1654,58 @@ static gboolean webkit_web_view_query_tooltip(GtkWidget *widget, gint x, gint y, { WebKitWebViewPrivate* priv = WEBKIT_WEB_VIEW_GET_PRIVATE(widget); + if (keyboard_mode) { + WebKitWebView* webView = WEBKIT_WEB_VIEW(widget); + + // Get the title of the current focused element. + Frame* coreFrame = core(webView)->focusController()->focusedOrMainFrame(); + if (!coreFrame) + return FALSE; + + Node* node = getFocusedNode(coreFrame); + if (!node) + return FALSE; + + for (Node* titleNode = node; titleNode; titleNode = titleNode->parentNode()) { + if (titleNode->isElementNode()) { + String title = static_cast<Element*>(titleNode)->title(); + if (!title.isEmpty()) { + if (FrameView* view = coreFrame->view()) { + GdkRectangle area = view->contentsToWindow(node->getRect()); + gtk_tooltip_set_tip_area(tooltip, &area); + } + gtk_tooltip_set_text(tooltip, title.utf8().data()); + + return TRUE; + } + } + } + + return FALSE; + } + if (priv->tooltipText.length() > 0) { + if (!keyboard_mode) { + if (!priv->tooltipArea.isEmpty()) { + GdkRectangle area = priv->tooltipArea; + gtk_tooltip_set_tip_area(tooltip, &area); + } else + gtk_tooltip_set_tip_area(tooltip, 0); + } gtk_tooltip_set_text(tooltip, priv->tooltipText.data()); return TRUE; } return FALSE; } + +static gboolean webkit_web_view_show_help(GtkWidget* widget, GtkWidgetHelpType help_type) +{ + if (help_type == GTK_WIDGET_HELP_TOOLTIP) + gtk_widget_set_has_tooltip(widget, TRUE); + + return GTK_WIDGET_CLASS(webkit_web_view_parent_class)->show_help(widget, help_type); +} #endif static GtkIMContext* webkit_web_view_get_im_context(WebKitWebView* webView) @@ -2197,15 +2260,6 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) G_TYPE_NONE, 1, G_TYPE_STRING); - webkit_web_view_signals[SELECTION_CHANGED] = g_signal_new("selection-changed", - G_TYPE_FROM_CLASS(webViewClass), - (GSignalFlags)G_SIGNAL_RUN_LAST, - 0, - NULL, - NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - /** * WebKitWebView::console-message: * @webView: the object on which the signal is emitted @@ -2603,6 +2657,66 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) G_TYPE_NONE, 1, WEBKIT_TYPE_WEB_FRAME); + webkit_web_view_signals[SHOULD_BEGIN_EDITING] = g_signal_new("should-begin-editing", + G_TYPE_FROM_CLASS(webViewClass), static_cast<GSignalFlags>(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), + G_STRUCT_OFFSET(WebKitWebViewClass, should_allow_editing_action), g_signal_accumulator_first_wins, 0, + webkit_marshal_BOOLEAN__OBJECT, G_TYPE_BOOLEAN, 1, WEBKIT_TYPE_DOM_RANGE); + + webkit_web_view_signals[SHOULD_END_EDITING] = g_signal_new("should-end-editing", G_TYPE_FROM_CLASS(webViewClass), + static_cast<GSignalFlags>(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), + G_STRUCT_OFFSET(WebKitWebViewClass, should_allow_editing_action), g_signal_accumulator_first_wins, 0, + webkit_marshal_BOOLEAN__OBJECT, G_TYPE_BOOLEAN, 1, WEBKIT_TYPE_DOM_RANGE); + + webkit_web_view_signals[SHOULD_INSERT_NODE] = g_signal_new("should-insert-node", G_TYPE_FROM_CLASS(webViewClass), + static_cast<GSignalFlags>(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), + G_STRUCT_OFFSET(WebKitWebViewClass, should_allow_editing_action), g_signal_accumulator_first_wins, 0, + webkit_marshal_BOOLEAN__OBJECT_OBJECT_ENUM, G_TYPE_BOOLEAN, + 3, WEBKIT_TYPE_DOM_NODE, WEBKIT_TYPE_DOM_RANGE, WEBKIT_TYPE_INSERT_ACTION); + + webkit_web_view_signals[SHOULD_INSERT_TEXT] = g_signal_new("should-insert-text", G_TYPE_FROM_CLASS(webViewClass), + static_cast<GSignalFlags>(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), + G_STRUCT_OFFSET(WebKitWebViewClass, should_allow_editing_action), g_signal_accumulator_first_wins, 0, + webkit_marshal_BOOLEAN__STRING_OBJECT_ENUM, G_TYPE_BOOLEAN, + 3, G_TYPE_STRING, WEBKIT_TYPE_DOM_RANGE, WEBKIT_TYPE_INSERT_ACTION); + + webkit_web_view_signals[SHOULD_DELETE_RANGE] = g_signal_new("should-delete-range", G_TYPE_FROM_CLASS(webViewClass), + static_cast<GSignalFlags>(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), + G_STRUCT_OFFSET(WebKitWebViewClass, should_allow_editing_action), g_signal_accumulator_first_wins, 0, + webkit_marshal_BOOLEAN__OBJECT, G_TYPE_BOOLEAN, 1, WEBKIT_TYPE_DOM_RANGE); + + webkit_web_view_signals[SHOULD_SHOW_DELETE_INTERFACE_FOR_ELEMENT] = g_signal_new("should-show-delete-interface-for-element", + G_TYPE_FROM_CLASS(webViewClass), static_cast<GSignalFlags>(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), + G_STRUCT_OFFSET(WebKitWebViewClass, should_allow_editing_action), g_signal_accumulator_first_wins, 0, + webkit_marshal_BOOLEAN__OBJECT, G_TYPE_BOOLEAN, 1, WEBKIT_TYPE_DOM_HTML_ELEMENT); + + webkit_web_view_signals[SHOULD_CHANGE_SELECTED_RANGE] = g_signal_new("should-change-selected-range", + G_TYPE_FROM_CLASS(webViewClass), static_cast<GSignalFlags>(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), + G_STRUCT_OFFSET(WebKitWebViewClass, should_allow_editing_action), g_signal_accumulator_first_wins, 0, + webkit_marshal_BOOLEAN__OBJECT_OBJECT_ENUM_BOOLEAN, G_TYPE_BOOLEAN, + 4, WEBKIT_TYPE_DOM_RANGE, WEBKIT_TYPE_DOM_RANGE, WEBKIT_TYPE_SELECTION_AFFINITY, G_TYPE_BOOLEAN); + + webkit_web_view_signals[SHOULD_APPLY_STYLE] = g_signal_new("should-apply-style", + G_TYPE_FROM_CLASS(webViewClass), static_cast<GSignalFlags>(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), + G_STRUCT_OFFSET(WebKitWebViewClass, should_allow_editing_action), g_signal_accumulator_first_wins, 0, + webkit_marshal_BOOLEAN__OBJECT_OBJECT, G_TYPE_BOOLEAN, + 2, WEBKIT_TYPE_DOM_CSS_STYLE_DECLARATION, WEBKIT_TYPE_DOM_RANGE); + + webkit_web_view_signals[EDITING_BEGAN] = g_signal_new("editing-began", + G_TYPE_FROM_CLASS(webViewClass), static_cast<GSignalFlags>(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), 0, 0, 0, + g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); + + webkit_web_view_signals[USER_CHANGED_CONTENTS] = g_signal_new("user-changed-contents", + G_TYPE_FROM_CLASS(webViewClass), static_cast<GSignalFlags>(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), 0, 0, 0, + g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); + + webkit_web_view_signals[EDITING_ENDED] = g_signal_new("editing-ended", + G_TYPE_FROM_CLASS(webViewClass), static_cast<GSignalFlags>(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), 0, 0, 0, + g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); + + webkit_web_view_signals[SELECTION_CHANGED] = g_signal_new("selection-changed", + G_TYPE_FROM_CLASS(webViewClass), static_cast<GSignalFlags>(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), 0, 0, 0, + g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); + /* * implementations of virtual methods */ @@ -2623,6 +2737,7 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) webViewClass->undo = webkit_web_view_real_undo; webViewClass->redo = webkit_web_view_real_redo; webViewClass->move_cursor = webkit_web_view_real_move_cursor; + webViewClass->should_allow_editing_action = webkit_web_view_real_should_allow_editing_action; GObjectClass* objectClass = G_OBJECT_CLASS(webViewClass); objectClass->dispose = webkit_web_view_dispose; @@ -2664,6 +2779,7 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) widgetClass->drag_data_received = webkit_web_view_drag_data_received; #if GTK_CHECK_VERSION(2, 12, 0) widgetClass->query_tooltip = webkit_web_view_query_tooltip; + widgetClass->show_help = webkit_web_view_show_help; #endif GtkContainerClass* containerClass = GTK_CONTAINER_CLASS(webViewClass); @@ -4800,7 +4916,7 @@ webkit_web_view_get_dom_document(WebKitWebView* webView) if (!doc) return 0; - return static_cast<WebKitDOMDocument*>(kit(doc)); + return kit(doc); } /** diff --git a/WebKit/gtk/webkit/webkitwebview.h b/WebKit/gtk/webkit/webkitwebview.h index 9dfb654..cf8e669 100644 --- a/WebKit/gtk/webkit/webkitwebview.h +++ b/WebKit/gtk/webkit/webkitwebview.h @@ -73,6 +73,19 @@ typedef enum WEBKIT_WEB_VIEW_VIEW_MODE_MINIMIZED } WebKitWebViewViewMode; +typedef enum +{ + WEBKIT_SELECTION_AFFINITY_UPSTREAM, + WEBKIT_SELECTION_AFFINITY_DOWNSTREAM, +} WebKitSelectionAffinity; + +typedef enum +{ + WEBKIT_INSERT_ACTION_TYPED, + WEBKIT_INSERT_ACTION_PASTED, + WEBKIT_INSERT_ACTION_DROPPED, +} WebKitInsertAction; + struct _WebKitWebView { GtkContainer parent_instance; @@ -137,12 +150,12 @@ struct _WebKitWebViewClass { void (* undo) (WebKitWebView *web_view); void (* redo) (WebKitWebView *web_view); + gboolean (* should_allow_editing_action) (WebKitWebView *web_view); /* Padding for future expansion */ void (*_webkit_reserved0) (void); void (*_webkit_reserved1) (void); void (*_webkit_reserved2) (void); - void (*_webkit_reserved3) (void); }; WEBKIT_API GType diff --git a/WebKit/gtk/webkitmarshal.list b/WebKit/gtk/webkitmarshal.list index 026a8af..5372c57 100644 --- a/WebKit/gtk/webkitmarshal.list +++ b/WebKit/gtk/webkitmarshal.list @@ -2,12 +2,15 @@ BOOLEAN:ENUM,INT BOOLEAN:INT,INT,STRING BOOLEAN:OBJECT BOOLEAN:OBJECT,OBJECT +BOOLEAN:OBJECT,OBJECT,ENUM +BOOLEAN:OBJECT,OBJECT,ENUM,BOOLEAN BOOLEAN:OBJECT,OBJECT,OBJECT,OBJECT BOOLEAN:OBJECT,OBJECT,STRING,OBJECT BOOLEAN:OBJECT,STRING BOOLEAN:OBJECT,STRING,POINTER BOOLEAN:OBJECT,STRING,STRING,STRING BOOLEAN:STRING,INT,STRING +BOOLEAN:STRING,OBJECT,ENUM BOOLEAN:VOID ENUM:OBJECT,OBJECT OBJECT:OBJECT |