From 43a42f108af6bcbd91f2672731c3047c26213af1 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 22 Oct 2012 15:40:17 +0200 Subject: Imported WebKit commit 302e7806bff028bd1167a1ec7c86a1ee00ecfb49 (http://svn.webkit.org/repository/webkit/trunk@132067) New snapshot that fixes build without QtWidgets --- .../UIProcess/API/gtk/WebKitWindowProperties.cpp | 77 +++++++++++----------- 1 file changed, 39 insertions(+), 38 deletions(-) (limited to 'Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp') diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp index 242b753e8..930cf8676 100644 --- a/Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp @@ -20,12 +20,17 @@ #include "config.h" #include "WebKitWindowProperties.h" +#include "ImmutableDictionary.h" #include "WebKitPrivate.h" #include "WebKitWindowPropertiesPrivate.h" +#include "WebNumber.h" #include "WebURLRequest.h" #include #include +using namespace WebKit; +using namespace WebCore; + /** * SECTION: WebKitWindowProperties * @short_description: Window properties of a #WebKitWebView @@ -101,8 +106,6 @@ enum { PROP_FULLSCREEN }; -using namespace WebCore; - G_DEFINE_TYPE(WebKitWindowProperties, webkit_window_properties, G_TYPE_OBJECT) struct _WebKitWindowPropertiesPrivate { @@ -388,56 +391,54 @@ void webkitWindowPropertiesSetFullscreen(WebKitWindowProperties* windowPropertie g_object_notify(G_OBJECT(windowProperties), "fullscreen"); } -void webkitWindowPropertiesUpdateFromWKWindowFeatures(WebKitWindowProperties* windowProperties, WKDictionaryRef wkFeatures) +void webkitWindowPropertiesUpdateFromWebWindowFeatures(WebKitWindowProperties* windowProperties, ImmutableDictionary* features) { GdkRectangle geometry = windowProperties->priv->geometry; - WKDoubleRef doubleValue; - WKRetainPtr xKey(AdoptWK, WKStringCreateWithUTF8CString("x")); - if (doubleValue = static_cast(WKDictionaryGetItemForKey(wkFeatures, xKey.get()))) - geometry.x = WKDoubleGetValue(doubleValue); + WebDouble* doubleValue = static_cast(features->get("x")); + if (doubleValue) + geometry.x = doubleValue->value(); - WKRetainPtr yKey(AdoptWK, WKStringCreateWithUTF8CString("y")); - if (doubleValue = static_cast(WKDictionaryGetItemForKey(wkFeatures, yKey.get()))) - geometry.y = WKDoubleGetValue(doubleValue); + doubleValue = static_cast(features->get("y")); + if (doubleValue) + geometry.y = doubleValue->value(); - WKRetainPtr widthKey(AdoptWK, WKStringCreateWithUTF8CString("width")); - if (doubleValue = static_cast(WKDictionaryGetItemForKey(wkFeatures, widthKey.get()))) - geometry.width = WKDoubleGetValue(doubleValue); + doubleValue = static_cast(features->get("width")); + if (doubleValue) + geometry.width = doubleValue->value(); - WKRetainPtr heightKey(AdoptWK, WKStringCreateWithUTF8CString("height")); - if (doubleValue = static_cast(WKDictionaryGetItemForKey(wkFeatures, heightKey.get()))) - geometry.height = WKDoubleGetValue(doubleValue); + doubleValue = static_cast(features->get("height")); + if (doubleValue) + geometry.height = doubleValue->value(); webkitWindowPropertiesSetGeometry(windowProperties, &geometry); - WKBooleanRef booleanValue; - WKRetainPtr menuBarVisibleKey(AdoptWK, WKStringCreateWithUTF8CString("menuBarVisible")); - if (booleanValue = static_cast(WKDictionaryGetItemForKey(wkFeatures, menuBarVisibleKey.get()))) - webkitWindowPropertiesSetMenubarVisible(windowProperties, WKBooleanGetValue(booleanValue)); + WebBoolean* booleanValue = static_cast(features->get("menuBarVisible")); + if (booleanValue) + webkitWindowPropertiesSetMenubarVisible(windowProperties, booleanValue->value()); - WKRetainPtr statusBarVisibleKey(AdoptWK, WKStringCreateWithUTF8CString("statusBarVisible")); - if (booleanValue = static_cast(WKDictionaryGetItemForKey(wkFeatures, statusBarVisibleKey.get()))) - webkitWindowPropertiesSetStatusbarVisible(windowProperties, WKBooleanGetValue(booleanValue)); + booleanValue = static_cast(features->get("statusBarVisible")); + if (booleanValue) + webkitWindowPropertiesSetStatusbarVisible(windowProperties, booleanValue->value()); - WKRetainPtr toolBarVisibleKey(AdoptWK, WKStringCreateWithUTF8CString("toolBarVisible")); - if (booleanValue = static_cast(WKDictionaryGetItemForKey(wkFeatures, toolBarVisibleKey.get()))) - webkitWindowPropertiesSetToolbarVisible(windowProperties, WKBooleanGetValue(booleanValue)); + booleanValue = static_cast(features->get("toolBarVisible")); + if (booleanValue) + webkitWindowPropertiesSetToolbarVisible(windowProperties, booleanValue->value()); - WKRetainPtr locationBarVisibleKey(AdoptWK, WKStringCreateWithUTF8CString("locationBarVisible")); - if (booleanValue = static_cast(WKDictionaryGetItemForKey(wkFeatures, locationBarVisibleKey.get()))) - webkitWindowPropertiesSetLocationbarVisible(windowProperties, WKBooleanGetValue(booleanValue)); + booleanValue = static_cast(features->get("locationBarVisible")); + if (booleanValue) + webkitWindowPropertiesSetLocationbarVisible(windowProperties, booleanValue->value()); - WKRetainPtr scrollbarsVisibleKey(AdoptWK, WKStringCreateWithUTF8CString("scrollbarsVisible")); - if (booleanValue = static_cast(WKDictionaryGetItemForKey(wkFeatures, scrollbarsVisibleKey.get()))) - webkitWindowPropertiesSetScrollbarsVisible(windowProperties, WKBooleanGetValue(booleanValue)); + booleanValue = static_cast(features->get("scrollbarsVisible")); + if (booleanValue) + webkitWindowPropertiesSetScrollbarsVisible(windowProperties, booleanValue->value()); - WKRetainPtr resizableKey(AdoptWK, WKStringCreateWithUTF8CString("resizable")); - if (booleanValue = static_cast(WKDictionaryGetItemForKey(wkFeatures, resizableKey.get()))) - webkitWindowPropertiesSetResizable(windowProperties, WKBooleanGetValue(booleanValue)); + booleanValue = static_cast(features->get("resizable")); + if (booleanValue) + webkitWindowPropertiesSetResizable(windowProperties, booleanValue->value()); - WKRetainPtr fullscreenKey(AdoptWK, WKStringCreateWithUTF8CString("fullscreen")); - if (booleanValue = static_cast(WKDictionaryGetItemForKey(wkFeatures, fullscreenKey.get()))) - webkitWindowPropertiesSetFullscreen(windowProperties, WKBooleanGetValue(booleanValue)); + booleanValue = static_cast(features->get("fullscreen")); + if (booleanValue) + webkitWindowPropertiesSetFullscreen(windowProperties, booleanValue->value()); } /** -- cgit v1.2.1