diff options
Diffstat (limited to 'WebKit/gtk/webkit')
-rw-r--r-- | WebKit/gtk/webkit/webkitapplicationcache.cpp | 8 | ||||
-rw-r--r-- | WebKit/gtk/webkit/webkitdownload.cpp | 67 | ||||
-rw-r--r-- | WebKit/gtk/webkit/webkitdownload.h | 3 | ||||
-rw-r--r-- | WebKit/gtk/webkit/webkitprivate.h | 7 | ||||
-rw-r--r-- | WebKit/gtk/webkit/webkitsecurityorigin.h | 1 | ||||
-rw-r--r-- | WebKit/gtk/webkit/webkitwebframe.cpp | 24 | ||||
-rw-r--r-- | WebKit/gtk/webkit/webkitwebinspector.cpp | 76 | ||||
-rw-r--r-- | WebKit/gtk/webkit/webkitwebinspector.h | 6 | ||||
-rw-r--r-- | WebKit/gtk/webkit/webkitwebsettings.cpp | 77 | ||||
-rw-r--r-- | WebKit/gtk/webkit/webkitwebview.cpp | 17 |
10 files changed, 256 insertions, 30 deletions
diff --git a/WebKit/gtk/webkit/webkitapplicationcache.cpp b/WebKit/gtk/webkit/webkitapplicationcache.cpp index 2c6b71f..e967d34 100644 --- a/WebKit/gtk/webkit/webkitapplicationcache.cpp +++ b/WebKit/gtk/webkit/webkitapplicationcache.cpp @@ -20,13 +20,17 @@ #include "config.h" #include "webkitprivate.h" +#include <wtf/UnusedParam.h> + #include "ApplicationCacheStorage.h" void webkit_application_cache_set_maximum_size(unsigned long long size) { +#if ENABLE(OFFLINE_WEB_APPLICATIONS) WebCore::cacheStorage().empty(); WebCore::cacheStorage().vacuumDatabaseFile(); WebCore::cacheStorage().setMaximumSize(size); +#else + UNUSED_PARAM(size); +#endif } - - diff --git a/WebKit/gtk/webkit/webkitdownload.cpp b/WebKit/gtk/webkit/webkitdownload.cpp index 568378c..dd6629b 100644 --- a/WebKit/gtk/webkit/webkitdownload.cpp +++ b/WebKit/gtk/webkit/webkitdownload.cpp @@ -31,6 +31,7 @@ #include "webkitdownload.h" #include "webkitenumtypes.h" #include "webkitmarshal.h" +#include "webkitnetworkresponse.h" #include "webkitprivate.h" #include <glib/gstdio.h> @@ -74,7 +75,7 @@ struct _WebKitDownloadPrivate { GFileOutputStream* outputStream; DownloadClient* downloadClient; WebKitNetworkRequest* networkRequest; - ResourceResponse* networkResponse; + WebKitNetworkResponse* networkResponse; RefPtr<ResourceHandle> resourceHandle; }; @@ -95,7 +96,8 @@ enum { PROP_PROGRESS, PROP_STATUS, PROP_CURRENT_SIZE, - PROP_TOTAL_SIZE + PROP_TOTAL_SIZE, + PROP_NETWORK_RESPONSE }; G_DEFINE_TYPE(WebKitDownload, webkit_download, G_TYPE_OBJECT); @@ -119,6 +121,11 @@ static void webkit_download_dispose(GObject* object) priv->networkRequest = NULL; } + if (priv->networkResponse) { + g_object_unref(priv->networkResponse); + priv->networkResponse = NULL; + } + G_OBJECT_CLASS(webkit_download_parent_class)->dispose(object); } @@ -138,7 +145,6 @@ static void webkit_download_finalize(GObject* object) } delete priv->downloadClient; - delete priv->networkResponse; // The download object may never have _start called on it, so we // need to make sure timer is non-NULL. @@ -159,6 +165,9 @@ static void webkit_download_get_property(GObject* object, guint prop_id, GValue* case PROP_NETWORK_REQUEST: g_value_set_object(value, webkit_download_get_network_request(download)); break; + case PROP_NETWORK_RESPONSE: + g_value_set_object(value, webkit_download_get_network_response(download)); + break; case PROP_DESTINATION_URI: g_value_set_string(value, webkit_download_get_destination_uri(download)); break; @@ -191,6 +200,9 @@ static void webkit_download_set_property(GObject* object, guint prop_id, const G case PROP_NETWORK_REQUEST: priv->networkRequest = WEBKIT_NETWORK_REQUEST(g_value_dup_object(value)); break; + case PROP_NETWORK_RESPONSE: + priv->networkResponse = WEBKIT_NETWORK_RESPONSE(g_value_dup_object(value)); + break; case PROP_DESTINATION_URI: webkit_download_set_destination_uri(download, g_value_get_string(value)); break; @@ -252,6 +264,21 @@ static void webkit_download_class_init(WebKitDownloadClass* downloadClass) (GParamFlags)(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY))); /** + * WebKitDownload:network-response + * + * The #WebKitNetworkResponse instance associated with the download. + * + * Since: 1.1.16 + */ + g_object_class_install_property(objectClass, + PROP_NETWORK_RESPONSE, + g_param_spec_object("network-response", + _("Network Response"), + _("The network response for the URI that should be downloaded"), + WEBKIT_TYPE_NETWORK_RESPONSE, + (GParamFlags)(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY))); + + /** * WebKitDownload:destination-uri * * The URI of the save location for this download. @@ -530,11 +557,29 @@ WebKitNetworkRequest* webkit_download_get_network_request(WebKitDownload* downlo return priv->networkRequest; } +/** + * webkit_download_get_network_response: + * @download: the #WebKitDownload + * + * Retrieves the #WebKitNetworkResponse object that backs the download + * process. + * + * Returns: the #WebKitNetworkResponse instance + * + * Since: 1.1.16 + */ +WebKitNetworkResponse* webkit_download_get_network_response(WebKitDownload* download) +{ + g_return_val_if_fail(WEBKIT_IS_DOWNLOAD(download), NULL); + + WebKitDownloadPrivate* priv = download->priv; + return priv->networkResponse; +} + static void webkit_download_set_response(WebKitDownload* download, const ResourceResponse& response) { - // FIXME Use WebKitNetworkResponse when it's merged. WebKitDownloadPrivate* priv = download->priv; - priv->networkResponse = new ResourceResponse(response); + priv->networkResponse = webkit_network_response_new_with_core_response(response); if (!response.isNull() && !response.suggestedFilename().isEmpty()) webkit_download_set_suggested_filename(download, response.suggestedFilename().utf8().data()); @@ -704,10 +749,12 @@ guint64 webkit_download_get_total_size(WebKitDownload* download) g_return_val_if_fail(WEBKIT_IS_DOWNLOAD(download), 0); WebKitDownloadPrivate* priv = download->priv; - if (!priv->networkResponse) + SoupMessage* message = priv->networkResponse ? webkit_network_response_get_message(priv->networkResponse) : NULL; + + if (!message) return 0; - return MAX(priv->currentSize, priv->networkResponse->expectedContentLength()); + return MAX(priv->currentSize, soup_message_headers_get_content_length(message->response_headers)); } /** @@ -744,9 +791,9 @@ gdouble webkit_download_get_progress(WebKitDownload* download) WebKitDownloadPrivate* priv = download->priv; if (!priv->networkResponse) - return 0; + return 0.0; - gdouble total_size = (gdouble)priv->networkResponse->expectedContentLength(); + gdouble total_size = static_cast<gdouble>(webkit_download_get_total_size(download)); if (total_size == 0) return 1.0; @@ -803,7 +850,7 @@ static void webkit_download_received_data(WebKitDownload* download, const gchar* g_object_notify(G_OBJECT(download), "current-size"); ASSERT(priv->networkResponse); - if (priv->currentSize > priv->networkResponse->expectedContentLength()) + if (priv->currentSize > webkit_download_get_total_size(download)) g_object_notify(G_OBJECT(download), "total-size"); gdouble lastProgress = webkit_download_get_progress(download); diff --git a/WebKit/gtk/webkit/webkitdownload.h b/WebKit/gtk/webkit/webkitdownload.h index 6e7f38b..a732a57 100644 --- a/WebKit/gtk/webkit/webkitdownload.h +++ b/WebKit/gtk/webkit/webkitdownload.h @@ -84,6 +84,9 @@ webkit_download_get_uri (WebKitDownload *download); WEBKIT_API WebKitNetworkRequest* webkit_download_get_network_request (WebKitDownload *download); +WEBKIT_API WebKitNetworkResponse* +webkit_download_get_network_response (WebKitDownload *download); + WEBKIT_API const gchar* webkit_download_get_suggested_filename (WebKitDownload *download); diff --git a/WebKit/gtk/webkit/webkitprivate.h b/WebKit/gtk/webkit/webkitprivate.h index 44dac04..088175f 100644 --- a/WebKit/gtk/webkit/webkitprivate.h +++ b/WebKit/gtk/webkit/webkitprivate.h @@ -224,6 +224,10 @@ extern "C" { void webkit_web_inspector_set_inspected_uri(WebKitWebInspector* web_inspector, const gchar* inspected_uri); + WEBKIT_API void + webkit_web_inspector_execute_script(WebKitWebInspector* inspector, long callId, const gchar* script); + + WebKitWebWindowFeatures* webkit_web_window_features_new_from_core_features (const WebCore::WindowFeatures& features); @@ -285,6 +289,9 @@ extern "C" { WEBKIT_API gchar* webkit_web_frame_dump_render_tree (WebKitWebFrame* frame); + WEBKIT_API gchar* + webkit_web_frame_counter_value_for_element_by_id (WebKitWebFrame* frame, const gchar* id); + WEBKIT_API guint webkit_web_frame_get_pending_unload_event_count(WebKitWebFrame* frame); diff --git a/WebKit/gtk/webkit/webkitsecurityorigin.h b/WebKit/gtk/webkit/webkitsecurityorigin.h index 57bcd19..24ebe06 100644 --- a/WebKit/gtk/webkit/webkitsecurityorigin.h +++ b/WebKit/gtk/webkit/webkitsecurityorigin.h @@ -20,7 +20,6 @@ #ifndef webkitsecurityorigin_h #define webkitsecurityorigin_h -#include "webkitsecurityorigin.h" #include "webkitwebdatabase.h" G_BEGIN_DECLS diff --git a/WebKit/gtk/webkit/webkitwebframe.cpp b/WebKit/gtk/webkit/webkitwebframe.cpp index 67fa632..843f923 100644 --- a/WebKit/gtk/webkit/webkitwebframe.cpp +++ b/WebKit/gtk/webkit/webkitwebframe.cpp @@ -683,7 +683,7 @@ JSGlobalContextRef webkit_web_frame_get_global_context(WebKitWebFrame* frame) if (!coreFrame) return NULL; - return toGlobalRef(coreFrame->script()->globalObject()->globalExec()); + return toGlobalRef(coreFrame->script()->globalObject(mainThreadNormalWorld())->globalExec()); } /** @@ -799,6 +799,28 @@ gchar* webkit_web_frame_dump_render_tree(WebKitWebFrame* frame) } /** + * webkit_web_frame_counter_value_for_element_by_id: + * @frame: a #WebKitWebFrame + * @id: an element ID string + * + * Return value: The counter value of element @id in @frame + */ +gchar* webkit_web_frame_counter_value_for_element_by_id(WebKitWebFrame* frame, const gchar* id) +{ + g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), NULL); + + Frame* coreFrame = core(frame); + if (!coreFrame) + return 0; + + Element* coreElement = coreFrame->document()->getElementById(AtomicString(id)); + if (!coreElement) + return 0; + String counterValue = counterValueForElement(coreElement); + return g_strdup(counterValue.utf8().data()); +} + +/** * webkit_web_frame_get_pending_unload_event_count: * @frame: a #WebKitWebFrame * diff --git a/WebKit/gtk/webkit/webkitwebinspector.cpp b/WebKit/gtk/webkit/webkitwebinspector.cpp index 4e4f8de..ee2815c 100644 --- a/WebKit/gtk/webkit/webkitwebinspector.cpp +++ b/WebKit/gtk/webkit/webkitwebinspector.cpp @@ -1,6 +1,7 @@ /* * Copyright (C) 2008 Gustavo Noronha Silva * Copyright (C) 2008, 2009 Holger Hans Peter Freyther + * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -19,11 +20,18 @@ */ #include "config.h" +#include "webkitwebinspector.h" +#include "FocusController.h" +#include "Frame.h" #include <glib/gi18n-lib.h> -#include "webkitwebinspector.h" -#include "webkitmarshal.h" +#include "HitTestRequest.h" +#include "HitTestResult.h" #include "InspectorClientGtk.h" +#include "IntPoint.h" +#include "Page.h" +#include "RenderView.h" +#include "webkitmarshal.h" #include "webkitprivate.h" /** @@ -56,6 +64,7 @@ */ using namespace WebKit; +using namespace WebCore; enum { INSPECT_WEB_VIEW, @@ -426,3 +435,66 @@ webkit_web_inspector_set_inspector_client(WebKitWebInspector* web_inspector, Web priv->page = page; } + +/** + * webkit_web_inspector_inspect_coordinates: + * @web_inspector: the #WebKitWebInspector that will do the inspection + * @x: the X coordinate of the node to be inspected + * @y: the Y coordinate of the node to be inspected + * + * Causes the Web Inspector to inspect the node that is located at the + * given coordinates of the widget. The coordinates should be relative + * to the #WebKitWebView widget, not to the scrollable content, and + * may be obtained from a #GdkEvent directly. + * + * This means @x, and @y being zero doesn't guarantee you will hit the + * left-most top corner of the content, since the contents may have + * been scrolled. + * + * Since: 1.1.17 + */ +void webkit_web_inspector_inspect_coordinates(WebKitWebInspector* webInspector, gdouble x, gdouble y) +{ + g_return_if_fail(WEBKIT_IS_WEB_INSPECTOR(webInspector)); + g_return_if_fail(x >= 0 && y >= 0); + + WebKitWebInspectorPrivate* priv = webInspector->priv; + + Frame* frame = priv->page->focusController()->focusedOrMainFrame(); + FrameView* view = frame->view(); + + if (!view) + return; + + HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active); + IntPoint documentPoint = view->windowToContents(IntPoint(static_cast<int>(x), static_cast<int>(y))); + HitTestResult result(documentPoint); + + frame->contentRenderer()->layer()->hitTest(request, result); + priv->page->inspectorController()->inspect(result.innerNonSharedNode()); +} + +/** + * webkit_web_inspector_close: + * @web_inspector: the #WebKitWebInspector that will be closed + * + * Causes the Web Inspector to be closed. + * + * Since: 1.1.17 + */ +void webkit_web_inspector_close(WebKitWebInspector* webInspector) +{ + g_return_if_fail(WEBKIT_IS_WEB_INSPECTOR(webInspector)); + + WebKitWebInspectorPrivate* priv = webInspector->priv; + priv->page->inspectorController()->close(); +} + +void webkit_web_inspector_execute_script(WebKitWebInspector* webInspector, long callId, const gchar* script) +{ + g_return_if_fail(WEBKIT_IS_WEB_INSPECTOR(webInspector)); + g_return_if_fail(script); + + WebKitWebInspectorPrivate* priv = webInspector->priv; + priv->page->inspectorController()->evaluateForTestInFrontend(callId, script); +} diff --git a/WebKit/gtk/webkit/webkitwebinspector.h b/WebKit/gtk/webkit/webkitwebinspector.h index 9010e26..94fd806 100644 --- a/WebKit/gtk/webkit/webkitwebinspector.h +++ b/WebKit/gtk/webkit/webkitwebinspector.h @@ -60,6 +60,12 @@ webkit_web_inspector_get_web_view(WebKitWebInspector* web_inspector); WEBKIT_API const gchar* webkit_web_inspector_get_inspected_uri(WebKitWebInspector* web_inspector); +WEBKIT_API void +webkit_web_inspector_inspect_coordinates(WebKitWebInspector* web_inspector, gdouble x, gdouble y); + +WEBKIT_API void +webkit_web_inspector_close(WebKitWebInspector* webInspector); + G_END_DECLS #endif /* webkitwebinspector_h */ diff --git a/WebKit/gtk/webkit/webkitwebsettings.cpp b/WebKit/gtk/webkit/webkitwebsettings.cpp index 588d5bd..89c5233 100644 --- a/WebKit/gtk/webkit/webkitwebsettings.cpp +++ b/WebKit/gtk/webkit/webkitwebsettings.cpp @@ -96,6 +96,8 @@ struct _WebKitWebSettingsPrivate { gboolean enable_offline_web_application_cache; WebKitEditingBehavior editing_behavior; gboolean enable_universal_access_from_file_uris; + gboolean enable_web_sockets; + gboolean enable_dom_paste; }; #define WEBKIT_WEB_SETTINGS_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_SETTINGS, WebKitWebSettingsPrivate)) @@ -135,7 +137,9 @@ enum { PROP_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY, PROP_ENABLE_OFFLINE_WEB_APPLICATION_CACHE, PROP_EDITING_BEHAVIOR, - PROP_ENABLE_UNIVERSAL_ACCESS_FROM_FILE_URIS + PROP_ENABLE_UNIVERSAL_ACCESS_FROM_FILE_URIS, + PROP_ENABLE_WEB_SOCKETS, + PROP_ENABLE_DOM_PASTE }; // Create a default user agent string @@ -647,6 +651,40 @@ static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass) FALSE, flags)); + /** + * WebKitWebSettings:enable-web-sockets + * + * Whether to enable support for Web Sockets. + * + * Implementation of Web Sockets is currently considered experimental. + * Name of this property and the behavior could change in the future. + * + * Since: 1.1.16 + */ + g_object_class_install_property(gobject_class, + PROP_ENABLE_WEB_SOCKETS, + g_param_spec_boolean("enable-web-sockets", + _("Enable Web Sockets"), + _("Whether to enable Web Sockets"), + FALSE, + flags)); + + /** + * WebKitWebSettings:enable-dom-paste + * + * Whether to enable DOM paste. If set to %TRUE, document.execCommand("Paste") + * will correctly execute and paste content of the clipboard. + * + * Since: 1.1.16 + */ + g_object_class_install_property(gobject_class, + PROP_ENABLE_DOM_PASTE, + g_param_spec_boolean("enable-dom-paste", + _("Enable DOM paste"), + _("Whether to enable DOM paste"), + FALSE, + flags)); + g_type_class_add_private(klass, sizeof(WebKitWebSettingsPrivate)); } @@ -694,6 +732,7 @@ static void webkit_web_settings_set_property(GObject* object, guint prop_id, con { WebKitWebSettings* web_settings = WEBKIT_WEB_SETTINGS(object); WebKitWebSettingsPrivate* priv = web_settings->priv; + EnchantBroker* broker; SpellLanguage* lang; GSList* spellLanguages = NULL; @@ -787,26 +826,32 @@ static void webkit_web_settings_set_property(GObject* object, guint prop_id, con case PROP_SPELL_CHECKING_LANGUAGES: priv->spell_checking_languages = g_strdup(g_value_get_string(value)); + broker = enchant_broker_init(); if (priv->spell_checking_languages) { char** langs = g_strsplit(priv->spell_checking_languages, ",", -1); for (int i = 0; langs[i]; i++) { - lang = g_slice_new0(SpellLanguage); - lang->config = enchant_broker_init(); - lang->speller = enchant_broker_request_dict(lang->config, langs[i]); + if (enchant_broker_dict_exists(broker, langs[i])) { + lang = g_slice_new0(SpellLanguage); + lang->config = enchant_broker_init(); + lang->speller = enchant_broker_request_dict(lang->config, langs[i]); - spellLanguages = g_slist_append(spellLanguages, lang); + spellLanguages = g_slist_append(spellLanguages, lang); + } } g_strfreev(langs); } else { const char* language = pango_language_to_string(gtk_get_default_language()); - lang = g_slice_new0(SpellLanguage); - lang->config = enchant_broker_init(); - lang->speller = enchant_broker_request_dict(lang->config, language); + if (enchant_broker_dict_exists(broker, language)) { + lang = g_slice_new0(SpellLanguage); + lang->config = enchant_broker_init(); + lang->speller = enchant_broker_request_dict(lang->config, language); - spellLanguages = g_slist_append(spellLanguages, lang); + spellLanguages = g_slist_append(spellLanguages, lang); + } } + enchant_broker_free(broker); g_slist_foreach(priv->spell_checking_languages_list, free_spell_checking_language, NULL); g_slist_free(priv->spell_checking_languages_list); priv->spell_checking_languages_list = spellLanguages; @@ -833,6 +878,12 @@ static void webkit_web_settings_set_property(GObject* object, guint prop_id, con case PROP_ENABLE_UNIVERSAL_ACCESS_FROM_FILE_URIS: priv->enable_universal_access_from_file_uris = g_value_get_boolean(value); break; + case PROP_ENABLE_WEB_SOCKETS: + priv->enable_web_sockets = g_value_get_boolean(value); + break; + case PROP_ENABLE_DOM_PASTE: + priv->enable_dom_paste = g_value_get_boolean(value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; @@ -944,6 +995,12 @@ static void webkit_web_settings_get_property(GObject* object, guint prop_id, GVa case PROP_ENABLE_UNIVERSAL_ACCESS_FROM_FILE_URIS: g_value_set_boolean(value, priv->enable_universal_access_from_file_uris); break; + case PROP_ENABLE_WEB_SOCKETS: + g_value_set_boolean(value, priv->enable_web_sockets); + break; + case PROP_ENABLE_DOM_PASTE: + g_value_set_boolean(value, priv->enable_dom_paste); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; @@ -1008,6 +1065,8 @@ WebKitWebSettings* webkit_web_settings_copy(WebKitWebSettings* web_settings) "enable-offline-web-application-cache", priv->enable_offline_web_application_cache, "editing-behavior", priv->editing_behavior, "enable-universal-access-from-file-uris", priv->enable_universal_access_from_file_uris, + "enable-web-sockets", priv->enable_web_sockets, + "enable-dom-paste", priv->enable_dom_paste, NULL)); return copy; diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp index 47d7d98..9f668f4 100644 --- a/WebKit/gtk/webkit/webkitwebview.cpp +++ b/WebKit/gtk/webkit/webkitwebview.cpp @@ -2392,7 +2392,7 @@ static void webkit_web_view_update_settings(WebKitWebView* webView) enableScripts, enablePlugins, enableDeveloperExtras, resizableTextAreas, enablePrivateBrowsing, enableCaretBrowsing, enableHTML5Database, enableHTML5LocalStorage, enableXSSAuditor, javascriptCanOpenWindows, enableOfflineWebAppCache, - enableUniversalAccessFromFileURI; + enableUniversalAccessFromFileURI, enableDOMPaste; WebKitEditingBehavior editingBehavior; @@ -2421,6 +2421,7 @@ static void webkit_web_view_update_settings(WebKitWebView* webView) "enable-offline-web-application-cache", &enableOfflineWebAppCache, "editing-behavior", &editingBehavior, "enable-universal-access-from-file-uris", &enableUniversalAccessFromFileURI, + "enable-dom-paste", &enableDOMPaste, NULL); settings->setDefaultTextEncodingName(defaultEncoding); @@ -2447,6 +2448,7 @@ static void webkit_web_view_update_settings(WebKitWebView* webView) settings->setOfflineWebApplicationCacheEnabled(enableOfflineWebAppCache); settings->setEditingBehavior(core(editingBehavior)); settings->setAllowUniversalAccessFromFileURLs(enableUniversalAccessFromFileURI); + settings->setDOMPasteAllowed(enableDOMPaste); g_free(defaultEncoding); g_free(cursiveFontFamily); @@ -2533,6 +2535,8 @@ static void webkit_web_view_settings_notify(WebKitWebSettings* webSettings, GPar settings->setEditingBehavior(core(static_cast<WebKitEditingBehavior>(g_value_get_enum(&value)))); else if (name == g_intern_string("enable-universal-access-from-file-uris")) settings->setAllowUniversalAccessFromFileURLs(g_value_get_boolean(&value)); + else if (name == g_intern_string("enable-dom-paste")) + settings->setDOMPasteAllowed(g_value_get_boolean(&value)); else if (!g_object_class_find_property(G_OBJECT_GET_CLASS(webSettings), name)) g_warning("Unexpected setting '%s'", name); g_value_unset(&value); @@ -3152,8 +3156,7 @@ void webkit_web_view_execute_script(WebKitWebView* webView, const gchar* script) g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView)); g_return_if_fail(script); - if (FrameLoader* loader = core(webView)->mainFrame()->loader()) - loader->executeScript(String::fromUTF8(script), true); + core(webView)->mainFrame()->script()->executeScript(String::fromUTF8(script), true); } /** @@ -3894,8 +3897,12 @@ WebKitWebResource* webkit_web_view_get_resource(WebKitWebView* webView, char* id gboolean resourceFound = g_hash_table_lookup_extended(priv->subResources, identifier, NULL, &webResource); - // The only resource we do not store in this hash table is the main! - g_return_val_if_fail(resourceFound || g_str_equal(identifier, priv->mainResourceIdentifier), NULL); + // The only resource we do not store in this hash table is the + // main! If we did not find a request, it probably means the load + // has been interrupted while while a resource was still being + // loaded. + if (!resourceFound && !g_str_equal(identifier, priv->mainResourceIdentifier)) + return NULL; if (!webResource) return webkit_web_view_get_main_resource(webView); |