From f486d19d62f1bc33246748b14b14a9dfa617b57f Mon Sep 17 00:00:00 2001 From: Iain Merrick Date: Thu, 19 Aug 2010 17:55:56 +0100 Subject: Merge WebKit at r65615 : Initial merge by git. Change-Id: Ifbf384f4531e3b58475a662e38195c2d9152ae79 --- WebKit/gtk/ChangeLog | 227 +++++++++++++++++++++ WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp | 6 +- WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp | 29 +++ WebKit/gtk/WebCoreSupport/EditorClientGtk.h | 3 + .../gtk/WebCoreSupport/FrameNetworkingContextGtk.h | 45 ++++ WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp | 112 +++++++++- WebKit/gtk/gdom/ConvertToGCharPrivate.h | 2 +- WebKit/gtk/org.webkitgtk.gschema.xml.in | 32 +++ WebKit/gtk/webkit/webkitprivate.cpp | 46 +++++ WebKit/gtk/webkit/webkitprivate.h | 10 + WebKit/gtk/webkit/webkitwebbackforwardlist.cpp | 27 +-- WebKit/gtk/webkit/webkitwebbackforwardlist.h | 2 + WebKit/gtk/webkit/webkitwebframe.cpp | 26 +++ WebKit/gtk/webkit/webkitwebview.cpp | 18 +- 14 files changed, 557 insertions(+), 28 deletions(-) create mode 100644 WebKit/gtk/WebCoreSupport/FrameNetworkingContextGtk.h create mode 100644 WebKit/gtk/org.webkitgtk.gschema.xml.in (limited to 'WebKit/gtk') diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog index dbba4a9..79e4a0b 100644 --- a/WebKit/gtk/ChangeLog +++ b/WebKit/gtk/ChangeLog @@ -1,3 +1,230 @@ +2010-08-18 Gustavo Noronha Silva + + Reviewed by Martin Robinson. + + [GTK] WebBackForwardList's new_with_web_view should not be public + https://bugs.webkit.org/show_bug.cgi?id=43802 + + Deprecate the constructor. The introspection annotation has been + fixed in a previous commit. + + * webkit/webkitwebbackforwardlist.cpp: + +2010-08-17 Ilya Tikhonovsky + + Reviewed by Yury Semikhatsky. + + Web Inspector: replace hand written InspectorBackendStub.js with generated one. + https://bugs.webkit.org/show_bug.cgi?id=43791 + + * WebCoreSupport/InspectorClientGtk.cpp: + (WebKit::InspectorClient::openInspectorFrontend): + +2010-08-18 Sheriff Bot + + Unreviewed, rolling out r65595. + http://trac.webkit.org/changeset/65595 + https://bugs.webkit.org/show_bug.cgi?id=44161 + + qt build failed (Requested by loislo on #webkit). + + * WebCoreSupport/InspectorClientGtk.cpp: + (WebKit::InspectorClient::openInspectorFrontend): + +2010-08-17 Ilya Tikhonovsky + + Reviewed by Yury Semikhatsky. + + Web Inspector: replace hand written InspectorBackendStub.js by generated one. + https://bugs.webkit.org/show_bug.cgi?id=43791 + + * WebCoreSupport/InspectorClientGtk.cpp: + (WebKit::InspectorClient::openInspectorFrontend): + +2010-08-17 Xan Lopez + + Reviewed by Gustavo Noronha. + + Fix the builds when HAVE_GSETTINGS is defined. + + * webkit/webkitprivate.cpp: + (isSchemaAvailable): + (inspectorGSettings): + +2010-08-17 Jesus Sanchez-Palencia + + Reviewed by Darin Adler. + + Add NetworkingContext to avoid layer violations + https://bugs.webkit.org/show_bug.cgi?id=42292 + + Preparation: Just add the files to the build system. + + * WebCoreSupport/FrameNetworkingContextGtk.h: Added. + Placeholder with tentative code that might be changed when landing + the rest of it. + +2010-08-17 Gustavo Noronha Silva + + Reviewed by Martin Robinson. + + WebBackForwardList.get_{back|forward}_list_with_limit not introspectable + https://bugs.webkit.org/show_bug.cgi?id=43054 + + Annotate WebKitWebBackForwardList and the function that is used to fetch it from + the WebKitWebView. More will follow. + + * webkit/webkitwebbackforwardlist.cpp: Annotations, and small + improvements to the docs. + * webkit/webkitwebbackforwardlist.h: Couple empty lines missing. + * webkit/webkitwebview.cpp: + +2010-08-17 Martin Robinson + + Reviewed by Gustavo Noronha Silva. + + [GTK] Clean up WebCore/platform/graphics/gtk/ImageGtk.cpp + https://bugs.webkit.org/show_bug.cgi?id=44069 + + * WebCoreSupport/InspectorClientGtk.cpp: + (WebKit::InspectorClient::openInspectorFrontend): Switched to using the new WEBKITGTK_API_VERSION_STRING define. + * webkit/webkitprivate.cpp: + (inspectorGSettings): Ditto. + +2010-08-17 Sheriff Bot + + Unreviewed, rolling out r65500. + http://trac.webkit.org/changeset/65500 + https://bugs.webkit.org/show_bug.cgi?id=44108 + + Qt bots failed to compile. (Requested by loislo on #webkit). + + * WebCoreSupport/InspectorClientGtk.cpp: + (WebKit::InspectorClient::openInspectorFrontend): + +2010-08-17 Ilya Tikhonovsky + + Reviewed by Yury Semikhatsky. + + Web Inspector: replace hand written InspectorBackendStub.js by generated one. + https://bugs.webkit.org/show_bug.cgi?id=43791 + + * WebCoreSupport/InspectorClientGtk.cpp: + (WebKit::InspectorClient::openInspectorFrontend): + +2010-08-17 Gustavo Noronha Silva + + Reviewed by Martin Robinson. + + [GTK] GSettings support adds annoying warnings on systems with older glib versions + https://bugs.webkit.org/show_bug.cgi?id=44056 + + Use #ifdef instead of #if for HAVE_GSETTINGS to avoid warnings + when it is not defined. + + * WebCoreSupport/InspectorClientGtk.cpp: + * webkit/webkitprivate.cpp: + (webkit_init): + * webkit/webkitprivate.h: + +2010-08-12 Gustavo Noronha Silva + + Really add a missing file. I wish I would remember running git add + on them after applying a patch =(. + + * org.webkitgtk.gschema.xml.in: Added. + +2010-08-12 Gustavo Noronha Silva + + Reviewed by Martin Robinson. + + [GTK] Use GSettings to save/restore Web Inspector settings + https://bugs.webkit.org/show_bug.cgi?id=43512 + + Use GSettings to save/restore settings used by the Web Inspector. + A few helper functions were added to have settings that use + boolean values be actual booleans, and also to conform with the + GSettings naming requirements for keys. + + * WebCoreSupport/InspectorClientGtk.cpp: + (WebKit::toGSettingName): + (WebKit::truthStringFromVariant): + (WebKit::variantFromTruthString): + (WebKit::InspectorClient::populateSetting): + (WebKit::InspectorClient::storeSetting): + * org.webkit.gtk.gschema.xml: Added. + * webkit/webkitprivate.cpp: + (inspectorGSettings): + (webkit_init): + * webkit/webkitprivate.h: + +2010-08-11 Joone Hur + + Reviewed by Martin Robinson. + + [GTK] Last Hangul letter is typed again when a composition is finished with mouse press + https://bugs.webkit.org/show_bug.cgi?id=40518 + + When a mouse press fires during a IME composition, the current composition character + can be entered twice at the previous editing position and a new editing position. + Because the IME commit signal is emitted after the mouse press event. + This patch allows to prevent the commit signal during a composition when a mouse press fires. + + * WebCoreSupport/EditorClientGtk.cpp: + (WebKit::imContextCommitted): + (WebKit::EditorClient::handleInputMethodKeydown): Allow to accept the next composition commit. + (WebKit::EditorClient::handleInputMethodMousePress): Added for handling IME when a mouse press fires. + (WebKit::EditorClient::EditorClient): Initialize m_preventNextCompositionCommit + * WebCoreSupport/EditorClientGtk.h: + (WebKit::EditorClient::preventNextCompositionCommit): Added for checking whether skipping a commit. + * webkit/webkitwebview.cpp: + (webkit_web_view_button_press_event): Call handleInputMethodMousePress() + +2010-08-11 Gustavo Noronha Silva + + Reviewed by Martin Robinson. + + Small improvement to the documentation of the geolocation-policy-decision-requested + signal, stating more clearly what is expected from the handler. + + * webkit/webkitwebview.cpp: + (webkit_web_view_class_init): + +2010-08-11 Gustavo Noronha Silva + + Reviewed by Martin Robinson. + + [GTK] Geolocation policy decision object leaking + https://bugs.webkit.org/show_bug.cgi?id=43884 + + Use GRefPtr on the policy decision object to fix the leak. + + * WebCoreSupport/ChromeClientGtk.cpp: + (WebKit::ChromeClient::requestGeolocationPermissionForFrame): + +2010-08-10 Chris Marrin + + Reviewed by Oliver Hunt. + + Add suspendAnimations/resumeAnimation API to DRT + https://bugs.webkit.org/show_bug.cgi?id=43733 + + Gtk specific API. + + * webkit/webkitprivate.h: + * webkit/webkitwebframe.cpp: + (webkit_web_frame_suspend_animations): + (webkit_web_frame_resume_animations): + +2010-08-10 Gavin Barraclough + + Rubber stamped by Sam Weinig. + + Bug 43786 - Move AtomicStringHash from WebCore to WTF + Also remove deprecated string headers from WebCore/platform/text. + + * gdom/ConvertToGCharPrivate.h: + 2010-08-06 Gavin Barraclough Rubber stamped by Sam Weinig diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp index a06d637..185ac16 100644 --- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp @@ -611,12 +611,12 @@ void ChromeClient::requestGeolocationPermissionForFrame(Frame* frame, Geolocatio WebKitWebFrame* webFrame = kit(frame); WebKitWebView* webView = getViewFromFrame(webFrame); - WebKitGeolocationPolicyDecision* policyDecision = webkit_geolocation_policy_decision_new(webFrame, geolocation); + GRefPtr policyDecision(adoptGRef(webkit_geolocation_policy_decision_new(webFrame, geolocation))); gboolean isHandled = FALSE; - g_signal_emit_by_name(webView, "geolocation-policy-decision-requested", webFrame, policyDecision, &isHandled); + g_signal_emit_by_name(webView, "geolocation-policy-decision-requested", webFrame, policyDecision.get(), &isHandled); if (!isHandled) - webkit_geolocation_policy_deny(policyDecision); + webkit_geolocation_policy_deny(policyDecision.get()); } void ChromeClient::cancelGeolocationPermissionRequestForFrame(WebCore::Frame* frame, WebCore::Geolocation*) diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp index cd04782..8a019b4 100644 --- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp @@ -67,6 +67,11 @@ static void imContextCommitted(GtkIMContext* context, const gchar* compositionSt return; } + // If this signal fires during a mousepress event when we are in the middle + // of a composition, skip this 'commit' because the composition is already confirmed. + if (client->preventNextCompositionCommit()) + return; + frame->editor()->confirmComposition(String::fromUTF8(compositionString)); client->clearPendingComposition(); } @@ -670,6 +675,7 @@ void EditorClient::handleInputMethodKeydown(KeyboardEvent* event) WebKitWebViewPrivate* priv = m_webView->priv; + m_preventNextCompositionCommit = false; // Some IM contexts (e.g. 'simple') will act as if they filter every // keystroke and just issue a 'commit' signal during handling. In situations @@ -711,9 +717,32 @@ void EditorClient::handleInputMethodKeydown(KeyboardEvent* event) m_treatContextCommitAsKeyEvent = false; } +void EditorClient::handleInputMethodMousePress() +{ + Frame* targetFrame = core(m_webView)->focusController()->focusedOrMainFrame(); + + if (!targetFrame || !targetFrame->editor()->canEdit()) + return; + + WebKitWebViewPrivate* priv = m_webView->priv; + + // When a mouse press fires, the commit signal happens during a composition. + // In this case, if the focused node is changed, the commit signal happens in a diffrent node. + // Therefore, we need to confirm the current compositon and ignore the next commit signal. + GOwnPtr newPreedit(0); + gtk_im_context_get_preedit_string(priv->imContext, &newPreedit.outPtr(), 0, 0); + + if (g_utf8_strlen(newPreedit.get(), -1)) { + targetFrame->editor()->confirmComposition(); + m_preventNextCompositionCommit = true; + gtk_im_context_reset(priv->imContext); + } +} + EditorClient::EditorClient(WebKitWebView* webView) : m_isInRedo(false) , m_webView(webView) + , m_preventNextCompositionCommit(false) , m_treatContextCommitAsKeyEvent(false) , m_nativeWidget(gtk_text_view_new()) { diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.h b/WebKit/gtk/WebCoreSupport/EditorClientGtk.h index 2688629..3e881fa 100644 --- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.h +++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.h @@ -61,6 +61,7 @@ namespace WebKit { ~EditorClient(); WebKitWebView* webView() { return m_webView; } bool treatContextCommitAsKeyEvent() { return m_treatContextCommitAsKeyEvent; } + bool preventNextCompositionCommit() { return m_preventNextCompositionCommit; } void clearPendingComposition() { m_pendingComposition.set(0); } bool hasPendingComposition() { return m_pendingComposition; } void addPendingEditorCommand(const char* command) { m_pendingEditorCommands.append(command); } @@ -112,6 +113,7 @@ namespace WebKit { virtual void handleKeyboardEvent(WebCore::KeyboardEvent*); virtual void handleInputMethodKeydown(WebCore::KeyboardEvent*); + virtual void handleInputMethodMousePress(); virtual void textFieldDidBeginEditing(WebCore::Element*); virtual void textFieldDidEndEditing(WebCore::Element*); @@ -135,6 +137,7 @@ namespace WebKit { private: WebKitWebView* m_webView; + bool m_preventNextCompositionCommit; bool m_treatContextCommitAsKeyEvent; GOwnPtr m_pendingComposition; Vector m_pendingEditorCommands; diff --git a/WebKit/gtk/WebCoreSupport/FrameNetworkingContextGtk.h b/WebKit/gtk/WebCoreSupport/FrameNetworkingContextGtk.h new file mode 100644 index 0000000..8e4c214 --- /dev/null +++ b/WebKit/gtk/WebCoreSupport/FrameNetworkingContextGtk.h @@ -0,0 +1,45 @@ +/* + 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 + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef FrameNetworkingContextGtk_h +#define FrameNetworkingContextGtk_h + +#include "FrameNetworkingContext.h" + +namespace WebKit { + +class FrameNetworkingContextGtk : public WebCore::FrameNetworkingContext { +public: + static PassRefPtr create(WebCore::Frame* frame) + { + return adoptRef(new FrameNetworkingContextGtk(frame)); + } + + WebCore::Frame* coreFrame() const { return frame(); } + +private: + FrameNetworkingContextGtk(WebCore::Frame* frame) + : WebCore::FrameNetworkingContext(frame) + { + } +}; + +} + +#endif diff --git a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp index 1256000..b0dd40e 100644 --- a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp @@ -1,5 +1,6 @@ /* * Copyright (C) 2008 Gustavo Noronha Silva + * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -81,13 +82,13 @@ void InspectorClient::openInspectorFrontend(InspectorController* controller) GOwnPtr inspectorURI; // Make the Web Inspector work when running tests - if (g_file_test("WebCore/inspector/front-end/inspector.html", G_FILE_TEST_EXISTS)) { + // FixMe: it is not working. It should be not the subdirectory of the current directory, but a subdirectory of $(WEBKITOUTPUTDIR). + if (g_file_test("resources/inspector/inspector.html", G_FILE_TEST_EXISTS)) { GOwnPtr currentDirectory(g_get_current_dir()); - GOwnPtr fullPath(g_strdup_printf("%s/WebCore/inspector/front-end/inspector.html", currentDirectory.get())); + GOwnPtr fullPath(g_strdup_printf("%s/resources/inspector/inspector.html", currentDirectory.get())); inspectorURI.set(g_filename_to_uri(fullPath.get(), NULL, NULL)); } else { - GOwnPtr dataPath(g_strdup_printf(DATA_DIR"/webkitgtk-%.1f/webinspector/inspector.html", WEBKITGTK_API_VERSION)); - inspectorURI.set(g_filename_to_uri(dataPath.get(), NULL, NULL)); + inspectorURI.set(g_filename_to_uri(DATA_DIR"/webkitgtk-"WEBKITGTK_API_VERSION_STRING"/webinspector/inspector.html", NULL, NULL)); } webkit_web_view_load_uri(inspectorWebView, inspectorURI.get()); @@ -118,15 +119,116 @@ void InspectorClient::hideHighlight() gtk_widget_queue_draw(GTK_WIDGET(m_inspectedWebView)); } +#ifdef HAVE_GSETTINGS +static String toGSettingName(String inspectorSettingName) +{ + if (inspectorSettingName == "resourceTrackingEnabled") + return String("resource-tracking-enabled"); + + if (inspectorSettingName == "xhrMonitor") + return String("xhr-monitor-enabled"); + + if (inspectorSettingName == "frontendSettings") + return String("frontend-settings"); + + if (inspectorSettingName == "debuggerEnabled") + return String("debugger-enabled"); + + if (inspectorSettingName == "profilerEnabled") + return String("profiler-enabled"); + + return inspectorSettingName; +} + +static String truthStringFromVariant(GVariant* variant) +{ + if (g_variant_get_boolean(variant)) + return String("true"); + + return String("false"); +} + +static GVariant* variantFromTruthString(const String& truth) +{ + if (truth == "true") + return g_variant_new_boolean(TRUE); + + return g_variant_new_boolean(FALSE); +} + +static bool shouldIgnoreSetting(const String& key) +{ + // Ignore this setting for now, it doesn't seem to be used for + // anything right now. + if (key == "lastActivePanel") + return true; + + // GSettings considers trying to fetch or set a setting that is + // not backed by a schema as programmer error, and aborts the + // program's execution. We check here to avoid having an unhandled + // setting as a fatal error. + if (key == "resourceTrackingEnabled" || key == "xhrMonitor" + || key == "frontendSettings" || key == "debuggerEnabled" + || key == "profilerEnabled") + return false; + + LOG_VERBOSE(NotYetImplemented, "Unknown key ignored: %s", key.ascii().data()); + return true; +} + void InspectorClient::populateSetting(const String& key, String* value) { - notImplemented(); + if (shouldIgnoreSetting(key)) + return; + + GSettings* settings = inspectorGSettings(); + if (!settings) + return; + + GRefPtr variant = adoptGRef(g_settings_get_value(settings, toGSettingName(key).utf8().data())); + + if (key == "resourceTrackingEnabled" || key == "xhrMonitor" + || key == "debuggerEnabled" || key == "profilerEnabled") + *value = truthStringFromVariant(variant.get()); + else if (key == "frontendSettings") + *value = String(g_variant_get_string(variant.get(), 0)); } void InspectorClient::storeSetting(const String& key, const String& value) { + if (shouldIgnoreSetting(key)) + return; + + GSettings* settings = inspectorGSettings(); + if (!settings) + return; + + GRefPtr variant(0); + + // Set the key with the appropriate type, and also avoid setting + // unknown keys to avoid aborting the execution. + if (key == "resourceTrackingEnabled" || key == "xhrMonitor" + || key == "debuggerEnabled" || key == "profilerEnabled") + variant = adoptGRef(variantFromTruthString(value)); + else if (key == "frontendSettings") + variant = adoptGRef(g_variant_new_string(value.utf8().data())); + + if (!variant) + return; + + g_settings_set_value(settings, toGSettingName(key).utf8().data(), variant.get()); +} +#else +void InspectorClient::populateSetting(const String&, String*) +{ + notImplemented(); +} + +void InspectorClient::storeSetting(const String&, const String&) +{ notImplemented(); } +#endif // HAVE_GSETTINGS bool InspectorClient::sendMessageToFrontend(const String& message) { diff --git a/WebKit/gtk/gdom/ConvertToGCharPrivate.h b/WebKit/gtk/gdom/ConvertToGCharPrivate.h index ef42b08..afbed49 100644 --- a/WebKit/gtk/gdom/ConvertToGCharPrivate.h +++ b/WebKit/gtk/gdom/ConvertToGCharPrivate.h @@ -20,10 +20,10 @@ #ifndef ConvertToGCharPrivate_h #define ConvertToGCharPrivate_h -#include "AtomicString.h" #include "KURL.h" #include "PlatformString.h" #include +#include inline gchar* copyAsGchar(WTF::String const& s) { diff --git a/WebKit/gtk/org.webkitgtk.gschema.xml.in b/WebKit/gtk/org.webkitgtk.gschema.xml.in new file mode 100644 index 0000000..17063f4 --- /dev/null +++ b/WebKit/gtk/org.webkitgtk.gschema.xml.in @@ -0,0 +1,32 @@ + + + + + + + false + Resource Tracking Enabled + Whether the Resource Tracking panel is always enabled. + + + false + XHR Monitor Enabled + Whether the XHR monitor is always enabled. + + + false + Debugger Enabled + Whether the debugger is always enabled. + + + false + Profiler Enabled + Whether the profiler is always enabled. + + + '' + Misc Inspector Frontend Settings + Miscelaneous Settings managed by the Inspector Frontend + + + diff --git a/WebKit/gtk/webkit/webkitprivate.cpp b/WebKit/gtk/webkit/webkitprivate.cpp index 41de76e..91b2904 100644 --- a/WebKit/gtk/webkit/webkitprivate.cpp +++ b/WebKit/gtk/webkit/webkitprivate.cpp @@ -44,6 +44,7 @@ #include "WebKitDOMBinding.h" #include "webkitnetworkresponse.h" #include "webkitsoupauthdialog.h" +#include "webkitversion.h" #include #include #include @@ -214,6 +215,45 @@ static void closeIconDatabaseOnExit() iconDatabase()->close(); } +#ifdef HAVE_GSETTINGS +static bool isSchemaAvailable(const char* schemaID) +{ + const char* const* availableSchemas = g_settings_list_schemas(); + char* const* iter = const_cast(availableSchemas); + + while (*iter) { + if (g_str_equal(schemaID, *iter)) + return true; + iter++; + } + + return false; +} + +GSettings* inspectorGSettings() +{ + static GSettings* settings = 0; + + if (settings) + return settings; + + const gchar* schemaID = "org.webkitgtk-"WEBKITGTK_API_VERSION_STRING".inspector"; + + // Unfortunately GSettings will abort the process execution if the + // schema is not installed, which is the case for when running + // tests, or even the introspection dump at build time, so check + // if we have the schema before trying to initialize it. + if (!isSchemaAvailable(schemaID)) { + g_warning("GSettings schema not found - settings will not be used or saved."); + return 0; + } + + settings = g_settings_new(schemaID); + + return settings; +} +#endif + void webkit_init() { static bool isInitialized = false; @@ -238,6 +278,12 @@ void webkit_init() // FIXME: Expose this with an API and/or calculate based on available resources webkit_set_cache_model(WEBKIT_CACHE_MODEL_WEB_BROWSER); +#ifdef HAVE_GSETTINGS + // Initialize settings variables here to make sure this happens in + // the main thread. + inspectorGSettings(); +#endif + #if ENABLE(DATABASE) gchar* databaseDirectory = g_build_filename(g_get_user_data_dir(), "webkit", "databases", NULL); webkit_set_web_database_directory_path(databaseDirectory); diff --git a/WebKit/gtk/webkit/webkitprivate.h b/WebKit/gtk/webkit/webkitprivate.h index aa19bec..a5508a4 100644 --- a/WebKit/gtk/webkit/webkitprivate.h +++ b/WebKit/gtk/webkit/webkitprivate.h @@ -120,6 +120,10 @@ namespace WebKit { extern "C" { void webkit_init(); +#ifdef HAVE_GSETTINGS + GSettings* inspectorGSettings(); +#endif + #define WEBKIT_PARAM_READABLE ((GParamFlags)(G_PARAM_READABLE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB)) #define WEBKIT_PARAM_READWRITE ((GParamFlags)(G_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB)) @@ -347,6 +351,12 @@ extern "C" { webkit_web_frame_number_of_active_animations(WebKitWebFrame* frame); WEBKIT_API void + webkit_web_frame_suspend_animations(WebKitWebFrame* frame); + + WEBKIT_API void + webkit_web_frame_resume_animations(WebKitWebFrame* frame); + + WEBKIT_API void webkit_web_frame_clear_main_frame_name(WebKitWebFrame* frame); WEBKIT_API AtkObject* diff --git a/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp b/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp index 70fdea5..4789de9 100644 --- a/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp +++ b/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp @@ -96,12 +96,15 @@ static void webkit_web_back_forward_list_init(WebKitWebBackForwardList* webBackF } /** - * webkit_web_back_forward_list_new_with_web_view: + * webkit_web_back_forward_list_new_with_web_view: (skip) * @web_view: the back forward list's #WebKitWebView * * Creates an instance of the back forward list with a controlling #WebKitWebView * * Return value: a #WebKitWebBackForwardList + * + * Deprecated: 1.3.4: Instances of #WebKitWebBackForwardList are + * created and owned by #WebKitWebView instances only. */ WebKitWebBackForwardList* webkit_web_back_forward_list_new_with_web_view(WebKitWebView* webView) { @@ -151,11 +154,11 @@ void webkit_web_back_forward_list_go_back(WebKitWebBackForwardList* webBackForwa /** * webkit_web_back_forward_list_contains_item: * @web_back_forward_list: a #WebKitWebBackForwardList - * @history_item: the #WebKitWebHistoryItem to check + * @history_item: (type WebKit.WebHistoryItem) (transfer none): the #WebKitWebHistoryItem to check * * Checks if @web_history_item is in the back forward list * - * Return: %TRUE if @web_history_item is in the back forward list, %FALSE if it doesn't + * Return value: %TRUE if @web_history_item is in the back forward list, %FALSE if it doesn't */ gboolean webkit_web_back_forward_list_contains_item(WebKitWebBackForwardList* webBackForwardList, WebKitWebHistoryItem* webHistoryItem) { @@ -174,7 +177,7 @@ gboolean webkit_web_back_forward_list_contains_item(WebKitWebBackForwardList* we /** * webkit_web_back_forward_list_go_to_item: * @web_back_forward_list: a #WebKitWebBackForwardList - * @history_item: the #WebKitWebHistoryItem to go to + * @history_item: (type WebKit.WebHistoryItem) (transfer none): the #WebKitWebHistoryItem to go to * * Go to the specified @web_history_item in the back forward list */ @@ -197,7 +200,7 @@ void webkit_web_back_forward_list_go_to_item(WebKitWebBackForwardList* webBackFo * * Returns a list of items that succeed the current item, limited by @limit * - * Return value: a #GList of items succeeding the current item, limited by @limit + * Return value: (element-type WebKit.WebHistoryItem) (transfer container): a #GList of items succeeding the current item, limited by @limit */ GList* webkit_web_back_forward_list_get_forward_list_with_limit(WebKitWebBackForwardList* webBackForwardList, gint limit) { @@ -227,7 +230,7 @@ GList* webkit_web_back_forward_list_get_forward_list_with_limit(WebKitWebBackFor * * Returns a list of items that precede the current item, limited by @limit * - * Return value: a #GList of items preceding the current item, limited by @limit + * Return value: (element-type WebKit.WebHistoryItem) (transfer container): a #GList of items preceding the current item, limited by @limit */ GList* webkit_web_back_forward_list_get_back_list_with_limit(WebKitWebBackForwardList* webBackForwardList, gint limit) { @@ -256,7 +259,7 @@ GList* webkit_web_back_forward_list_get_back_list_with_limit(WebKitWebBackForwar * * Returns the item that precedes the current item * - * Return value: the #WebKitWebHistoryItem preceding the current item + * Return value: (type WebKit.WebHistoryItem) (transfer none): the #WebKitWebHistoryItem preceding the current item */ WebKitWebHistoryItem* webkit_web_back_forward_list_get_back_item(WebKitWebBackForwardList* webBackForwardList) { @@ -279,7 +282,7 @@ WebKitWebHistoryItem* webkit_web_back_forward_list_get_back_item(WebKitWebBackFo * * Returns a NULL value if the back forward list is empty * - * Return value: a #WebKitWebHistoryItem + * Return value: (type WebKit.WebHistoryItem) (transfer none): a #WebKitWebHistoryItem */ WebKitWebHistoryItem* webkit_web_back_forward_list_get_current_item(WebKitWebBackForwardList* webBackForwardList) { @@ -302,7 +305,7 @@ WebKitWebHistoryItem* webkit_web_back_forward_list_get_current_item(WebKitWebBac * * Returns a NULL value if there nothing that succeeds the current item * - * Return value: a #WebKitWebHistoryItem + * Return value: (type WebKit.WebHistoryItem) (transfer none): a #WebKitWebHistoryItem */ WebKitWebHistoryItem* webkit_web_back_forward_list_get_forward_item(WebKitWebBackForwardList* webBackForwardList) { @@ -324,7 +327,7 @@ WebKitWebHistoryItem* webkit_web_back_forward_list_get_forward_item(WebKitWebBac * * Returns the item at a given index relative to the current item. * - * Return value: the #WebKitWebHistoryItem located at the specified index relative to the current item + * Return value: (type WebKit.WebHistoryItem) (transfer none): the #WebKitWebHistoryItem located at the specified index relative to the current item */ WebKitWebHistoryItem* webkit_web_back_forward_list_get_nth_item(WebKitWebBackForwardList* webBackForwardList, gint index) { @@ -417,7 +420,7 @@ void webkit_web_back_forward_list_set_limit(WebKitWebBackForwardList* webBackFor /** * webkit_web_back_forward_list_add_item: * @web_back_forward_list: a #WebKitWebBackForwardList - * @history_item: the #WebKitWebHistoryItem to add + * @history_item: (type WebKit.WebHistoryItem) (transfer none): the #WebKitWebHistoryItem to add * * Adds the item to the #WebKitWebBackForwardList. * @@ -440,7 +443,7 @@ void webkit_web_back_forward_list_add_item(WebKitWebBackForwardList *webBackForw /** * webkit_web_back_forward_list_clear: - * @webBackForwardList: a #WebKitWebBackForwardList + * @web_back_forward_list: the #WebKitWebBackForwardList to be cleared * * Clears the @webBackForwardList by removing all its elements. Note that not even * the current page is kept in list when cleared so you would have to add it later. diff --git a/WebKit/gtk/webkit/webkitwebbackforwardlist.h b/WebKit/gtk/webkit/webkitwebbackforwardlist.h index 2cffc68..15ddc94 100644 --- a/WebKit/gtk/webkit/webkitwebbackforwardlist.h +++ b/WebKit/gtk/webkit/webkitwebbackforwardlist.h @@ -107,9 +107,11 @@ webkit_web_back_forward_list_get_limit (WebKitWebBackForwardLi WEBKIT_API void webkit_web_back_forward_list_set_limit (WebKitWebBackForwardList *web_back_forward_list, gint limit); + WEBKIT_API void webkit_web_back_forward_list_add_item (WebKitWebBackForwardList *web_back_forward_list, WebKitWebHistoryItem *history_item); + WEBKIT_API void webkit_web_back_forward_list_clear (WebKitWebBackForwardList *web_back_forward_list); diff --git a/WebKit/gtk/webkit/webkitwebframe.cpp b/WebKit/gtk/webkit/webkitwebframe.cpp index 5e82d57..88f0bb7 100644 --- a/WebKit/gtk/webkit/webkitwebframe.cpp +++ b/WebKit/gtk/webkit/webkitwebframe.cpp @@ -1053,6 +1053,32 @@ unsigned int webkit_web_frame_number_of_active_animations(WebKitWebFrame* frame) return controller->numberOfActiveAnimations(); } +void webkit_web_frame_suspend_animations(WebKitWebFrame* frame) +{ + Frame* coreFrame = core(frame); + if (!coreFrame) + return; + + AnimationController* controller = coreFrame->animation(); + if (!controller) + return; + + controller->suspendAnimations(coreFrame->document()); +} + +void webkit_web_frame_resume_animations(WebKitWebFrame* frame) +{ + Frame* coreFrame = core(frame); + if (!coreFrame) + return; + + AnimationController* controller = coreFrame->animation(); + if (!controller) + return; + + controller->resumeAnimations(coreFrame->document()); +} + gchar* webkit_web_frame_get_response_mime_type(WebKitWebFrame* frame) { Frame* coreFrame = core(frame); diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp index 58d91ea..64b7dcc 100644 --- a/WebKit/gtk/webkit/webkitwebview.cpp +++ b/WebKit/gtk/webkit/webkitwebview.cpp @@ -665,8 +665,9 @@ static gboolean webkit_web_view_button_press_event(GtkWidget* widget, GdkEventBu if (!frame->view()) return FALSE; - gboolean result = frame->eventHandler()->handleMousePressEvent(platformEvent); + // Handle the IM context when a mouse press fires + static_cast(core(webView)->editorClient())->handleInputMethodMousePress(); #if PLATFORM(X11) /* Copy selection to the X11 selection clipboard */ @@ -2395,10 +2396,12 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) * @frame: the frame that requests permission * @policy_decision: a WebKitGeolocationPolicyDecision * - * When a @frame wants to get its geolocation permission. - * The receiver must reply with a boolean wether it handled or not the - * request. If the request is not handled, default behaviour is to deny - * geolocation. + * This signal is emitted when a @frame wants to obtain the user's + * location. The decision can be made asynchronously, but you must + * call g_object_ref() the @policy_decision, and return %TRUE if + * you are going to handle the request. To actually make the + * decision you need to call webkit_geolocation_policy_allow() or + * webkit_geolocation_policy_deny() on @policy_decision. * * Since: 1.1.23 */ @@ -3299,9 +3302,10 @@ void webkit_web_view_set_maintains_back_forward_list(WebKitWebView* webView, gbo * webkit_web_view_get_back_forward_list: * @web_view: a #WebKitWebView * - * Returns a #WebKitWebBackForwardList + * Obtains the #WebKitBackForwardList associated with the given #WebKitWebView. The + * #WebKitWebBackForwardList is owned by the #WebKitWebView. * - * Return value: the #WebKitWebBackForwardList + * Return value: (transfer none): the #WebKitWebBackForwardList */ WebKitWebBackForwardList* webkit_web_view_get_back_forward_list(WebKitWebView* webView) { -- cgit v1.1