summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp')
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp328
1 files changed, 290 insertions, 38 deletions
diff --git a/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp b/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp
index 7c49ccd82..83b70edee 100644
--- a/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp
@@ -31,18 +31,25 @@
#include "config.h"
#include "WebKitSettings.h"
-#include "ExperimentalFeatures.h"
+#include "HardwareAccelerationManager.h"
+#include "WebKitEnumTypes.h"
#include "WebKitPrivate.h"
#include "WebKitSettingsPrivate.h"
-#include <WebCore/UserAgentGtk.h>
+#include "WebPageProxy.h"
+#include "WebPreferences.h"
+#include <WebCore/UserAgent.h>
#include <glib/gi18n-lib.h>
#include <wtf/text/CString.h>
+#if PLATFORM(WAYLAND)
+#include <WebCore/PlatformDisplay.h>
+#endif
+
using namespace WebKit;
struct _WebKitSettingsPrivate {
_WebKitSettingsPrivate()
- : preferences(WebPreferences::create())
+ : preferences(WebPreferences::create(String(), "WebKit2.", "WebKit2."))
{
defaultFontFamily = preferences->standardFontFamily().utf8();
monospaceFontFamily = preferences->fixedFontFamily().utf8();
@@ -70,13 +77,12 @@ struct _WebKitSettingsPrivate {
/**
* SECTION:WebKitSettings
- * @short_description: Control the behaviour of #WebKitWebView<!-- -->s
- * @see_also: #WebKitWebViewGroup, #WebKitWebView
+ * @short_description: Control the behaviour of a #WebKitWebView
*
- * #WebKitSettings can be applied to a #WebKitWebViewGroup to control text charset,
+ * #WebKitSettings can be applied to a #WebKitWebView to control text charset,
* color, font sizes, printing mode, script support, loading of images and various
- * other things on the #WebKitWebView<!-- -->s of the group.
- * After creation, a #WebKitSettings object contains default settings.
+ * other things on a #WebKitWebView. After creation, a #WebKitSettings object
+ * contains default settings.
*
* <informalexample><programlisting>
* /<!-- -->* Disable JavaScript. *<!-- -->/
@@ -138,7 +144,10 @@ enum {
PROP_ENABLE_WRITE_CONSOLE_MESSAGES_TO_STDOUT,
PROP_ENABLE_MEDIA_STREAM,
PROP_ENABLE_SPATIAL_NAVIGATION,
- PROP_ENABLE_MEDIASOURCE
+ PROP_ENABLE_MEDIASOURCE,
+ PROP_ALLOW_FILE_ACCESS_FROM_FILE_URLS,
+ PROP_ALLOW_UNIVERSAL_ACCESS_FROM_FILE_URLS,
+ PROP_HARDWARE_ACCELERATION_POLICY,
};
static void webKitSettingsConstructed(GObject* object)
@@ -146,14 +155,6 @@ static void webKitSettingsConstructed(GObject* object)
G_OBJECT_CLASS(webkit_settings_parent_class)->constructed(object);
WebPreferences* prefs = WEBKIT_SETTINGS(object)->priv->preferences.get();
- ExperimentalFeatures features;
- bool cssGridLayoutEnabled = features.isEnabled(ExperimentalFeatures::CSSGridLayout);
- if (prefs->cssGridLayoutEnabled() != cssGridLayoutEnabled)
- prefs->setCSSGridLayoutEnabled(cssGridLayoutEnabled);
- bool regionBasedColumnsEnabled = features.isEnabled(ExperimentalFeatures::RegionBasedColumns);
- if (prefs->regionBasedColumnsEnabled() != regionBasedColumnsEnabled)
- prefs->setRegionBasedColumnsEnabled(regionBasedColumnsEnabled);
-
prefs->setShouldRespectImageOrientation(true);
}
@@ -232,7 +233,9 @@ static void webKitSettingsSetProperty(GObject* object, guint propId, const GValu
webkit_settings_set_default_charset(settings, g_value_get_string(value));
break;
case PROP_ENABLE_PRIVATE_BROWSING:
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
webkit_settings_set_enable_private_browsing(settings, g_value_get_boolean(value));
+ G_GNUC_END_IGNORE_DEPRECATIONS;
break;
case PROP_ENABLE_DEVELOPER_EXTRAS:
webkit_settings_set_enable_developer_extras(settings, g_value_get_boolean(value));
@@ -312,6 +315,15 @@ static void webKitSettingsSetProperty(GObject* object, guint propId, const GValu
case PROP_ENABLE_MEDIASOURCE:
webkit_settings_set_enable_mediasource(settings, g_value_get_boolean(value));
break;
+ case PROP_ALLOW_FILE_ACCESS_FROM_FILE_URLS:
+ webkit_settings_set_allow_file_access_from_file_urls(settings, g_value_get_boolean(value));
+ break;
+ case PROP_ALLOW_UNIVERSAL_ACCESS_FROM_FILE_URLS:
+ webkit_settings_set_allow_universal_access_from_file_urls(settings, g_value_get_boolean(value));
+ break;
+ case PROP_HARDWARE_ACCELERATION_POLICY:
+ webkit_settings_set_hardware_acceleration_policy(settings, static_cast<WebKitHardwareAccelerationPolicy>(g_value_get_enum(value)));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);
break;
@@ -393,7 +405,9 @@ static void webKitSettingsGetProperty(GObject* object, guint propId, GValue* val
g_value_set_string(value, webkit_settings_get_default_charset(settings));
break;
case PROP_ENABLE_PRIVATE_BROWSING:
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
g_value_set_boolean(value, webkit_settings_get_enable_private_browsing(settings));
+ G_GNUC_END_IGNORE_DEPRECATIONS;
break;
case PROP_ENABLE_DEVELOPER_EXTRAS:
g_value_set_boolean(value, webkit_settings_get_enable_developer_extras(settings));
@@ -467,7 +481,15 @@ static void webKitSettingsGetProperty(GObject* object, guint propId, GValue* val
case PROP_ENABLE_MEDIASOURCE:
g_value_set_boolean(value, webkit_settings_get_enable_mediasource(settings));
break;
-
+ case PROP_ALLOW_FILE_ACCESS_FROM_FILE_URLS:
+ g_value_set_boolean(value, webkit_settings_get_allow_file_access_from_file_urls(settings));
+ break;
+ case PROP_ALLOW_UNIVERSAL_ACCESS_FROM_FILE_URLS:
+ g_value_set_boolean(value, webkit_settings_get_allow_universal_access_from_file_urls(settings));
+ break;
+ case PROP_HARDWARE_ACCELERATION_POLICY:
+ g_value_set_enum(value, webkit_settings_get_hardware_acceleration_policy(settings));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);
break;
@@ -665,7 +687,7 @@ static void webkit_settings_class_init(WebKitSettingsClass* klass)
readWriteConstructParamFlags));
/**
- * WebKitWebSettings:default-font-family:
+ * WebKitSettings:default-font-family:
*
* The font family to use as the default for content that does not specify a font.
*/
@@ -678,7 +700,7 @@ static void webkit_settings_class_init(WebKitSettingsClass* klass)
readWriteConstructParamFlags));
/**
- * WebKitWebSettings:monospace-font-family:
+ * WebKitSettings:monospace-font-family:
*
* The font family used as the default for content using a monospace font.
*
@@ -692,7 +714,7 @@ static void webkit_settings_class_init(WebKitSettingsClass* klass)
readWriteConstructParamFlags));
/**
- * WebKitWebSettings:serif-font-family:
+ * WebKitSettings:serif-font-family:
*
* The font family used as the default for content using a serif font.
*/
@@ -705,7 +727,7 @@ static void webkit_settings_class_init(WebKitSettingsClass* klass)
readWriteConstructParamFlags));
/**
- * WebKitWebSettings:sans-serif-font-family:
+ * WebKitSettings:sans-serif-font-family:
*
* The font family used as the default for content using a sans-serif font.
*/
@@ -718,7 +740,7 @@ static void webkit_settings_class_init(WebKitSettingsClass* klass)
readWriteConstructParamFlags));
/**
- * WebKitWebSettings:cursive-font-family:
+ * WebKitSettings:cursive-font-family:
*
* The font family used as the default for content using a cursive font.
*/
@@ -731,7 +753,7 @@ static void webkit_settings_class_init(WebKitSettingsClass* klass)
readWriteConstructParamFlags));
/**
- * WebKitWebSettings:fantasy-font-family:
+ * WebKitSettings:fantasy-font-family:
*
* The font family used as the default for content using a fantasy font.
*/
@@ -744,7 +766,7 @@ static void webkit_settings_class_init(WebKitSettingsClass* klass)
readWriteConstructParamFlags));
/**
- * WebKitWebSettings:pictograph-font-family:
+ * WebKitSettings:pictograph-font-family:
*
* The font family used as the default for content using a pictograph font.
*/
@@ -757,7 +779,7 @@ static void webkit_settings_class_init(WebKitSettingsClass* klass)
readWriteConstructParamFlags));
/**
- * WebKitWebSettings:default-font-size:
+ * WebKitSettings:default-font-size:
*
* The default font size in pixels to use for content displayed if
* no font size is specified.
@@ -771,7 +793,7 @@ static void webkit_settings_class_init(WebKitSettingsClass* klass)
readWriteConstructParamFlags));
/**
- * WebKitWebSettings:default-monospace-font-size:
+ * WebKitSettings:default-monospace-font-size:
*
* The default font size in pixels to use for content displayed in
* monospace font if no font size is specified.
@@ -785,7 +807,7 @@ static void webkit_settings_class_init(WebKitSettingsClass* klass)
readWriteConstructParamFlags));
/**
- * WebKitWebSettings:minimum-font-size:
+ * WebKitSettings:minimum-font-size:
*
* The minimum font size in points used to display text. This setting
* controls the absolute smallest size. Values other than 0 can
@@ -817,6 +839,8 @@ static void webkit_settings_class_init(WebKitSettingsClass* klass)
*
* Determines whether or not private browsing is enabled. Private browsing
* will disable history, cache and form auto-fill for any pages visited.
+ *
+ * Deprecated: 2.16. Use #WebKitWebView:is-ephemeral or #WebKitWebContext:is-ephemeral instead.
*/
g_object_class_install_property(gObjectClass,
PROP_ENABLE_PRIVATE_BROWSING,
@@ -1191,7 +1215,7 @@ static void webkit_settings_class_init(WebKitSettingsClass* klass)
* there is an element they might be trying to reach towards the right, and if
* there are multiple elements, which element they probably wants.
*
- * Since: 2.3
+ * Since: 2.4
*/
g_object_class_install_property(gObjectClass,
PROP_ENABLE_SPATIAL_NAVIGATION,
@@ -1220,6 +1244,71 @@ static void webkit_settings_class_init(WebKitSettingsClass* klass)
_("Whether MediaSource should be enabled."),
FALSE,
readWriteConstructParamFlags));
+
+ /**
+ * WebKitSettings:allow-file-access-from-file-urls:
+ *
+ * Whether file access is allowed from file URLs. By default, when
+ * something is loaded in a #WebKitWebView using a file URI, cross
+ * origin requests to other file resources are not allowed. This
+ * setting allows you to change that behaviour, so that it would be
+ * possible to do a XMLHttpRequest of a local file, for example.
+ *
+ * Since: 2.10
+ */
+ g_object_class_install_property(gObjectClass,
+ PROP_ALLOW_FILE_ACCESS_FROM_FILE_URLS,
+ g_param_spec_boolean("allow-file-access-from-file-urls",
+ _("Allow file access from file URLs"),
+ _("Whether file access is allowed from file URLs."),
+ FALSE,
+ readWriteConstructParamFlags));
+
+ /**
+ * WebKitSettings:allow-universal-access-from-file-urls:
+ *
+ * Whether or not JavaScript running in the context of a file scheme URL
+ * should be allowed to access content from any origin. By default, when
+ * something is loaded in a #WebKitWebView using a file scheme URL,
+ * access to the local file system and arbitrary local storage is not
+ * allowed. This setting allows you to change that behaviour, so that
+ * it would be possible to use local storage, for example.
+ *
+ * Since: 2.14
+ */
+ g_object_class_install_property(gObjectClass,
+ PROP_ALLOW_UNIVERSAL_ACCESS_FROM_FILE_URLS,
+ g_param_spec_boolean("allow-universal-access-from-file-urls",
+ _("Allow universal access from the context of file scheme URLs"),
+ _("Whether or not universal access is allowed from the context of file scheme URLs"),
+ FALSE,
+ readWriteConstructParamFlags));
+
+ /**
+ * WebKitSettings:hardware-acceleration-policy:
+ *
+ * The #WebKitHardwareAccelerationPolicy to decide how to enable and disable
+ * hardware acceleration. The default value %WEBKIT_HARDWARE_ACCELERATION_POLICY_ON_DEMAND
+ * enables the hardware acceleration when the web contents request it, disabling it again
+ * when no longer needed. It's possible to enfore hardware acceleration to be always enabled
+ * by using %WEBKIT_HARDWARE_ACCELERATION_POLICY_ALWAYS. And it's also posible to disable it
+ * completely using %WEBKIT_HARDWARE_ACCELERATION_POLICY_NEVER. Note that disabling hardware
+ * acceleration might cause some websites to not render correctly or consume more CPU.
+ *
+ * Note that changing this setting might not be possible if hardware acceleration is not
+ * supported by the hardware or the system. In that case you can get the value to know the
+ * actual policy being used, but changing the setting will not have any effect.
+ *
+ * Since: 2.16
+ */
+ g_object_class_install_property(gObjectClass,
+ PROP_HARDWARE_ACCELERATION_POLICY,
+ g_param_spec_enum("hardware-acceleration-policy",
+ _("Hardware Acceleration Policy"),
+ _("The policy to decide how to enable and disable hardware acceleration"),
+ WEBKIT_TYPE_HARDWARE_ACCELERATION_POLICY,
+ WEBKIT_HARDWARE_ACCELERATION_POLICY_ON_DEMAND,
+ readWriteConstructParamFlags));
}
WebPreferences* webkitSettingsGetPreferences(WebKitSettings* settings)
@@ -1231,7 +1320,7 @@ WebPreferences* webkitSettingsGetPreferences(WebKitSettings* settings)
* webkit_settings_new:
*
* Creates a new #WebKitSettings instance with default values. It must
- * be manually attached to a #WebKitWebViewGroup.
+ * be manually attached to a #WebKitWebView.
* See also webkit_settings_new_with_settings().
*
* Returns: a new #WebKitSettings instance.
@@ -1248,7 +1337,7 @@ WebKitSettings* webkit_settings_new()
* %NULL-terminated
*
* Creates a new #WebKitSettings instance with the given settings. It must
- * be manually attached to a #WebKitWebViewGroup.
+ * be manually attached to a #WebKitWebView.
*
* Returns: a new #WebKitSettings instance.
*/
@@ -2090,6 +2179,8 @@ void webkit_settings_set_default_charset(WebKitSettings* settings, const gchar*
* Get the #WebKitSettings:enable-private-browsing property.
*
* Returns: %TRUE If private browsing is enabled or %FALSE otherwise.
+ *
+ * Deprecated: 2.16. Use #WebKitWebView:is-ephemeral or #WebKitWebContext:is-ephemeral instead.
*/
gboolean webkit_settings_get_enable_private_browsing(WebKitSettings* settings)
{
@@ -2099,11 +2190,13 @@ gboolean webkit_settings_get_enable_private_browsing(WebKitSettings* settings)
}
/**
- * webkit_settings_set_private_caret_browsing:
+ * webkit_settings_set_enable_private_browsing:
* @settings: a #WebKitSettings
* @enabled: Value to be set
*
* Set the #WebKitSettings:enable-private-browsing property.
+ *
+ * Deprecated: 2.16. Use #WebKitWebView:is-ephemeral or #WebKitWebContext:is-ephemeral instead.
*/
void webkit_settings_set_enable_private_browsing(WebKitSettings* settings, gboolean enabled)
{
@@ -2551,7 +2644,7 @@ gboolean webkit_settings_get_media_playback_requires_user_gesture(WebKitSettings
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
- return settings->priv->preferences->mediaPlaybackRequiresUserGesture();
+ return settings->priv->preferences->requiresUserGestureForMediaPlayback();
}
/**
@@ -2566,11 +2659,11 @@ void webkit_settings_set_media_playback_requires_user_gesture(WebKitSettings* se
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = priv->preferences->mediaPlaybackRequiresUserGesture();
+ bool currentValue = priv->preferences->requiresUserGestureForMediaPlayback();
if (currentValue == enabled)
return;
- priv->preferences->setMediaPlaybackRequiresUserGesture(enabled);
+ priv->preferences->setRequiresUserGestureForMediaPlayback(enabled);
g_object_notify(G_OBJECT(settings), "media-playback-requires-user-gesture");
}
@@ -2587,7 +2680,7 @@ gboolean webkit_settings_get_media_playback_allows_inline(WebKitSettings* settin
{
g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), TRUE);
- return settings->priv->preferences->mediaPlaybackAllowsInline();
+ return settings->priv->preferences->allowsInlineMediaPlayback();
}
/**
@@ -2602,11 +2695,11 @@ void webkit_settings_set_media_playback_allows_inline(WebKitSettings* settings,
g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
WebKitSettingsPrivate* priv = settings->priv;
- bool currentValue = priv->preferences->mediaPlaybackAllowsInline();
+ bool currentValue = priv->preferences->allowsInlineMediaPlayback();
if (currentValue == enabled)
return;
- priv->preferences->setMediaPlaybackAllowsInline(enabled);
+ priv->preferences->setAllowsInlineMediaPlayback(enabled);
g_object_notify(G_OBJECT(settings), "media-playback-allows-inline");
}
@@ -2920,6 +3013,7 @@ void webkit_settings_set_enable_media_stream(WebKitSettings* settings, gboolean
return;
priv->preferences->setMediaStreamEnabled(enabled);
+ priv->preferences->setPeerConnectionEnabled(enabled);
g_object_notify(G_OBJECT(settings), "enable-media-stream");
}
@@ -3002,3 +3096,161 @@ void webkit_settings_set_enable_mediasource(WebKitSettings* settings, gboolean e
priv->preferences->setMediaSourceEnabled(enabled);
g_object_notify(G_OBJECT(settings), "enable-mediasource");
}
+
+/**
+ * webkit_settings_get_allow_file_access_from_file_urls:
+ * @settings: a #WebKitSettings
+ *
+ * Get the #WebKitSettings:allow-file-access-from-file-urls property.
+ *
+ * Returns: %TRUE If file access from file URLs is allowed or %FALSE otherwise.
+ *
+ * Since: 2.10
+ */
+gboolean webkit_settings_get_allow_file_access_from_file_urls(WebKitSettings* settings)
+{
+ g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
+
+ return settings->priv->preferences->allowFileAccessFromFileURLs();
+}
+
+/**
+ * webkit_settings_set_allow_file_access_from_file_urls:
+ * @settings: a #WebKitSettings
+ * @allowed: Value to be set
+ *
+ * Set the #WebKitSettings:allow-file-access-from-file-urls property.
+ *
+ * Since: 2.10
+ */
+void webkit_settings_set_allow_file_access_from_file_urls(WebKitSettings* settings, gboolean allowed)
+{
+ g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
+
+ WebKitSettingsPrivate* priv = settings->priv;
+ if (priv->preferences->allowFileAccessFromFileURLs() == allowed)
+ return;
+
+ priv->preferences->setAllowFileAccessFromFileURLs(allowed);
+ g_object_notify(G_OBJECT(settings), "allow-file-access-from-file-urls");
+}
+
+/**
+ * webkit_settings_get_allow_universal_access_from_file_urls:
+ * @settings: a #WebKitSettings
+ *
+ * Get the #WebKitSettings:allow-universal-access-from-file-urls property.
+ *
+ * Returns: %TRUE If universal access from file URLs is allowed or %FALSE otherwise.
+ *
+ * Since: 2.14
+ */
+gboolean webkit_settings_get_allow_universal_access_from_file_urls(WebKitSettings* settings)
+{
+ g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
+
+ return settings->priv->preferences->allowUniversalAccessFromFileURLs();
+}
+
+/**
+ * webkit_settings_set_allow_universal_access_from_file_urls:
+ * @settings: a #WebKitSettings
+ * @allowed: Value to be set
+ *
+ * Set the #WebKitSettings:allow-universal-access-from-file-urls property.
+ *
+ * Since: 2.14
+ */
+void webkit_settings_set_allow_universal_access_from_file_urls(WebKitSettings* settings, gboolean allowed)
+{
+ g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
+
+ WebKitSettingsPrivate* priv = settings->priv;
+ if (priv->preferences->allowUniversalAccessFromFileURLs() == allowed)
+ return;
+
+ priv->preferences->setAllowUniversalAccessFromFileURLs(allowed);
+ g_object_notify(G_OBJECT(settings), "allow-universal-access-from-file-urls");
+}
+
+/**
+ * webkit_settings_get_hardware_acceleration_policy:
+ * @settings: a #WebKitSettings
+ *
+ * Get the #WebKitSettings:hardware-acceleration-policy property.
+ *
+ * Return: a #WebKitHardwareAccelerationPolicy
+ *
+ * Since: 2.16
+ */
+WebKitHardwareAccelerationPolicy webkit_settings_get_hardware_acceleration_policy(WebKitSettings* settings)
+{
+ g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), WEBKIT_HARDWARE_ACCELERATION_POLICY_ON_DEMAND);
+
+ WebKitSettingsPrivate* priv = settings->priv;
+ if (!priv->preferences->acceleratedCompositingEnabled())
+ return WEBKIT_HARDWARE_ACCELERATION_POLICY_NEVER;
+
+ if (priv->preferences->forceCompositingMode())
+ return WEBKIT_HARDWARE_ACCELERATION_POLICY_ALWAYS;
+
+ return WEBKIT_HARDWARE_ACCELERATION_POLICY_ON_DEMAND;
+}
+
+/**
+ * webkit_settings_set_hardware_acceleration_policy:
+ * @settings: a #WebKitSettings
+ * @policy: a #WebKitHardwareAccelerationPolicy
+ *
+ * Set the #WebKitSettings:hardware-acceleration-policy property.
+ *
+ * Since: 2.16
+ */
+void webkit_settings_set_hardware_acceleration_policy(WebKitSettings* settings, WebKitHardwareAccelerationPolicy policy)
+{
+ g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
+
+ WebKitSettingsPrivate* priv = settings->priv;
+ bool changed = false;
+ switch (policy) {
+ case WEBKIT_HARDWARE_ACCELERATION_POLICY_ALWAYS:
+ if (!HardwareAccelerationManager::singleton().canUseHardwareAcceleration())
+ return;
+ if (!priv->preferences->acceleratedCompositingEnabled()) {
+ priv->preferences->setAcceleratedCompositingEnabled(true);
+ changed = true;
+ }
+ if (!priv->preferences->forceCompositingMode()) {
+ priv->preferences->setForceCompositingMode(true);
+ changed = true;
+ }
+ break;
+ case WEBKIT_HARDWARE_ACCELERATION_POLICY_NEVER:
+ if (HardwareAccelerationManager::singleton().forceHardwareAcceleration())
+ return;
+ if (priv->preferences->acceleratedCompositingEnabled()) {
+ priv->preferences->setAcceleratedCompositingEnabled(false);
+ changed = true;
+ }
+
+ if (priv->preferences->forceCompositingMode()) {
+ priv->preferences->setForceCompositingMode(false);
+ changed = true;
+ }
+ break;
+ case WEBKIT_HARDWARE_ACCELERATION_POLICY_ON_DEMAND:
+ if (!priv->preferences->acceleratedCompositingEnabled() && HardwareAccelerationManager::singleton().canUseHardwareAcceleration()) {
+ priv->preferences->setAcceleratedCompositingEnabled(true);
+ changed = true;
+ }
+
+ if (priv->preferences->forceCompositingMode() && !HardwareAccelerationManager::singleton().forceHardwareAcceleration()) {
+ priv->preferences->setForceCompositingMode(false);
+ changed = true;
+ }
+ break;
+ }
+
+ if (changed)
+ g_object_notify(G_OBJECT(settings), "hardware-acceleration-policy");
+}