3fc40e2539ac763a7f716eb4e5ac44221911c7f8
[WebKit-https.git] / Source / WebKit / UIProcess / API / glib / WebKitSettings.cpp
1 /*
2  * Copyright (c) 2011 Motorola Mobility, Inc.  All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without modification,
5  * are permitted provided that the following conditions are met:
6  *
7  * Redistributions of source code must retain the above copyright notice,
8  * this list of conditions and the following disclaimer.
9  *
10  * Redistributions in binary form must reproduce the above copyright notice,
11  * this list of conditions and the following disclaimer in the documentation and/or
12  * other materials provided with the distribution.
13  *
14  * Neither the name of Motorola Mobility, Inc. nor the names of its contributors may
15  * be used to endorse or promote products derived from this software without
16  * specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
20  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
22  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30
31 #include "config.h"
32 #include "WebKitSettings.h"
33
34 #include "WebKitEnumTypes.h"
35 #include "WebKitSettingsPrivate.h"
36 #include "WebPageProxy.h"
37 #include "WebPreferences.h"
38 #include <WebCore/PlatformScreen.h>
39 #include <WebCore/TextEncodingRegistry.h>
40 #include <WebCore/UserAgent.h>
41 #include <cmath>
42 #include <glib/gi18n-lib.h>
43 #include <wtf/glib/WTFGType.h>
44 #include <wtf/text/CString.h>
45
46 #if PLATFORM(GTK)
47 #include "HardwareAccelerationManager.h"
48 #endif
49
50 #if PLATFORM(WAYLAND)
51 #include <WebCore/PlatformDisplay.h>
52 #endif
53
54 using namespace WebKit;
55
56 struct _WebKitSettingsPrivate {
57     _WebKitSettingsPrivate()
58         : preferences(WebPreferences::create(String(), "WebKit2.", "WebKit2."))
59     {
60         defaultFontFamily = preferences->standardFontFamily().utf8();
61         monospaceFontFamily = preferences->fixedFontFamily().utf8();
62         serifFontFamily = preferences->serifFontFamily().utf8();
63         sansSerifFontFamily = preferences->sansSerifFontFamily().utf8();
64         cursiveFontFamily = preferences->cursiveFontFamily().utf8();
65         fantasyFontFamily = preferences->fantasyFontFamily().utf8();
66         pictographFontFamily = preferences->pictographFontFamily().utf8();
67         defaultCharset = preferences->defaultTextEncodingName().utf8();
68     }
69
70     RefPtr<WebPreferences> preferences;
71     CString defaultFontFamily;
72     CString monospaceFontFamily;
73     CString serifFontFamily;
74     CString sansSerifFontFamily;
75     CString cursiveFontFamily;
76     CString fantasyFontFamily;
77     CString pictographFontFamily;
78     CString defaultCharset;
79     CString userAgent;
80     bool allowModalDialogs { false };
81     bool zoomTextOnly { false };
82     double screenDpi { 96 };
83 };
84
85 /**
86  * SECTION:WebKitSettings
87  * @short_description: Control the behaviour of a #WebKitWebView
88  *
89  * #WebKitSettings can be applied to a #WebKitWebView to control text charset,
90  * color, font sizes, printing mode, script support, loading of images and various
91  * other things on a #WebKitWebView. After creation, a #WebKitSettings object
92  * contains default settings.
93  *
94  * <informalexample><programlisting>
95  * /<!-- -->* Disable JavaScript. *<!-- -->/
96  * WebKitSettings *settings = webkit_web_view_group_get_settings (my_view_group);
97  * webkit_settings_set_enable_javascript (settings, FALSE);
98  *
99  * </programlisting></informalexample>
100  */
101
102 WEBKIT_DEFINE_TYPE(WebKitSettings, webkit_settings, G_TYPE_OBJECT)
103
104 enum {
105     PROP_0,
106
107     PROP_ENABLE_JAVASCRIPT,
108     PROP_AUTO_LOAD_IMAGES,
109     PROP_LOAD_ICONS_IGNORING_IMAGE_LOAD_SETTING,
110     PROP_ENABLE_OFFLINE_WEB_APPLICATION_CACHE,
111     PROP_ENABLE_HTML5_LOCAL_STORAGE,
112     PROP_ENABLE_HTML5_DATABASE,
113     PROP_ENABLE_XSS_AUDITOR,
114     PROP_ENABLE_FRAME_FLATTENING,
115     PROP_ENABLE_PLUGINS,
116     PROP_ENABLE_JAVA,
117     PROP_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY,
118     PROP_ENABLE_HYPERLINK_AUDITING,
119     PROP_DEFAULT_FONT_FAMILY,
120     PROP_MONOSPACE_FONT_FAMILY,
121     PROP_SERIF_FONT_FAMILY,
122     PROP_SANS_SERIF_FONT_FAMILY,
123     PROP_CURSIVE_FONT_FAMILY,
124     PROP_FANTASY_FONT_FAMILY,
125     PROP_PICTOGRAPH_FONT_FAMILY,
126     PROP_DEFAULT_FONT_SIZE,
127     PROP_DEFAULT_MONOSPACE_FONT_SIZE,
128     PROP_MINIMUM_FONT_SIZE,
129     PROP_DEFAULT_CHARSET,
130 #if PLATFORM(GTK)
131     PROP_ENABLE_PRIVATE_BROWSING,
132 #endif
133     PROP_ENABLE_DEVELOPER_EXTRAS,
134     PROP_ENABLE_RESIZABLE_TEXT_AREAS,
135     PROP_ENABLE_TABS_TO_LINKS,
136     PROP_ENABLE_DNS_PREFETCHING,
137     PROP_ENABLE_CARET_BROWSING,
138     PROP_ENABLE_FULLSCREEN,
139     PROP_PRINT_BACKGROUNDS,
140     PROP_ENABLE_WEBAUDIO,
141     PROP_ENABLE_WEBGL,
142     PROP_ALLOW_MODAL_DIALOGS,
143     PROP_ZOOM_TEXT_ONLY,
144     PROP_JAVASCRIPT_CAN_ACCESS_CLIPBOARD,
145     PROP_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE,
146     PROP_MEDIA_PLAYBACK_ALLOWS_INLINE,
147     PROP_DRAW_COMPOSITING_INDICATORS,
148     PROP_ENABLE_SITE_SPECIFIC_QUIRKS,
149     PROP_ENABLE_PAGE_CACHE,
150     PROP_USER_AGENT,
151     PROP_ENABLE_SMOOTH_SCROLLING,
152     PROP_ENABLE_ACCELERATED_2D_CANVAS,
153     PROP_ENABLE_WRITE_CONSOLE_MESSAGES_TO_STDOUT,
154     PROP_ENABLE_MEDIA_STREAM,
155     PROP_ENABLE_SPATIAL_NAVIGATION,
156     PROP_ENABLE_MEDIASOURCE,
157     PROP_ENABLE_ENCRYPTED_MEDIA,
158     PROP_ENABLE_MEDIA_CAPABILITIES,
159     PROP_ALLOW_FILE_ACCESS_FROM_FILE_URLS,
160     PROP_ALLOW_UNIVERSAL_ACCESS_FROM_FILE_URLS,
161 #if PLATFORM(GTK)
162     PROP_HARDWARE_ACCELERATION_POLICY,
163 #endif
164 };
165
166 static void webKitSettingsDispose(GObject* object)
167 {
168     WebCore::setScreenDPIObserverHandler(nullptr, object);
169     G_OBJECT_CLASS(webkit_settings_parent_class)->dispose(object);
170 }
171
172 static void webKitSettingsConstructed(GObject* object)
173 {
174     G_OBJECT_CLASS(webkit_settings_parent_class)->constructed(object);
175
176     WebKitSettings* settings = WEBKIT_SETTINGS(object);
177     WebPreferences* prefs = settings->priv->preferences.get();
178     prefs->setShouldRespectImageOrientation(true);
179
180     bool mediaStreamEnabled = prefs->mediaStreamEnabled();
181     prefs->setMediaDevicesEnabled(mediaStreamEnabled);
182     prefs->setPeerConnectionEnabled(mediaStreamEnabled);
183
184     settings->priv->screenDpi = WebCore::screenDPI();
185     WebCore::setScreenDPIObserverHandler([settings]() {
186         auto newScreenDpi = WebCore::screenDPI();
187         if (newScreenDpi == settings->priv->screenDpi)
188             return;
189
190         auto scalingFactor = newScreenDpi / settings->priv->screenDpi;
191         auto fontSize = settings->priv->preferences->defaultFontSize();
192         auto monospaceFontSize = settings->priv->preferences->defaultFixedFontSize();
193         settings->priv->screenDpi = newScreenDpi;
194
195         g_object_freeze_notify(G_OBJECT(settings));
196         webkit_settings_set_default_font_size(settings, std::round(fontSize * scalingFactor));
197         webkit_settings_set_default_monospace_font_size(settings, std::round(monospaceFontSize * scalingFactor));
198         g_object_thaw_notify(G_OBJECT(settings));
199     }, object);
200 }
201
202 static void webKitSettingsSetProperty(GObject* object, guint propId, const GValue* value, GParamSpec* paramSpec)
203 {
204     WebKitSettings* settings = WEBKIT_SETTINGS(object);
205
206     switch (propId) {
207     case PROP_ENABLE_JAVASCRIPT:
208         webkit_settings_set_enable_javascript(settings, g_value_get_boolean(value));
209         break;
210     case PROP_AUTO_LOAD_IMAGES:
211         webkit_settings_set_auto_load_images(settings, g_value_get_boolean(value));
212         break;
213     case PROP_LOAD_ICONS_IGNORING_IMAGE_LOAD_SETTING:
214         webkit_settings_set_load_icons_ignoring_image_load_setting(settings, g_value_get_boolean(value));
215         break;
216     case PROP_ENABLE_OFFLINE_WEB_APPLICATION_CACHE:
217         webkit_settings_set_enable_offline_web_application_cache(settings, g_value_get_boolean(value));
218         break;
219     case PROP_ENABLE_HTML5_LOCAL_STORAGE:
220         webkit_settings_set_enable_html5_local_storage(settings, g_value_get_boolean(value));
221         break;
222     case PROP_ENABLE_HTML5_DATABASE:
223         webkit_settings_set_enable_html5_database(settings, g_value_get_boolean(value));
224         break;
225     case PROP_ENABLE_XSS_AUDITOR:
226         webkit_settings_set_enable_xss_auditor(settings, g_value_get_boolean(value));
227         break;
228     case PROP_ENABLE_FRAME_FLATTENING:
229         webkit_settings_set_enable_frame_flattening(settings, g_value_get_boolean(value));
230         break;
231     case PROP_ENABLE_PLUGINS:
232         webkit_settings_set_enable_plugins(settings, g_value_get_boolean(value));
233         break;
234     case PROP_ENABLE_JAVA:
235         webkit_settings_set_enable_java(settings, g_value_get_boolean(value));
236         break;
237     case PROP_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY:
238         webkit_settings_set_javascript_can_open_windows_automatically(settings, g_value_get_boolean(value));
239         break;
240     case PROP_ENABLE_HYPERLINK_AUDITING:
241         webkit_settings_set_enable_hyperlink_auditing(settings, g_value_get_boolean(value));
242         break;
243     case PROP_DEFAULT_FONT_FAMILY:
244         webkit_settings_set_default_font_family(settings, g_value_get_string(value));
245         break;
246     case PROP_MONOSPACE_FONT_FAMILY:
247         webkit_settings_set_monospace_font_family(settings, g_value_get_string(value));
248         break;
249     case PROP_SERIF_FONT_FAMILY:
250         webkit_settings_set_serif_font_family(settings, g_value_get_string(value));
251         break;
252     case PROP_SANS_SERIF_FONT_FAMILY:
253         webkit_settings_set_sans_serif_font_family(settings, g_value_get_string(value));
254         break;
255     case PROP_CURSIVE_FONT_FAMILY:
256         webkit_settings_set_cursive_font_family(settings, g_value_get_string(value));
257         break;
258     case PROP_FANTASY_FONT_FAMILY:
259         webkit_settings_set_fantasy_font_family(settings, g_value_get_string(value));
260         break;
261     case PROP_PICTOGRAPH_FONT_FAMILY:
262         webkit_settings_set_pictograph_font_family(settings, g_value_get_string(value));
263         break;
264     case PROP_DEFAULT_FONT_SIZE:
265         webkit_settings_set_default_font_size(settings, g_value_get_uint(value));
266         break;
267     case PROP_DEFAULT_MONOSPACE_FONT_SIZE:
268         webkit_settings_set_default_monospace_font_size(settings, g_value_get_uint(value));
269         break;
270     case PROP_MINIMUM_FONT_SIZE:
271         webkit_settings_set_minimum_font_size(settings, g_value_get_uint(value));
272         break;
273     case PROP_DEFAULT_CHARSET:
274         webkit_settings_set_default_charset(settings, g_value_get_string(value));
275         break;
276 #if PLATFORM(GTK)
277     case PROP_ENABLE_PRIVATE_BROWSING:
278         G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
279         webkit_settings_set_enable_private_browsing(settings, g_value_get_boolean(value));
280         G_GNUC_END_IGNORE_DEPRECATIONS;
281         break;
282 #endif
283     case PROP_ENABLE_DEVELOPER_EXTRAS:
284         webkit_settings_set_enable_developer_extras(settings, g_value_get_boolean(value));
285         break;
286     case PROP_ENABLE_RESIZABLE_TEXT_AREAS:
287         webkit_settings_set_enable_resizable_text_areas(settings, g_value_get_boolean(value));
288         break;
289     case PROP_ENABLE_TABS_TO_LINKS:
290         webkit_settings_set_enable_tabs_to_links(settings, g_value_get_boolean(value));
291         break;
292     case PROP_ENABLE_DNS_PREFETCHING:
293         webkit_settings_set_enable_dns_prefetching(settings, g_value_get_boolean(value));
294         break;
295     case PROP_ENABLE_CARET_BROWSING:
296         webkit_settings_set_enable_caret_browsing(settings, g_value_get_boolean(value));
297         break;
298     case PROP_ENABLE_FULLSCREEN:
299         webkit_settings_set_enable_fullscreen(settings, g_value_get_boolean(value));
300         break;
301     case PROP_PRINT_BACKGROUNDS:
302         webkit_settings_set_print_backgrounds(settings, g_value_get_boolean(value));
303         break;
304     case PROP_ENABLE_WEBAUDIO:
305         webkit_settings_set_enable_webaudio(settings, g_value_get_boolean(value));
306         break;
307     case PROP_ENABLE_WEBGL:
308         webkit_settings_set_enable_webgl(settings, g_value_get_boolean(value));
309         break;
310     case PROP_ALLOW_MODAL_DIALOGS:
311         webkit_settings_set_allow_modal_dialogs(settings, g_value_get_boolean(value));
312         break;
313     case PROP_ZOOM_TEXT_ONLY:
314         webkit_settings_set_zoom_text_only(settings, g_value_get_boolean(value));
315         break;
316     case PROP_JAVASCRIPT_CAN_ACCESS_CLIPBOARD:
317         webkit_settings_set_javascript_can_access_clipboard(settings, g_value_get_boolean(value));
318         break;
319     case PROP_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE:
320         webkit_settings_set_media_playback_requires_user_gesture(settings, g_value_get_boolean(value));
321         break;
322     case PROP_MEDIA_PLAYBACK_ALLOWS_INLINE:
323         webkit_settings_set_media_playback_allows_inline(settings, g_value_get_boolean(value));
324         break;
325     case PROP_DRAW_COMPOSITING_INDICATORS:
326         if (g_value_get_boolean(value))
327             webkit_settings_set_draw_compositing_indicators(settings, g_value_get_boolean(value));
328         else {
329             char* debugVisualsEnvironment = getenv("WEBKIT_SHOW_COMPOSITING_DEBUG_VISUALS");
330             bool showDebugVisuals = debugVisualsEnvironment && !strcmp(debugVisualsEnvironment, "1");
331             webkit_settings_set_draw_compositing_indicators(settings, showDebugVisuals);
332         }
333         break;
334     case PROP_ENABLE_SITE_SPECIFIC_QUIRKS:
335         webkit_settings_set_enable_site_specific_quirks(settings, g_value_get_boolean(value));
336         break;
337     case PROP_ENABLE_PAGE_CACHE:
338         webkit_settings_set_enable_page_cache(settings, g_value_get_boolean(value));
339         break;
340     case PROP_USER_AGENT:
341         webkit_settings_set_user_agent(settings, g_value_get_string(value));
342         break;
343     case PROP_ENABLE_SMOOTH_SCROLLING:
344         webkit_settings_set_enable_smooth_scrolling(settings, g_value_get_boolean(value));
345         break;
346     case PROP_ENABLE_ACCELERATED_2D_CANVAS:
347         webkit_settings_set_enable_accelerated_2d_canvas(settings, g_value_get_boolean(value));
348         break;
349     case PROP_ENABLE_WRITE_CONSOLE_MESSAGES_TO_STDOUT:
350         webkit_settings_set_enable_write_console_messages_to_stdout(settings, g_value_get_boolean(value));
351         break;
352     case PROP_ENABLE_MEDIA_STREAM:
353         webkit_settings_set_enable_media_stream(settings, g_value_get_boolean(value));
354         break;
355     case PROP_ENABLE_SPATIAL_NAVIGATION:
356         webkit_settings_set_enable_spatial_navigation(settings, g_value_get_boolean(value));
357         break;
358     case PROP_ENABLE_MEDIASOURCE:
359         webkit_settings_set_enable_mediasource(settings, g_value_get_boolean(value));
360         break;
361     case PROP_ENABLE_ENCRYPTED_MEDIA:
362         webkit_settings_set_enable_encrypted_media(settings, g_value_get_boolean(value));
363         break;
364     case PROP_ENABLE_MEDIA_CAPABILITIES:
365         webkit_settings_set_enable_media_capabilities(settings, g_value_get_boolean(value));
366         break;
367     case PROP_ALLOW_FILE_ACCESS_FROM_FILE_URLS:
368         webkit_settings_set_allow_file_access_from_file_urls(settings, g_value_get_boolean(value));
369         break;
370     case PROP_ALLOW_UNIVERSAL_ACCESS_FROM_FILE_URLS:
371         webkit_settings_set_allow_universal_access_from_file_urls(settings, g_value_get_boolean(value));
372         break;
373 #if PLATFORM(GTK)
374     case PROP_HARDWARE_ACCELERATION_POLICY:
375         webkit_settings_set_hardware_acceleration_policy(settings, static_cast<WebKitHardwareAccelerationPolicy>(g_value_get_enum(value)));
376         break;
377 #endif
378     default:
379         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);
380         break;
381     }
382 }
383
384 static void webKitSettingsGetProperty(GObject* object, guint propId, GValue* value, GParamSpec* paramSpec)
385 {
386     WebKitSettings* settings = WEBKIT_SETTINGS(object);
387
388     switch (propId) {
389     case PROP_ENABLE_JAVASCRIPT:
390         g_value_set_boolean(value, webkit_settings_get_enable_javascript(settings));
391         break;
392     case PROP_AUTO_LOAD_IMAGES:
393         g_value_set_boolean(value, webkit_settings_get_auto_load_images(settings));
394         break;
395     case PROP_LOAD_ICONS_IGNORING_IMAGE_LOAD_SETTING:
396         g_value_set_boolean(value, webkit_settings_get_load_icons_ignoring_image_load_setting(settings));
397         break;
398     case PROP_ENABLE_OFFLINE_WEB_APPLICATION_CACHE:
399         g_value_set_boolean(value, webkit_settings_get_enable_offline_web_application_cache(settings));
400         break;
401     case PROP_ENABLE_HTML5_LOCAL_STORAGE:
402         g_value_set_boolean(value, webkit_settings_get_enable_html5_local_storage(settings));
403         break;
404     case PROP_ENABLE_HTML5_DATABASE:
405         g_value_set_boolean(value, webkit_settings_get_enable_html5_database(settings));
406         break;
407     case PROP_ENABLE_XSS_AUDITOR:
408         g_value_set_boolean(value, webkit_settings_get_enable_xss_auditor(settings));
409         break;
410     case PROP_ENABLE_FRAME_FLATTENING:
411         g_value_set_boolean(value, webkit_settings_get_enable_frame_flattening(settings));
412         break;
413     case PROP_ENABLE_PLUGINS:
414         g_value_set_boolean(value, webkit_settings_get_enable_plugins(settings));
415         break;
416     case PROP_ENABLE_JAVA:
417         g_value_set_boolean(value, webkit_settings_get_enable_java(settings));
418         break;
419     case PROP_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY:
420         g_value_set_boolean(value, webkit_settings_get_javascript_can_open_windows_automatically(settings));
421         break;
422     case PROP_ENABLE_HYPERLINK_AUDITING:
423         g_value_set_boolean(value, webkit_settings_get_enable_hyperlink_auditing(settings));
424         break;
425     case PROP_DEFAULT_FONT_FAMILY:
426         g_value_set_string(value, webkit_settings_get_default_font_family(settings));
427         break;
428     case PROP_MONOSPACE_FONT_FAMILY:
429         g_value_set_string(value, webkit_settings_get_monospace_font_family(settings));
430         break;
431     case PROP_SERIF_FONT_FAMILY:
432         g_value_set_string(value, webkit_settings_get_serif_font_family(settings));
433         break;
434     case PROP_SANS_SERIF_FONT_FAMILY:
435         g_value_set_string(value, webkit_settings_get_sans_serif_font_family(settings));
436         break;
437     case PROP_CURSIVE_FONT_FAMILY:
438         g_value_set_string(value, webkit_settings_get_cursive_font_family(settings));
439         break;
440     case PROP_FANTASY_FONT_FAMILY:
441         g_value_set_string(value, webkit_settings_get_fantasy_font_family(settings));
442         break;
443     case PROP_PICTOGRAPH_FONT_FAMILY:
444         g_value_set_string(value, webkit_settings_get_pictograph_font_family(settings));
445         break;
446     case PROP_DEFAULT_FONT_SIZE:
447         g_value_set_uint(value, webkit_settings_get_default_font_size(settings));
448         break;
449     case PROP_DEFAULT_MONOSPACE_FONT_SIZE:
450         g_value_set_uint(value, webkit_settings_get_default_monospace_font_size(settings));
451         break;
452     case PROP_MINIMUM_FONT_SIZE:
453         g_value_set_uint(value, webkit_settings_get_minimum_font_size(settings));
454         break;
455     case PROP_DEFAULT_CHARSET:
456         g_value_set_string(value, webkit_settings_get_default_charset(settings));
457         break;
458 #if PLATFORM(GTK)
459     case PROP_ENABLE_PRIVATE_BROWSING:
460         G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
461         g_value_set_boolean(value, webkit_settings_get_enable_private_browsing(settings));
462         G_GNUC_END_IGNORE_DEPRECATIONS;
463         break;
464 #endif
465     case PROP_ENABLE_DEVELOPER_EXTRAS:
466         g_value_set_boolean(value, webkit_settings_get_enable_developer_extras(settings));
467         break;
468     case PROP_ENABLE_RESIZABLE_TEXT_AREAS:
469         g_value_set_boolean(value, webkit_settings_get_enable_resizable_text_areas(settings));
470         break;
471     case PROP_ENABLE_TABS_TO_LINKS:
472         g_value_set_boolean(value, webkit_settings_get_enable_tabs_to_links(settings));
473         break;
474     case PROP_ENABLE_DNS_PREFETCHING:
475         g_value_set_boolean(value, webkit_settings_get_enable_dns_prefetching(settings));
476         break;
477     case PROP_ENABLE_CARET_BROWSING:
478         g_value_set_boolean(value, webkit_settings_get_enable_caret_browsing(settings));
479         break;
480     case PROP_ENABLE_FULLSCREEN:
481         g_value_set_boolean(value, webkit_settings_get_enable_fullscreen(settings));
482         break;
483     case PROP_PRINT_BACKGROUNDS:
484         g_value_set_boolean(value, webkit_settings_get_print_backgrounds(settings));
485         break;
486     case PROP_ENABLE_WEBAUDIO:
487         g_value_set_boolean(value, webkit_settings_get_enable_webaudio(settings));
488         break;
489     case PROP_ENABLE_WEBGL:
490         g_value_set_boolean(value, webkit_settings_get_enable_webgl(settings));
491         break;
492     case PROP_ALLOW_MODAL_DIALOGS:
493         g_value_set_boolean(value, webkit_settings_get_allow_modal_dialogs(settings));
494         break;
495     case PROP_ZOOM_TEXT_ONLY:
496         g_value_set_boolean(value, webkit_settings_get_zoom_text_only(settings));
497         break;
498     case PROP_JAVASCRIPT_CAN_ACCESS_CLIPBOARD:
499         g_value_set_boolean(value, webkit_settings_get_javascript_can_access_clipboard(settings));
500         break;
501     case PROP_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE:
502         g_value_set_boolean(value, webkit_settings_get_media_playback_requires_user_gesture(settings));
503         break;
504     case PROP_MEDIA_PLAYBACK_ALLOWS_INLINE:
505         g_value_set_boolean(value, webkit_settings_get_media_playback_allows_inline(settings));
506         break;
507     case PROP_DRAW_COMPOSITING_INDICATORS:
508         g_value_set_boolean(value, webkit_settings_get_draw_compositing_indicators(settings));
509         break;
510     case PROP_ENABLE_SITE_SPECIFIC_QUIRKS:
511         g_value_set_boolean(value, webkit_settings_get_enable_site_specific_quirks(settings));
512         break;
513     case PROP_ENABLE_PAGE_CACHE:
514         g_value_set_boolean(value, webkit_settings_get_enable_page_cache(settings));
515         break;
516     case PROP_USER_AGENT:
517         g_value_set_string(value, webkit_settings_get_user_agent(settings));
518         break;
519     case PROP_ENABLE_SMOOTH_SCROLLING:
520         g_value_set_boolean(value, webkit_settings_get_enable_smooth_scrolling(settings));
521         break;
522     case PROP_ENABLE_ACCELERATED_2D_CANVAS:
523         g_value_set_boolean(value, webkit_settings_get_enable_accelerated_2d_canvas(settings));
524         break;
525     case PROP_ENABLE_WRITE_CONSOLE_MESSAGES_TO_STDOUT:
526         g_value_set_boolean(value, webkit_settings_get_enable_write_console_messages_to_stdout(settings));
527         break;
528     case PROP_ENABLE_MEDIA_STREAM:
529         g_value_set_boolean(value, webkit_settings_get_enable_media_stream(settings));
530         break;
531     case PROP_ENABLE_SPATIAL_NAVIGATION:
532         g_value_set_boolean(value, webkit_settings_get_enable_spatial_navigation(settings));
533         break;
534     case PROP_ENABLE_MEDIASOURCE:
535         g_value_set_boolean(value, webkit_settings_get_enable_mediasource(settings));
536         break;
537     case PROP_ENABLE_ENCRYPTED_MEDIA:
538         g_value_set_boolean(value, webkit_settings_get_enable_encrypted_media(settings));
539         break;
540     case PROP_ENABLE_MEDIA_CAPABILITIES:
541         g_value_set_boolean(value, webkit_settings_get_enable_media_capabilities(settings));
542         break;
543     case PROP_ALLOW_FILE_ACCESS_FROM_FILE_URLS:
544         g_value_set_boolean(value, webkit_settings_get_allow_file_access_from_file_urls(settings));
545         break;
546     case PROP_ALLOW_UNIVERSAL_ACCESS_FROM_FILE_URLS:
547         g_value_set_boolean(value, webkit_settings_get_allow_universal_access_from_file_urls(settings));
548         break;
549 #if PLATFORM(GTK)
550     case PROP_HARDWARE_ACCELERATION_POLICY:
551         g_value_set_enum(value, webkit_settings_get_hardware_acceleration_policy(settings));
552         break;
553 #endif
554     default:
555         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);
556         break;
557     }
558 }
559
560 static void webkit_settings_class_init(WebKitSettingsClass* klass)
561 {
562     GObjectClass* gObjectClass = G_OBJECT_CLASS(klass);
563     gObjectClass->constructed = webKitSettingsConstructed;
564     gObjectClass->dispose = webKitSettingsDispose;
565     gObjectClass->set_property = webKitSettingsSetProperty;
566     gObjectClass->get_property = webKitSettingsGetProperty;
567
568     GParamFlags readWriteConstructParamFlags = static_cast<GParamFlags>(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT);
569
570     /**
571      * WebKitSettings:enable-javascript:
572      *
573      * Determines whether or not JavaScript executes within a page.
574      */
575     g_object_class_install_property(gObjectClass,
576                                     PROP_ENABLE_JAVASCRIPT,
577                                     g_param_spec_boolean("enable-javascript",
578                                                          _("Enable JavaScript"),
579                                                          _("Enable JavaScript."),
580                                                          TRUE,
581                                                          readWriteConstructParamFlags));
582
583     /**
584      * WebKitSettings:auto-load-images:
585      *
586      * Determines whether images should be automatically loaded or not.
587      * On devices where network bandwidth is of concern, it might be
588      * useful to turn this property off.
589      */
590     g_object_class_install_property(gObjectClass,
591                                     PROP_AUTO_LOAD_IMAGES,
592                                     g_param_spec_boolean("auto-load-images",
593                                                          _("Auto load images"),
594                                                          _("Load images automatically."),
595                                                          TRUE,
596                                                          readWriteConstructParamFlags));
597
598     /**
599      * WebKitSettings:load-icons-ignoring-image-load-setting:
600      *
601      * Determines whether a site can load favicons irrespective
602      * of the value of #WebKitSettings:auto-load-images.
603      */
604     g_object_class_install_property(gObjectClass,
605                                     PROP_LOAD_ICONS_IGNORING_IMAGE_LOAD_SETTING,
606                                     g_param_spec_boolean("load-icons-ignoring-image-load-setting",
607                                                          _("Load icons ignoring image load setting"),
608                                                          _("Whether to load site icons ignoring image load setting."),
609                                                          FALSE,
610                                                          readWriteConstructParamFlags));
611
612     /**
613      * WebKitSettings:enable-offline-web-application-cache:
614      *
615      * Whether to enable HTML5 offline web application cache support. Offline
616      * web application cache allows web applications to run even when
617      * the user is not connected to the network.
618      *
619      * HTML5 offline web application specification is available at
620      * http://dev.w3.org/html5/spec/offline.html.
621      */
622     g_object_class_install_property(gObjectClass,
623                                     PROP_ENABLE_OFFLINE_WEB_APPLICATION_CACHE,
624                                     g_param_spec_boolean("enable-offline-web-application-cache",
625                                                          _("Enable offline web application cache"),
626                                                          _("Whether to enable offline web application cache."),
627                                                          TRUE,
628                                                          readWriteConstructParamFlags));
629
630     /**
631      * WebKitSettings:enable-html5-local-storage:
632      *
633      * Whether to enable HTML5 local storage support. Local storage provides
634      * simple synchronous storage access.
635      *
636      * HTML5 local storage specification is available at
637      * http://dev.w3.org/html5/webstorage/.
638      */
639     g_object_class_install_property(gObjectClass,
640                                     PROP_ENABLE_HTML5_LOCAL_STORAGE,
641                                     g_param_spec_boolean("enable-html5-local-storage",
642                                                          _("Enable HTML5 local storage"),
643                                                          _("Whether to enable HTML5 Local Storage support."),
644                                                          TRUE,
645                                                          readWriteConstructParamFlags));
646
647     /**
648      * WebKitSettings:enable-html5-database:
649      *
650      * Whether to enable HTML5 client-side SQL database support. Client-side
651      * SQL database allows web pages to store structured data and be able to
652      * use SQL to manipulate that data asynchronously.
653      *
654      * HTML5 database specification is available at
655      * http://www.w3.org/TR/webdatabase/.
656      */
657     g_object_class_install_property(gObjectClass,
658                                     PROP_ENABLE_HTML5_DATABASE,
659                                     g_param_spec_boolean("enable-html5-database",
660                                                          _("Enable HTML5 database"),
661                                                          _("Whether to enable HTML5 database support."),
662                                                          TRUE,
663                                                          readWriteConstructParamFlags));
664
665     /**
666      * WebKitSettings:enable-xss-auditor:
667      *
668      * Whether to enable the XSS auditor. This feature filters some kinds of
669      * reflective XSS attacks on vulnerable web sites.
670      */
671     g_object_class_install_property(gObjectClass,
672                                     PROP_ENABLE_XSS_AUDITOR,
673                                     g_param_spec_boolean("enable-xss-auditor",
674                                                          _("Enable XSS auditor"),
675                                                          _("Whether to enable the XSS auditor."),
676                                                          TRUE,
677                                                          readWriteConstructParamFlags));
678
679
680     /**
681      * WebKitSettings:enable-frame-flattening:
682      *
683      * Whether to enable the frame flattening. With this setting each subframe is expanded
684      * to its contents, which will flatten all the frames to become one scrollable page.
685      * On touch devices scrollable subframes on a page can result in a confusing user experience.
686      */
687     g_object_class_install_property(gObjectClass,
688                                     PROP_ENABLE_FRAME_FLATTENING,
689                                     g_param_spec_boolean("enable-frame-flattening",
690                                                          _("Enable frame flattening"),
691                                                          _("Whether to enable frame flattening."),
692                                                          FALSE,
693                                                          readWriteConstructParamFlags));
694
695     /**
696      * WebKitSettings:enable-plugins:
697      *
698      * Determines whether or not plugins on the page are enabled.
699      */
700     g_object_class_install_property(gObjectClass,
701                                     PROP_ENABLE_PLUGINS,
702                                     g_param_spec_boolean("enable-plugins",
703                                                          _("Enable plugins"),
704                                                          _("Enable embedded plugin objects."),
705                                                          TRUE,
706                                                          readWriteConstructParamFlags));
707
708     /**
709      * WebKitSettings:enable-java:
710      *
711      * Determines whether or not Java is enabled on the page.
712      */
713     g_object_class_install_property(gObjectClass,
714                                     PROP_ENABLE_JAVA,
715                                     g_param_spec_boolean("enable-java",
716                                                          _("Enable Java"),
717                                                          _("Whether Java support should be enabled."),
718                                                          TRUE,
719                                                          readWriteConstructParamFlags));
720
721     /**
722      * WebKitSettings:javascript-can-open-windows-automatically:
723      *
724      * Whether JavaScript can open popup windows automatically without user
725      * intervention.
726      */
727     g_object_class_install_property(gObjectClass,
728                                     PROP_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY,
729                                     g_param_spec_boolean("javascript-can-open-windows-automatically",
730                                                          _("JavaScript can open windows automatically"),
731                                                          _("Whether JavaScript can open windows automatically."),
732                                                          FALSE,
733                                                          readWriteConstructParamFlags));
734
735     /**
736      * WebKitSettings:enable-hyperlink-auditing:
737      *
738      * Determines whether or not hyperlink auditing is enabled.
739      *
740      * The hyperlink auditing specification is available at
741      * http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#hyperlink-auditing.
742      */
743     g_object_class_install_property(gObjectClass,
744                                     PROP_ENABLE_HYPERLINK_AUDITING,
745                                     g_param_spec_boolean("enable-hyperlink-auditing",
746                                                          _("Enable hyperlink auditing"),
747                                                          _("Whether <a ping> should be able to send pings."),
748                                                          FALSE,
749                                                          readWriteConstructParamFlags));
750
751     /**
752      * WebKitSettings:default-font-family:
753      *
754      * The font family to use as the default for content that does not specify a font.
755      */
756     g_object_class_install_property(gObjectClass,
757                                     PROP_DEFAULT_FONT_FAMILY,
758                                     g_param_spec_string("default-font-family",
759                                                         _("Default font family"),
760                                                         _("The font family to use as the default for content that does not specify a font."),
761                                                         "sans-serif",
762                                                         readWriteConstructParamFlags));
763
764     /**
765      * WebKitSettings:monospace-font-family:
766      *
767      * The font family used as the default for content using a monospace font.
768      *
769      */
770     g_object_class_install_property(gObjectClass,
771                                     PROP_MONOSPACE_FONT_FAMILY,
772                                     g_param_spec_string("monospace-font-family",
773                                                         _("Monospace font family"),
774                                                         _("The font family used as the default for content using monospace font."),
775                                                         "monospace",
776                                                         readWriteConstructParamFlags));
777
778     /**
779      * WebKitSettings:serif-font-family:
780      *
781      * The font family used as the default for content using a serif font.
782      */
783     g_object_class_install_property(gObjectClass,
784                                     PROP_SERIF_FONT_FAMILY,
785                                     g_param_spec_string("serif-font-family",
786                                                         _("Serif font family"),
787                                                         _("The font family used as the default for content using serif font."),
788                                                         "serif",
789                                                         readWriteConstructParamFlags));
790
791     /**
792      * WebKitSettings:sans-serif-font-family:
793      *
794      * The font family used as the default for content using a sans-serif font.
795      */
796     g_object_class_install_property(gObjectClass,
797                                     PROP_SANS_SERIF_FONT_FAMILY,
798                                     g_param_spec_string("sans-serif-font-family",
799                                                         _("Sans-serif font family"),
800                                                         _("The font family used as the default for content using sans-serif font."),
801                                                         "sans-serif",
802                                                         readWriteConstructParamFlags));
803
804     /**
805      * WebKitSettings:cursive-font-family:
806      *
807      * The font family used as the default for content using a cursive font.
808      */
809     g_object_class_install_property(gObjectClass,
810                                     PROP_CURSIVE_FONT_FAMILY,
811                                     g_param_spec_string("cursive-font-family",
812                                                         _("Cursive font family"),
813                                                         _("The font family used as the default for content using cursive font."),
814                                                         "serif",
815                                                         readWriteConstructParamFlags));
816
817     /**
818      * WebKitSettings:fantasy-font-family:
819      *
820      * The font family used as the default for content using a fantasy font.
821      */
822     g_object_class_install_property(gObjectClass,
823                                     PROP_FANTASY_FONT_FAMILY,
824                                     g_param_spec_string("fantasy-font-family",
825                                                         _("Fantasy font family"),
826                                                         _("The font family used as the default for content using fantasy font."),
827                                                         "serif",
828                                                         readWriteConstructParamFlags));
829
830     /**
831      * WebKitSettings:pictograph-font-family:
832      *
833      * The font family used as the default for content using a pictograph font.
834      */
835     g_object_class_install_property(gObjectClass,
836                                     PROP_PICTOGRAPH_FONT_FAMILY,
837                                     g_param_spec_string("pictograph-font-family",
838                                                         _("Pictograph font family"),
839                                                         _("The font family used as the default for content using pictograph font."),
840                                                         "serif",
841                                                         readWriteConstructParamFlags));
842
843     /**
844      * WebKitSettings:default-font-size:
845      *
846      * The default font size in pixels to use for content displayed if
847      * no font size is specified.
848      */
849     g_object_class_install_property(gObjectClass,
850                                     PROP_DEFAULT_FONT_SIZE,
851                                     g_param_spec_uint("default-font-size",
852                                                       _("Default font size"),
853                                                       _("The default font size used to display text."),
854                                                       0, G_MAXUINT, 16,
855                                                       readWriteConstructParamFlags));
856
857     /**
858      * WebKitSettings:default-monospace-font-size:
859      *
860      * The default font size in pixels to use for content displayed in
861      * monospace font if no font size is specified.
862      */
863     g_object_class_install_property(gObjectClass,
864                                     PROP_DEFAULT_MONOSPACE_FONT_SIZE,
865                                     g_param_spec_uint("default-monospace-font-size",
866                                                       _("Default monospace font size"),
867                                                       _("The default font size used to display monospace text."),
868                                                       0, G_MAXUINT, 13,
869                                                       readWriteConstructParamFlags));
870
871     /**
872      * WebKitSettings:minimum-font-size:
873      *
874      * The minimum font size in pixels used to display text. This setting
875      * controls the absolute smallest size. Values other than 0 can
876      * potentially break page layouts.
877      */
878     g_object_class_install_property(gObjectClass,
879                                     PROP_MINIMUM_FONT_SIZE,
880                                     g_param_spec_uint("minimum-font-size",
881                                                       _("Minimum font size"),
882                                                       _("The minimum font size used to display text."),
883                                                       0, G_MAXUINT, 0,
884                                                       readWriteConstructParamFlags));
885
886     /**
887      * WebKitSettings:default-charset:
888      *
889      * The default text charset used when interpreting content with an unspecified charset.
890      */
891     g_object_class_install_property(gObjectClass,
892                                     PROP_DEFAULT_CHARSET,
893                                     g_param_spec_string("default-charset",
894                                                         _("Default charset"),
895                                                         _("The default text charset used when interpreting content with unspecified charset."),
896                                                         "iso-8859-1",
897                                                         readWriteConstructParamFlags));
898
899 #if PLATFORM(GTK)
900     /**
901      * WebKitSettings:enable-private-browsing:
902      *
903      * Determines whether or not private browsing is enabled. Private browsing
904      * will disable history, cache and form auto-fill for any pages visited.
905      *
906      * Deprecated: 2.16. Use #WebKitWebView:is-ephemeral or #WebKitWebsiteDataManager:is-ephemeral instead.
907      */
908     g_object_class_install_property(gObjectClass,
909                                     PROP_ENABLE_PRIVATE_BROWSING,
910                                     g_param_spec_boolean("enable-private-browsing",
911                                                          _("Enable private browsing"),
912                                                          _("Whether to enable private browsing"),
913                                                          FALSE,
914                                                          readWriteConstructParamFlags));
915 #endif
916
917     /**
918      * WebKitSettings:enable-developer-extras:
919      *
920      * Determines whether or not developer tools, such as the Web Inspector, are enabled.
921      */
922     g_object_class_install_property(gObjectClass,
923                                     PROP_ENABLE_DEVELOPER_EXTRAS,
924                                     g_param_spec_boolean("enable-developer-extras",
925                                                          _("Enable developer extras"),
926                                                          _("Whether to enable developer extras"),
927                                                          FALSE,
928                                                          readWriteConstructParamFlags));
929
930     /**
931      * WebKitSettings:enable-resizable-text-areas:
932      *
933      * Determines whether or not text areas can be resized.
934      */
935     g_object_class_install_property(gObjectClass,
936                                     PROP_ENABLE_RESIZABLE_TEXT_AREAS,
937                                     g_param_spec_boolean("enable-resizable-text-areas",
938                                                          _("Enable resizable text areas"),
939                                                          _("Whether to enable resizable text areas"),
940                                                          TRUE,
941                                                          readWriteConstructParamFlags));
942
943     /**
944      * WebKitSettings:enable-tabs-to-links:
945      *
946      * Determines whether the tab key cycles through the elements on the page.
947      * When this setting is enabled, users will be able to focus the next element
948      * in the page by pressing the tab key. If the selected element is editable,
949      * then pressing tab key will insert the tab character.
950      */
951     g_object_class_install_property(gObjectClass,
952                                     PROP_ENABLE_TABS_TO_LINKS,
953                                     g_param_spec_boolean("enable-tabs-to-links",
954                                                          _("Enable tabs to links"),
955                                                          _("Whether to enable tabs to links"),
956                                                          TRUE,
957                                                          readWriteConstructParamFlags));
958
959     /**
960      * WebKitSettings:enable-dns-prefetching:
961      *
962      * Determines whether or not to prefetch domain names. DNS prefetching attempts
963      * to resolve domain names before a user tries to follow a link.
964      */
965     g_object_class_install_property(gObjectClass,
966                                     PROP_ENABLE_DNS_PREFETCHING,
967                                     g_param_spec_boolean("enable-dns-prefetching",
968                                                          _("Enable DNS prefetching"),
969                                                          _("Whether to enable DNS prefetching"),
970                                                          FALSE,
971                                                          readWriteConstructParamFlags));
972
973     /**
974      * WebKitSettings:enable-caret-browsing:
975      *
976      * Whether to enable accessibility enhanced keyboard navigation.
977      */
978     g_object_class_install_property(gObjectClass,
979                                     PROP_ENABLE_CARET_BROWSING,
980                                     g_param_spec_boolean("enable-caret-browsing",
981                                                          _("Enable Caret Browsing"),
982                                                          _("Whether to enable accessibility enhanced keyboard navigation"),
983                                                          FALSE,
984                                                          readWriteConstructParamFlags));
985
986     /**
987      * WebKitSettings:enable-fullscreen:
988      *
989      * Whether to enable the Javascript Fullscreen API. The API
990      * allows any HTML element to request fullscreen display. See also
991      * the current draft of the spec:
992      * http://www.w3.org/TR/fullscreen/
993      */
994     g_object_class_install_property(gObjectClass,
995         PROP_ENABLE_FULLSCREEN,
996         g_param_spec_boolean("enable-fullscreen",
997             _("Enable Fullscreen"),
998             _("Whether to enable the Javascript Fullscreen API"),
999             TRUE,
1000             readWriteConstructParamFlags));
1001
1002     /**
1003      * WebKitSettings:print-backgrounds:
1004      *
1005      * Whether background images should be drawn during printing.
1006      */
1007     g_object_class_install_property(gObjectClass,
1008                                     PROP_PRINT_BACKGROUNDS,
1009                                     g_param_spec_boolean("print-backgrounds",
1010                                                          _("Print Backgrounds"),
1011                                                          _("Whether background images should be drawn during printing"),
1012                                                          TRUE,
1013                                                          readWriteConstructParamFlags));
1014
1015     /**
1016      * WebKitSettings:enable-webaudio:
1017      *
1018      *
1019      * Enable or disable support for WebAudio on pages. WebAudio is an
1020      * experimental proposal for allowing web pages to generate Audio
1021      * WAVE data from JavaScript. The standard is currently a
1022      * work-in-progress by the W3C Audio Working Group.
1023      *
1024      * See also https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html
1025      */
1026     g_object_class_install_property(gObjectClass,
1027                                     PROP_ENABLE_WEBAUDIO,
1028                                     g_param_spec_boolean("enable-webaudio",
1029                                                          _("Enable WebAudio"),
1030                                                          _("Whether WebAudio content should be handled"),
1031                                                          FALSE,
1032                                                          readWriteConstructParamFlags));
1033
1034     /**
1035     * WebKitSettings:enable-webgl:
1036     *
1037     * Enable or disable support for WebGL on pages. WebGL is an experimental
1038     * proposal for allowing web pages to use OpenGL ES-like calls directly. The
1039     * standard is currently a work-in-progress by the Khronos Group.
1040     */
1041     g_object_class_install_property(gObjectClass,
1042                                     PROP_ENABLE_WEBGL,
1043                                     g_param_spec_boolean("enable-webgl",
1044                                                          _("Enable WebGL"),
1045                                                          _("Whether WebGL content should be rendered"),
1046                                                          FALSE,
1047                                                          readWriteConstructParamFlags));
1048
1049     /**
1050      * WebKitSettings:allow-modal-dialogs:
1051      *
1052      * Determine whether it's allowed to create and run modal dialogs
1053      * from a #WebKitWebView through JavaScript with
1054      * <function>window.showModalDialog</function>. If it's set to
1055      * %FALSE, the associated #WebKitWebView won't be able to create
1056      * new modal dialogs, so not even the #WebKitWebView::create
1057      * signal will be emitted.
1058      */
1059     g_object_class_install_property(gObjectClass,
1060                                     PROP_ALLOW_MODAL_DIALOGS,
1061                                     g_param_spec_boolean("allow-modal-dialogs",
1062                                                          _("Allow modal dialogs"),
1063                                                          _("Whether it is possible to create modal dialogs"),
1064                                                          FALSE,
1065                                                          readWriteConstructParamFlags));
1066
1067     /**
1068      * WebKitSettings:zoom-text-only:
1069      *
1070      * Whether #WebKitWebView:zoom-level affects only the
1071      * text of the page or all the contents. Other contents containing text
1072      * like form controls will be also affected by zoom factor when
1073      * this property is enabled.
1074      */
1075     g_object_class_install_property(gObjectClass,
1076                                     PROP_ZOOM_TEXT_ONLY,
1077                                     g_param_spec_boolean("zoom-text-only",
1078                                                          _("Zoom Text Only"),
1079                                                          _("Whether zoom level of web view changes only the text size"),
1080                                                          FALSE,
1081                                                          readWriteConstructParamFlags));
1082
1083     /**
1084      * WebKitSettings:javascript-can-access-clipboard:
1085      *
1086      * Whether JavaScript can access the clipboard. The default value is %FALSE. If
1087      * set to %TRUE, document.execCommand() allows cut, copy and paste commands.
1088      *
1089      */
1090     g_object_class_install_property(gObjectClass,
1091                                     PROP_JAVASCRIPT_CAN_ACCESS_CLIPBOARD,
1092                                     g_param_spec_boolean("javascript-can-access-clipboard",
1093                                                          _("JavaScript can access clipboard"),
1094                                                          _("Whether JavaScript can access Clipboard"),
1095                                                          FALSE,
1096                                                          readWriteConstructParamFlags));
1097
1098     /**
1099      * WebKitSettings:media-playback-requires-user-gesture:
1100      *
1101      * Whether a user gesture (such as clicking the play button)
1102      * would be required to start media playback or load media. This is off
1103      * by default, so media playback could start automatically.
1104      * Setting it on requires a gesture by the user to start playback, or to
1105      * load the media.
1106      */
1107     g_object_class_install_property(gObjectClass,
1108                                     PROP_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE,
1109                                     g_param_spec_boolean("media-playback-requires-user-gesture",
1110                                                          _("Media playback requires user gesture"),
1111                                                          _("Whether media playback requires user gesture"),
1112                                                          FALSE,
1113                                                          readWriteConstructParamFlags));
1114
1115     /**
1116      * WebKitSettings:media-playback-allows-inline:
1117      *
1118      * Whether media playback is full-screen only or inline playback is allowed.
1119      * This is %TRUE by default, so media playback can be inline. Setting it to
1120      * %FALSE allows specifying that media playback should be always fullscreen.
1121      */
1122     g_object_class_install_property(gObjectClass,
1123                                     PROP_MEDIA_PLAYBACK_ALLOWS_INLINE,
1124                                     g_param_spec_boolean("media-playback-allows-inline",
1125                                                          _("Media playback allows inline"),
1126                                                          _("Whether media playback allows inline"),
1127                                                          TRUE,
1128                                                          readWriteConstructParamFlags));
1129
1130     /**
1131      * WebKitSettings:draw-compositing-indicators:
1132      *
1133      * Whether to draw compositing borders and repaint counters on layers drawn
1134      * with accelerated compositing. This is useful for debugging issues related
1135      * to web content that is composited with the GPU.
1136      */
1137     g_object_class_install_property(gObjectClass,
1138                                     PROP_DRAW_COMPOSITING_INDICATORS,
1139                                     g_param_spec_boolean("draw-compositing-indicators",
1140                                                          _("Draw compositing indicators"),
1141                                                          _("Whether to draw compositing borders and repaint counters"),
1142                                                          FALSE,
1143                                                          readWriteConstructParamFlags));
1144
1145     /**
1146      * WebKitSettings:enable-site-specific-quirks:
1147      *
1148      * Whether to turn on site-specific quirks. Turning this on will
1149      * tell WebKit to use some site-specific workarounds for
1150      * better web compatibility. For example, older versions of
1151      * MediaWiki will incorrectly send to WebKit a CSS file with KHTML
1152      * workarounds. By turning on site-specific quirks, WebKit will
1153      * special-case this and other cases to make some specific sites work.
1154      */
1155     g_object_class_install_property(
1156         gObjectClass,
1157         PROP_ENABLE_SITE_SPECIFIC_QUIRKS,
1158         g_param_spec_boolean(
1159             "enable-site-specific-quirks",
1160             _("Enable Site Specific Quirks"),
1161             _("Enables the site-specific compatibility workarounds"),
1162             TRUE,
1163             readWriteConstructParamFlags));
1164
1165     /**
1166      * WebKitSettings:enable-page-cache:
1167      *
1168      * Enable or disable the page cache. Disabling the page cache is
1169      * generally only useful for special circumstances like low-memory
1170      * scenarios or special purpose applications like static HTML
1171      * viewers. This setting only controls the Page Cache, this cache
1172      * is different than the disk-based or memory-based traditional
1173      * resource caches, its point is to make going back and forth
1174      * between pages much faster. For details about the different types
1175      * of caches and their purposes see:
1176      * http://webkit.org/blog/427/webkit-page-cache-i-the-basics/
1177      */
1178     g_object_class_install_property(gObjectClass,
1179                                     PROP_ENABLE_PAGE_CACHE,
1180                                     g_param_spec_boolean("enable-page-cache",
1181                                                          _("Enable page cache"),
1182                                                          _("Whether the page cache should be used"),
1183                                                          TRUE,
1184                                                          readWriteConstructParamFlags));
1185
1186     /**
1187      * WebKitSettings:user-agent:
1188      *
1189      * The user-agent string used by WebKit. Unusual user-agent strings may cause web
1190      * content to render incorrectly or fail to run, as many web pages are written to
1191      * parse the user-agent strings of only the most popular browsers. Therefore, it's
1192      * typically better to not completely override the standard user-agent, but to use
1193      * webkit_settings_set_user_agent_with_application_details() instead.
1194      *
1195      * If this property is set to the empty string or %NULL, it will revert to the standard
1196      * user-agent.
1197      */
1198     g_object_class_install_property(gObjectClass,
1199                                     PROP_USER_AGENT,
1200                                     g_param_spec_string("user-agent",
1201                                                         _("User agent string"),
1202                                                         _("The user agent string"),
1203                                                         0, // A null string forces the standard user agent.
1204                                                         readWriteConstructParamFlags));
1205
1206     /**
1207      * WebKitSettings:enable-smooth-scrolling:
1208      *
1209      * Enable or disable smooth scrolling.
1210      */
1211     g_object_class_install_property(gObjectClass,
1212                                     PROP_ENABLE_SMOOTH_SCROLLING,
1213                                     g_param_spec_boolean("enable-smooth-scrolling",
1214                                                          _("Enable smooth scrolling"),
1215                                                          _("Whether to enable smooth scrolling"),
1216                                                          FALSE,
1217                                                          readWriteConstructParamFlags));
1218
1219     /**
1220      * WebKitSettings:enable-accelerated-2d-canvas:
1221      *
1222      * Enable or disable accelerated 2D canvas. Accelerated 2D canvas is only available
1223      * if WebKitGTK+ was compiled with a version of Cairo including the unstable CairoGL API.
1224      * When accelerated 2D canvas is enabled, WebKit may render some 2D canvas content
1225      * using hardware accelerated drawing operations.
1226      *
1227      * Since: 2.2
1228      */
1229     g_object_class_install_property(gObjectClass,
1230         PROP_ENABLE_ACCELERATED_2D_CANVAS,
1231         g_param_spec_boolean("enable-accelerated-2d-canvas",
1232             _("Enable accelerated 2D canvas"),
1233             _("Whether to enable accelerated 2D canvas"),
1234             FALSE,
1235             readWriteConstructParamFlags));
1236
1237     /**
1238      * WebKitSettings:enable-write-console-messages-to-stdout:
1239      *
1240      * Enable or disable writing console messages to stdout. These are messages
1241      * sent to the console with console.log and related methods.
1242      *
1243      * Since: 2.2
1244      */
1245     g_object_class_install_property(gObjectClass,
1246         PROP_ENABLE_WRITE_CONSOLE_MESSAGES_TO_STDOUT,
1247         g_param_spec_boolean("enable-write-console-messages-to-stdout",
1248             _("Write console messages on stdout"),
1249             _("Whether to write console messages on stdout"),
1250             FALSE,
1251             readWriteConstructParamFlags));
1252
1253     /**
1254      * WebKitSettings:enable-media-stream:
1255      *
1256      * Enable or disable support for MediaStream on pages. MediaStream
1257      * is an experimental proposal for allowing web pages to access
1258      * audio and video devices for capture.
1259      *
1260      * See also http://dev.w3.org/2011/webrtc/editor/getusermedia.html
1261      *
1262      * Since: 2.4
1263      */
1264     g_object_class_install_property(gObjectClass,
1265         PROP_ENABLE_MEDIA_STREAM,
1266         g_param_spec_boolean("enable-media-stream",
1267             _("Enable MediaStream"),
1268             _("Whether MediaStream content should be handled"),
1269             FALSE,
1270             readWriteConstructParamFlags));
1271
1272    /**
1273      * WebKitSettings:enable-spatial-navigation:
1274      *
1275      * Whether to enable Spatial Navigation. This feature consists in the ability
1276      * to navigate between focusable elements in a Web page, such as hyperlinks
1277      * and form controls, by using Left, Right, Up and Down arrow keys.
1278      * For example, if an user presses the Right key, heuristics determine whether
1279      * there is an element they might be trying to reach towards the right, and if
1280      * there are multiple elements, which element they probably wants.
1281      *
1282      * Since: 2.4
1283      */
1284     g_object_class_install_property(gObjectClass,
1285         PROP_ENABLE_SPATIAL_NAVIGATION,
1286         g_param_spec_boolean("enable-spatial-navigation",
1287             _("Enable Spatial Navigation"),
1288             _("Whether to enable Spatial Navigation support."),
1289             FALSE,
1290             readWriteConstructParamFlags));
1291
1292     /**
1293      * WebKitSettings:enable-mediasource:
1294      *
1295      * Enable or disable support for MediaSource on pages. MediaSource
1296      * extends HTMLMediaElement to allow JavaScript to generate media
1297      * streams for playback.
1298      *
1299      * See also http://www.w3.org/TR/media-source/
1300      *
1301      * Since: 2.4
1302      */
1303     g_object_class_install_property(gObjectClass,
1304         PROP_ENABLE_MEDIASOURCE,
1305         g_param_spec_boolean("enable-mediasource",
1306             _("Enable MediaSource"),
1307             _("Whether MediaSource should be enabled."),
1308             TRUE,
1309             readWriteConstructParamFlags));
1310
1311
1312    /**
1313      * WebKitSettings:enable-encrypted-media:
1314      *
1315      * Enable or disable support for Encrypted Media API on pages.
1316      * EncryptedMedia is an experimental JavaScript API for playing encrypted media in HTML.
1317      * This property will only work as intended if the EncryptedMedia feature is enabled at build time
1318      * with the ENABLE_ENCRYPTED_MEDIA flag.
1319      *
1320      * See https://www.w3.org/TR/encrypted-media/
1321      *
1322      * Since: 2.20
1323      */
1324     g_object_class_install_property(gObjectClass,
1325         PROP_ENABLE_ENCRYPTED_MEDIA,
1326         g_param_spec_boolean("enable-encrypted-media",
1327             _("Enable EncryptedMedia"),
1328             _("Whether EncryptedMedia should be enabled."),
1329             FALSE,
1330             readWriteConstructParamFlags));
1331
1332     /**
1333      * WebKitSettings:enable-media-capabilities:
1334      *
1335      * Enable or disable support for MediaCapabilities on pages. This
1336      * specification intends to provide APIs to allow websites to make an optimal
1337      * decision when picking media content for the user. The APIs will expose
1338      * information about the decoding and encoding capabilities for a given format
1339      * but also output capabilities to find the best match based on the device‚Äôs
1340      * display.
1341      *
1342      * See also https://wicg.github.io/media-capabilities/
1343      *
1344      * Since: 2.22
1345      */
1346     g_object_class_install_property(gObjectClass,
1347         PROP_ENABLE_MEDIA_CAPABILITIES,
1348         g_param_spec_boolean("enable-media-capabilities",
1349             _("Enable MediaCapabilities"),
1350             _("Whether MediaCapabilities should be enabled."),
1351             FALSE,
1352             readWriteConstructParamFlags));
1353
1354     /**
1355      * WebKitSettings:allow-file-access-from-file-urls:
1356      *
1357      * Whether file access is allowed from file URLs. By default, when
1358      * something is loaded in a #WebKitWebView using a file URI, cross
1359      * origin requests to other file resources are not allowed. This
1360      * setting allows you to change that behaviour, so that it would be
1361      * possible to do a XMLHttpRequest of a local file, for example.
1362      *
1363      * Since: 2.10
1364      */
1365     g_object_class_install_property(gObjectClass,
1366         PROP_ALLOW_FILE_ACCESS_FROM_FILE_URLS,
1367         g_param_spec_boolean("allow-file-access-from-file-urls",
1368             _("Allow file access from file URLs"),
1369             _("Whether file access is allowed from file URLs."),
1370             FALSE,
1371             readWriteConstructParamFlags));
1372
1373     /**
1374      * WebKitSettings:allow-universal-access-from-file-urls:
1375      *
1376      * Whether or not JavaScript running in the context of a file scheme URL
1377      * should be allowed to access content from any origin.  By default, when
1378      * something is loaded in a #WebKitWebView using a file scheme URL,
1379      * access to the local file system and arbitrary local storage is not
1380      * allowed. This setting allows you to change that behaviour, so that
1381      * it would be possible to use local storage, for example.
1382      *
1383      * Since: 2.14
1384      */
1385     g_object_class_install_property(gObjectClass,
1386         PROP_ALLOW_UNIVERSAL_ACCESS_FROM_FILE_URLS,
1387         g_param_spec_boolean("allow-universal-access-from-file-urls",
1388             _("Allow universal access from the context of file scheme URLs"),
1389             _("Whether or not universal access is allowed from the context of file scheme URLs"),
1390             FALSE,
1391             readWriteConstructParamFlags));
1392
1393 #if PLATFORM(GTK)
1394     /**
1395      * WebKitSettings:hardware-acceleration-policy:
1396      *
1397      * The #WebKitHardwareAccelerationPolicy to decide how to enable and disable
1398      * hardware acceleration. The default value %WEBKIT_HARDWARE_ACCELERATION_POLICY_ON_DEMAND
1399      * enables the hardware acceleration when the web contents request it, disabling it again
1400      * when no longer needed. It's possible to enforce hardware acceleration to be always enabled
1401      * by using %WEBKIT_HARDWARE_ACCELERATION_POLICY_ALWAYS. And it's also possible to disable it
1402      * completely using %WEBKIT_HARDWARE_ACCELERATION_POLICY_NEVER. Note that disabling hardware
1403      * acceleration might cause some websites to not render correctly or consume more CPU.
1404      *
1405      * Note that changing this setting might not be possible if hardware acceleration is not
1406      * supported by the hardware or the system. In that case you can get the value to know the
1407      * actual policy being used, but changing the setting will not have any effect.
1408      *
1409      * Since: 2.16
1410      */
1411     g_object_class_install_property(gObjectClass,
1412         PROP_HARDWARE_ACCELERATION_POLICY,
1413         g_param_spec_enum("hardware-acceleration-policy",
1414             _("Hardware Acceleration Policy"),
1415             _("The policy to decide how to enable and disable hardware acceleration"),
1416             WEBKIT_TYPE_HARDWARE_ACCELERATION_POLICY,
1417             WEBKIT_HARDWARE_ACCELERATION_POLICY_ON_DEMAND,
1418             readWriteConstructParamFlags));
1419 #endif // PLATFOTM(GTK)
1420 }
1421
1422 WebPreferences* webkitSettingsGetPreferences(WebKitSettings* settings)
1423 {
1424     return settings->priv->preferences.get();
1425 }
1426
1427 /**
1428  * webkit_settings_new:
1429  *
1430  * Creates a new #WebKitSettings instance with default values. It must
1431  * be manually attached to a #WebKitWebView.
1432  * See also webkit_settings_new_with_settings().
1433  *
1434  * Returns: a new #WebKitSettings instance.
1435  */
1436 WebKitSettings* webkit_settings_new()
1437 {
1438     return WEBKIT_SETTINGS(g_object_new(WEBKIT_TYPE_SETTINGS, NULL));
1439 }
1440
1441 /**
1442  * webkit_settings_new_with_settings:
1443  * @first_setting_name: name of first setting to set
1444  * @...: value of first setting, followed by more settings,
1445  *    %NULL-terminated
1446  *
1447  * Creates a new #WebKitSettings instance with the given settings. It must
1448  * be manually attached to a #WebKitWebView.
1449  *
1450  * Returns: a new #WebKitSettings instance.
1451  */
1452 WebKitSettings* webkit_settings_new_with_settings(const gchar* firstSettingName, ...)
1453 {
1454     va_list args;
1455     va_start(args, firstSettingName);
1456     WebKitSettings* settings = WEBKIT_SETTINGS(g_object_new_valist(WEBKIT_TYPE_SETTINGS, firstSettingName, args));
1457     va_end(args);
1458     return settings;
1459 }
1460
1461 /**
1462  * webkit_settings_get_enable_javascript:
1463  * @settings: a #WebKitSettings
1464  *
1465  * Get the #WebKitSettings:enable-javascript property.
1466  *
1467  * Returns: %TRUE If JavaScript is enabled or %FALSE otherwise.
1468  */
1469 gboolean webkit_settings_get_enable_javascript(WebKitSettings* settings)
1470 {
1471     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1472
1473     return settings->priv->preferences->javaScriptEnabled();
1474 }
1475
1476 /**
1477  * webkit_settings_set_enable_javascript:
1478  * @settings: a #WebKitSettings
1479  * @enabled: Value to be set
1480  *
1481  * Set the #WebKitSettings:enable-javascript property.
1482  */
1483 void webkit_settings_set_enable_javascript(WebKitSettings* settings, gboolean enabled)
1484 {
1485     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1486
1487     WebKitSettingsPrivate* priv = settings->priv;
1488     bool currentValue = priv->preferences->javaScriptEnabled();
1489     if (currentValue == enabled)
1490         return;
1491
1492     priv->preferences->setJavaScriptEnabled(enabled);
1493     g_object_notify(G_OBJECT(settings), "enable-javascript");
1494 }
1495
1496 /**
1497  * webkit_settings_get_auto_load_images:
1498  * @settings: a #WebKitSettings
1499  *
1500  * Get the #WebKitSettings:auto-load-images property.
1501  *
1502  * Returns: %TRUE If auto loading of images is enabled or %FALSE otherwise.
1503  */
1504 gboolean webkit_settings_get_auto_load_images(WebKitSettings* settings)
1505 {
1506     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1507
1508     return settings->priv->preferences->loadsImagesAutomatically();
1509 }
1510
1511 /**
1512  * webkit_settings_set_auto_load_images:
1513  * @settings: a #WebKitSettings
1514  * @enabled: Value to be set
1515  *
1516  * Set the #WebKitSettings:auto-load-images property.
1517  */
1518 void webkit_settings_set_auto_load_images(WebKitSettings* settings, gboolean enabled)
1519 {
1520     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1521
1522     WebKitSettingsPrivate* priv = settings->priv;
1523     bool currentValue = priv->preferences->loadsImagesAutomatically();
1524     if (currentValue == enabled)
1525         return;
1526
1527     priv->preferences->setLoadsImagesAutomatically(enabled);
1528     g_object_notify(G_OBJECT(settings), "auto-load-images");
1529 }
1530
1531 /**
1532  * webkit_settings_get_load_icons_ignoring_image_load_setting:
1533  * @settings: a #WebKitSettings
1534  *
1535  * Get the #WebKitSettings:load-icons-ignoring-image-load-setting property.
1536  *
1537  * Returns: %TRUE If site icon can be loaded irrespective of image loading preference or %FALSE otherwise.
1538  */
1539 gboolean webkit_settings_get_load_icons_ignoring_image_load_setting(WebKitSettings* settings)
1540 {
1541     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1542
1543     return settings->priv->preferences->loadsSiteIconsIgnoringImageLoadingPreference();
1544 }
1545
1546 /**
1547  * webkit_settings_set_load_icons_ignoring_image_load_setting:
1548  * @settings: a #WebKitSettings
1549  * @enabled: Value to be set
1550  *
1551  * Set the #WebKitSettings:load-icons-ignoring-image-load-setting property.
1552  */
1553 void webkit_settings_set_load_icons_ignoring_image_load_setting(WebKitSettings* settings, gboolean enabled)
1554 {
1555     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1556
1557     WebKitSettingsPrivate* priv = settings->priv;
1558     bool currentValue = priv->preferences->loadsSiteIconsIgnoringImageLoadingPreference();
1559     if (currentValue == enabled)
1560         return;
1561
1562     priv->preferences->setLoadsSiteIconsIgnoringImageLoadingPreference(enabled);
1563     g_object_notify(G_OBJECT(settings), "load-icons-ignoring-image-load-setting");
1564 }
1565
1566 /**
1567  * webkit_settings_get_enable_offline_web_application_cache:
1568  * @settings: a #WebKitSettings
1569  *
1570  * Get the #WebKitSettings:enable-offline-web-application-cache property.
1571  *
1572  * Returns: %TRUE If HTML5 offline web application cache support is enabled or %FALSE otherwise.
1573  */
1574 gboolean webkit_settings_get_enable_offline_web_application_cache(WebKitSettings* settings)
1575 {
1576     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1577
1578     return settings->priv->preferences->offlineWebApplicationCacheEnabled();
1579 }
1580
1581 /**
1582  * webkit_settings_set_enable_offline_web_application_cache:
1583  * @settings: a #WebKitSettings
1584  * @enabled: Value to be set
1585  *
1586  * Set the #WebKitSettings:enable-offline-web-application-cache property.
1587  */
1588 void webkit_settings_set_enable_offline_web_application_cache(WebKitSettings* settings, gboolean enabled)
1589 {
1590     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1591
1592     WebKitSettingsPrivate* priv = settings->priv;
1593     bool currentValue = priv->preferences->offlineWebApplicationCacheEnabled();
1594     if (currentValue == enabled)
1595         return;
1596
1597     priv->preferences->setOfflineWebApplicationCacheEnabled(enabled);
1598     g_object_notify(G_OBJECT(settings), "enable-offline-web-application-cache");
1599 }
1600
1601 /**
1602  * webkit_settings_get_enable_html5_local_storage:
1603  * @settings: a #WebKitSettings
1604  *
1605  * Get the #WebKitSettings:enable-html5-local-storage property.
1606  *
1607  * Returns: %TRUE If HTML5 local storage support is enabled or %FALSE otherwise.
1608  */
1609 gboolean webkit_settings_get_enable_html5_local_storage(WebKitSettings* settings)
1610 {
1611     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1612
1613     return settings->priv->preferences->localStorageEnabled();
1614 }
1615
1616 /**
1617  * webkit_settings_set_enable_html5_local_storage:
1618  * @settings: a #WebKitSettings
1619  * @enabled: Value to be set
1620  *
1621  * Set the #WebKitSettings:enable-html5-local-storage property.
1622  */
1623 void webkit_settings_set_enable_html5_local_storage(WebKitSettings* settings, gboolean enabled)
1624 {
1625     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1626
1627     WebKitSettingsPrivate* priv = settings->priv;
1628     bool currentValue = priv->preferences->localStorageEnabled();
1629     if (currentValue == enabled)
1630         return;
1631
1632     priv->preferences->setLocalStorageEnabled(enabled);
1633     g_object_notify(G_OBJECT(settings), "enable-html5-local-storage");
1634 }
1635
1636 /**
1637  * webkit_settings_get_enable_html5_database:
1638  * @settings: a #WebKitSettings
1639  *
1640  * Get the #WebKitSettings:enable-html5-database property.
1641  *
1642  * Returns: %TRUE If HTML5 database support is enabled or %FALSE otherwise.
1643  */
1644 gboolean webkit_settings_get_enable_html5_database(WebKitSettings* settings)
1645 {
1646     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1647
1648     return settings->priv->preferences->databasesEnabled();
1649 }
1650
1651 /**
1652  * webkit_settings_set_enable_html5_database:
1653  * @settings: a #WebKitSettings
1654  * @enabled: Value to be set
1655  *
1656  * Set the #WebKitSettings:enable-html5-database property.
1657  */
1658 void webkit_settings_set_enable_html5_database(WebKitSettings* settings, gboolean enabled)
1659 {
1660     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1661
1662     WebKitSettingsPrivate* priv = settings->priv;
1663     bool currentValue = priv->preferences->databasesEnabled();
1664     if (currentValue == enabled)
1665         return;
1666
1667     priv->preferences->setDatabasesEnabled(enabled);
1668     g_object_notify(G_OBJECT(settings), "enable-html5-database");
1669 }
1670
1671 /**
1672  * webkit_settings_get_enable_xss_auditor:
1673  * @settings: a #WebKitSettings
1674  *
1675  * Get the #WebKitSettings:enable-xss-auditor property.
1676  *
1677  * Returns: %TRUE If XSS auditing is enabled or %FALSE otherwise.
1678  */
1679 gboolean webkit_settings_get_enable_xss_auditor(WebKitSettings* settings)
1680 {
1681     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1682
1683     return settings->priv->preferences->xssAuditorEnabled();
1684 }
1685
1686 /**
1687  * webkit_settings_set_enable_xss_auditor:
1688  * @settings: a #WebKitSettings
1689  * @enabled: Value to be set
1690  *
1691  * Set the #WebKitSettings:enable-xss-auditor property.
1692  */
1693 void webkit_settings_set_enable_xss_auditor(WebKitSettings* settings, gboolean enabled)
1694 {
1695     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1696
1697     WebKitSettingsPrivate* priv = settings->priv;
1698     bool currentValue = priv->preferences->xssAuditorEnabled();
1699     if (currentValue == enabled)
1700         return;
1701
1702     priv->preferences->setXSSAuditorEnabled(enabled);
1703     g_object_notify(G_OBJECT(settings), "enable-xss-auditor");
1704 }
1705
1706 /**
1707  * webkit_settings_get_enable_frame_flattening:
1708  * @settings: a #WebKitSettings
1709  *
1710  * Get the #WebKitSettings:enable-frame-flattening property.
1711  *
1712  * Returns: %TRUE If frame flattening is enabled or %FALSE otherwise.
1713  *
1714  **/
1715 gboolean webkit_settings_get_enable_frame_flattening(WebKitSettings* settings)
1716 {
1717     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1718
1719     return settings->priv->preferences->frameFlatteningEnabled();
1720 }
1721
1722 /**
1723  * webkit_settings_set_enable_frame_flattening:
1724  * @settings: a #WebKitSettings
1725  * @enabled: Value to be set
1726  *
1727  * Set the #WebKitSettings:enable-frame-flattening property.
1728  */
1729 void webkit_settings_set_enable_frame_flattening(WebKitSettings* settings, gboolean enabled)
1730 {
1731     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1732
1733     WebKitSettingsPrivate* priv = settings->priv;
1734     if (priv->preferences->frameFlatteningEnabled() == enabled)
1735         return;
1736
1737     priv->preferences->setFrameFlatteningEnabled(enabled);
1738     g_object_notify(G_OBJECT(settings), "enable-frame-flattening");
1739 }
1740
1741 /**
1742  * webkit_settings_get_enable_plugins:
1743  * @settings: a #WebKitSettings
1744  *
1745  * Get the #WebKitSettings:enable-plugins property.
1746  *
1747  * Returns: %TRUE If plugins are enabled or %FALSE otherwise.
1748  */
1749 gboolean webkit_settings_get_enable_plugins(WebKitSettings* settings)
1750 {
1751     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1752
1753     return settings->priv->preferences->pluginsEnabled();
1754 }
1755
1756 /**
1757  * webkit_settings_set_enable_plugins:
1758  * @settings: a #WebKitSettings
1759  * @enabled: Value to be set
1760  *
1761  * Set the #WebKitSettings:enable-plugins property.
1762  */
1763 void webkit_settings_set_enable_plugins(WebKitSettings* settings, gboolean enabled)
1764 {
1765     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1766
1767     WebKitSettingsPrivate* priv = settings->priv;
1768     bool currentValue = priv->preferences->pluginsEnabled();
1769     if (currentValue == enabled)
1770         return;
1771
1772     priv->preferences->setPluginsEnabled(enabled);
1773     g_object_notify(G_OBJECT(settings), "enable-plugins");
1774 }
1775
1776 /**
1777  * webkit_settings_get_enable_java:
1778  * @settings: a #WebKitSettings
1779  *
1780  * Get the #WebKitSettings:enable-java property.
1781  *
1782  * Returns: %TRUE If Java is enabled or %FALSE otherwise.
1783  */
1784 gboolean webkit_settings_get_enable_java(WebKitSettings* settings)
1785 {
1786     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1787
1788     return settings->priv->preferences->javaEnabled();
1789 }
1790
1791 /**
1792  * webkit_settings_set_enable_java:
1793  * @settings: a #WebKitSettings
1794  * @enabled: Value to be set
1795  *
1796  * Set the #WebKitSettings:enable-java property.
1797  */
1798 void webkit_settings_set_enable_java(WebKitSettings* settings, gboolean enabled)
1799 {
1800     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1801
1802     WebKitSettingsPrivate* priv = settings->priv;
1803     bool currentValue = priv->preferences->javaEnabled();
1804     if (currentValue == enabled)
1805         return;
1806
1807     priv->preferences->setJavaEnabled(enabled);
1808     g_object_notify(G_OBJECT(settings), "enable-java");
1809 }
1810
1811 /**
1812  * webkit_settings_get_javascript_can_open_windows_automatically:
1813  * @settings: a #WebKitSettings
1814  *
1815  * Get the #WebKitSettings:javascript-can-open-windows-automatically property.
1816  *
1817  * Returns: %TRUE If JavaScript can open window automatically or %FALSE otherwise.
1818  */
1819 gboolean webkit_settings_get_javascript_can_open_windows_automatically(WebKitSettings* settings)
1820 {
1821     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1822
1823     return settings->priv->preferences->javaScriptCanOpenWindowsAutomatically();
1824 }
1825
1826 /**
1827  * webkit_settings_set_javascript_can_open_windows_automatically:
1828  * @settings: a #WebKitSettings
1829  * @enabled: Value to be set
1830  *
1831  * Set the #WebKitSettings:javascript-can-open-windows-automatically property.
1832  */
1833 void webkit_settings_set_javascript_can_open_windows_automatically(WebKitSettings* settings, gboolean enabled)
1834 {
1835     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1836
1837     WebKitSettingsPrivate* priv = settings->priv;
1838     bool currentValue = priv->preferences->javaScriptCanOpenWindowsAutomatically();
1839     if (currentValue == enabled)
1840         return;
1841
1842     priv->preferences->setJavaScriptCanOpenWindowsAutomatically(enabled);
1843     g_object_notify(G_OBJECT(settings), "javascript-can-open-windows-automatically");
1844 }
1845
1846 /**
1847  * webkit_settings_get_enable_hyperlink_auditing:
1848  * @settings: a #WebKitSettings
1849  *
1850  * Get the #WebKitSettings:enable-hyperlink-auditing property.
1851  *
1852  * Returns: %TRUE If hyper link auditing is enabled or %FALSE otherwise.
1853  */
1854 gboolean webkit_settings_get_enable_hyperlink_auditing(WebKitSettings* settings)
1855 {
1856     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
1857
1858     return settings->priv->preferences->hyperlinkAuditingEnabled();
1859 }
1860
1861 /**
1862  * webkit_settings_set_enable_hyperlink_auditing:
1863  * @settings: a #WebKitSettings
1864  * @enabled: Value to be set
1865  *
1866  * Set the #WebKitSettings:enable-hyperlink-auditing property.
1867  */
1868 void webkit_settings_set_enable_hyperlink_auditing(WebKitSettings* settings, gboolean enabled)
1869 {
1870     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1871
1872     WebKitSettingsPrivate* priv = settings->priv;
1873     bool currentValue = priv->preferences->hyperlinkAuditingEnabled();
1874     if (currentValue == enabled)
1875         return;
1876
1877     priv->preferences->setHyperlinkAuditingEnabled(enabled);
1878     g_object_notify(G_OBJECT(settings), "enable-hyperlink-auditing");
1879 }
1880
1881 /**
1882  * webkit_web_settings_get_default_font_family:
1883  * @settings: a #WebKitSettings
1884  *
1885  * Gets the #WebKitSettings:default-font-family property.
1886  *
1887  * Returns: The default font family used to display content that does not specify a font.
1888  */
1889 const gchar* webkit_settings_get_default_font_family(WebKitSettings* settings)
1890 {
1891     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
1892
1893     return settings->priv->defaultFontFamily.data();
1894 }
1895
1896 /**
1897  * webkit_settings_set_default_font_family:
1898  * @settings: a #WebKitSettings
1899  * @default_font_family: the new default font family
1900  *
1901  * Set the #WebKitSettings:default-font-family property.
1902  */
1903 void webkit_settings_set_default_font_family(WebKitSettings* settings, const gchar* defaultFontFamily)
1904 {
1905     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1906     g_return_if_fail(defaultFontFamily);
1907
1908     WebKitSettingsPrivate* priv = settings->priv;
1909     if (!g_strcmp0(priv->defaultFontFamily.data(), defaultFontFamily))
1910         return;
1911
1912     String standardFontFamily = String::fromUTF8(defaultFontFamily);
1913     priv->preferences->setStandardFontFamily(standardFontFamily);
1914     priv->defaultFontFamily = standardFontFamily.utf8();
1915     g_object_notify(G_OBJECT(settings), "default-font-family");
1916 }
1917
1918 /**
1919  * webkit_settings_get_monospace_font_family:
1920  * @settings: a #WebKitSettings
1921  *
1922  * Gets the #WebKitSettings:monospace-font-family property.
1923  *
1924  * Returns: Default font family used to display content marked with monospace font.
1925  */
1926 const gchar* webkit_settings_get_monospace_font_family(WebKitSettings* settings)
1927 {
1928     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
1929
1930     return settings->priv->monospaceFontFamily.data();
1931 }
1932
1933 /**
1934  * webkit_settings_set_monospace_font_family:
1935  * @settings: a #WebKitSettings
1936  * @monospace_font_family: the new default monospace font family
1937  *
1938  * Set the #WebKitSettings:monospace-font-family property.
1939  */
1940 void webkit_settings_set_monospace_font_family(WebKitSettings* settings, const gchar* monospaceFontFamily)
1941 {
1942     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1943     g_return_if_fail(monospaceFontFamily);
1944
1945     WebKitSettingsPrivate* priv = settings->priv;
1946     if (!g_strcmp0(priv->monospaceFontFamily.data(), monospaceFontFamily))
1947         return;
1948
1949     String fixedFontFamily = String::fromUTF8(monospaceFontFamily);
1950     priv->preferences->setFixedFontFamily(fixedFontFamily);
1951     priv->monospaceFontFamily = fixedFontFamily.utf8();
1952     g_object_notify(G_OBJECT(settings), "monospace-font-family");
1953 }
1954
1955 /**
1956  * webkit_settings_get_serif_font_family:
1957  * @settings: a #WebKitSettings
1958  *
1959  * Gets the #WebKitSettings:serif-font-family property.
1960  *
1961  * Returns: The default font family used to display content marked with serif font.
1962  */
1963 const gchar* webkit_settings_get_serif_font_family(WebKitSettings* settings)
1964 {
1965     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
1966
1967     return settings->priv->serifFontFamily.data();
1968 }
1969
1970 /**
1971  * webkit_settings_set_serif_font_family:
1972  * @settings: a #WebKitSettings
1973  * @serif_font_family: the new default serif font family
1974  *
1975  * Set the #WebKitSettings:serif-font-family property.
1976  */
1977 void webkit_settings_set_serif_font_family(WebKitSettings* settings, const gchar* serifFontFamily)
1978 {
1979     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
1980     g_return_if_fail(serifFontFamily);
1981
1982     WebKitSettingsPrivate* priv = settings->priv;
1983     if (!g_strcmp0(priv->serifFontFamily.data(), serifFontFamily))
1984         return;
1985
1986     String serifFontFamilyString = String::fromUTF8(serifFontFamily);
1987     priv->preferences->setSerifFontFamily(serifFontFamilyString);
1988     priv->serifFontFamily = serifFontFamilyString.utf8();
1989     g_object_notify(G_OBJECT(settings), "serif-font-family");
1990 }
1991
1992 /**
1993  * webkit_settings_get_sans_serif_font_family:
1994  * @settings: a #WebKitSettings
1995  *
1996  * Gets the #WebKitSettings:sans-serif-font-family property.
1997  *
1998  * Returns: The default font family used to display content marked with sans-serif font.
1999  */
2000 const gchar* webkit_settings_get_sans_serif_font_family(WebKitSettings* settings)
2001 {
2002     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
2003
2004     return settings->priv->sansSerifFontFamily.data();
2005 }
2006
2007 /**
2008  * webkit_settings_set_sans_serif_font_family:
2009  * @settings: a #WebKitSettings
2010  * @sans_serif_font_family: the new default sans-serif font family
2011  *
2012  * Set the #WebKitSettings:sans-serif-font-family property.
2013  */
2014 void webkit_settings_set_sans_serif_font_family(WebKitSettings* settings, const gchar* sansSerifFontFamily)
2015 {
2016     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2017     g_return_if_fail(sansSerifFontFamily);
2018
2019     WebKitSettingsPrivate* priv = settings->priv;
2020     if (!g_strcmp0(priv->sansSerifFontFamily.data(), sansSerifFontFamily))
2021         return;
2022
2023     String sansSerifFontFamilyString = String::fromUTF8(sansSerifFontFamily);
2024     priv->preferences->setSansSerifFontFamily(sansSerifFontFamilyString);
2025     priv->sansSerifFontFamily = sansSerifFontFamilyString.utf8();
2026     g_object_notify(G_OBJECT(settings), "sans-serif-font-family");
2027 }
2028
2029 /**
2030  * webkit_settings_get_cursive_font_family:
2031  * @settings: a #WebKitSettings
2032  *
2033  * Gets the #WebKitSettings:cursive-font-family property.
2034  *
2035  * Returns: The default font family used to display content marked with cursive font.
2036  */
2037 const gchar* webkit_settings_get_cursive_font_family(WebKitSettings* settings)
2038 {
2039     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
2040
2041     return settings->priv->cursiveFontFamily.data();
2042 }
2043
2044 /**
2045  * webkit_settings_set_cursive_font_family:
2046  * @settings: a #WebKitSettings
2047  * @cursive_font_family: the new default cursive font family
2048  *
2049  * Set the #WebKitSettings:cursive-font-family property.
2050  */
2051 void webkit_settings_set_cursive_font_family(WebKitSettings* settings, const gchar* cursiveFontFamily)
2052 {
2053     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2054     g_return_if_fail(cursiveFontFamily);
2055
2056     WebKitSettingsPrivate* priv = settings->priv;
2057     if (!g_strcmp0(priv->cursiveFontFamily.data(), cursiveFontFamily))
2058         return;
2059
2060     String cursiveFontFamilyString = String::fromUTF8(cursiveFontFamily);
2061     priv->preferences->setCursiveFontFamily(cursiveFontFamilyString);
2062     priv->cursiveFontFamily = cursiveFontFamilyString.utf8();
2063     g_object_notify(G_OBJECT(settings), "cursive-font-family");
2064 }
2065
2066 /**
2067  * webkit_settings_get_fantasy_font_family:
2068  * @settings: a #WebKitSettings
2069  *
2070  * Gets the #WebKitSettings:fantasy-font-family property.
2071  *
2072  * Returns: The default font family used to display content marked with fantasy font.
2073  */
2074 const gchar* webkit_settings_get_fantasy_font_family(WebKitSettings* settings)
2075 {
2076     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
2077
2078     return settings->priv->fantasyFontFamily.data();
2079 }
2080
2081 /**
2082  * webkit_settings_set_fantasy_font_family:
2083  * @settings: a #WebKitSettings
2084  * @fantasy_font_family: the new default fantasy font family
2085  *
2086  * Set the #WebKitSettings:fantasy-font-family property.
2087  */
2088 void webkit_settings_set_fantasy_font_family(WebKitSettings* settings, const gchar* fantasyFontFamily)
2089 {
2090     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2091     g_return_if_fail(fantasyFontFamily);
2092
2093     WebKitSettingsPrivate* priv = settings->priv;
2094     if (!g_strcmp0(priv->fantasyFontFamily.data(), fantasyFontFamily))
2095         return;
2096
2097     String fantasyFontFamilyString = String::fromUTF8(fantasyFontFamily);
2098     priv->preferences->setFantasyFontFamily(fantasyFontFamilyString);
2099     priv->fantasyFontFamily = fantasyFontFamilyString.utf8();
2100     g_object_notify(G_OBJECT(settings), "fantasy-font-family");
2101 }
2102
2103 /**
2104  * webkit_settings_get_pictograph_font_family:
2105  * @settings: a #WebKitSettings
2106  *
2107  * Gets the #WebKitSettings:pictograph-font-family property.
2108  *
2109  * Returns: The default font family used to display content marked with pictograph font.
2110  */
2111 const gchar* webkit_settings_get_pictograph_font_family(WebKitSettings* settings)
2112 {
2113     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
2114
2115     return settings->priv->pictographFontFamily.data();
2116 }
2117
2118 /**
2119  * webkit_settings_set_pictograph_font_family:
2120  * @settings: a #WebKitSettings
2121  * @pictograph_font_family: the new default pictograph font family
2122  *
2123  * Set the #WebKitSettings:pictograph-font-family property.
2124  */
2125 void webkit_settings_set_pictograph_font_family(WebKitSettings* settings, const gchar* pictographFontFamily)
2126 {
2127     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2128     g_return_if_fail(pictographFontFamily);
2129
2130     WebKitSettingsPrivate* priv = settings->priv;
2131     if (!g_strcmp0(priv->pictographFontFamily.data(), pictographFontFamily))
2132         return;
2133
2134     String pictographFontFamilyString = String::fromUTF8(pictographFontFamily);
2135     priv->preferences->setPictographFontFamily(pictographFontFamilyString);
2136     priv->pictographFontFamily = pictographFontFamilyString.utf8();
2137     g_object_notify(G_OBJECT(settings), "pictograph-font-family");
2138 }
2139
2140 /**
2141  * webkit_settings_get_default_font_size:
2142  * @settings: a #WebKitSettings
2143  *
2144  * Gets the #WebKitSettings:default-font-size property.
2145  *
2146  * Returns: The default font size, in pixels.
2147  */
2148 guint32 webkit_settings_get_default_font_size(WebKitSettings* settings)
2149 {
2150     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
2151
2152     return settings->priv->preferences->defaultFontSize();
2153 }
2154
2155 /**
2156  * webkit_settings_set_default_font_size:
2157  * @settings: a #WebKitSettings
2158  * @font_size: default font size to be set in pixels
2159  *
2160  * Set the #WebKitSettings:default-font-size property.
2161  */
2162 void webkit_settings_set_default_font_size(WebKitSettings* settings, guint32 fontSize)
2163 {
2164     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2165
2166     WebKitSettingsPrivate* priv = settings->priv;
2167     uint32_t currentSize = priv->preferences->defaultFontSize();
2168     if (currentSize == fontSize)
2169         return;
2170
2171     priv->preferences->setDefaultFontSize(fontSize);
2172     g_object_notify(G_OBJECT(settings), "default-font-size");
2173 }
2174
2175 /**
2176  * webkit_settings_get_default_monospace_font_size:
2177  * @settings: a #WebKitSettings
2178  *
2179  * Gets the #WebKitSettings:default-monospace-font-size property.
2180  *
2181  * Returns: Default monospace font size, in pixels.
2182  */
2183 guint32 webkit_settings_get_default_monospace_font_size(WebKitSettings* settings)
2184 {
2185     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
2186
2187     return settings->priv->preferences->defaultFixedFontSize();
2188 }
2189
2190 /**
2191  * webkit_settings_set_default_monospace_font_size:
2192  * @settings: a #WebKitSettings
2193  * @font_size: default monospace font size to be set in pixels
2194  *
2195  * Set the #WebKitSettings:default-monospace-font-size property.
2196  */
2197 void webkit_settings_set_default_monospace_font_size(WebKitSettings* settings, guint32 fontSize)
2198 {
2199     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2200
2201     WebKitSettingsPrivate* priv = settings->priv;
2202     uint32_t currentSize = priv->preferences->defaultFixedFontSize();
2203     if (currentSize == fontSize)
2204         return;
2205
2206     priv->preferences->setDefaultFixedFontSize(fontSize);
2207     g_object_notify(G_OBJECT(settings), "default-monospace-font-size");
2208 }
2209
2210 /**
2211  * webkit_settings_get_minimum_font_size:
2212  * @settings: a #WebKitSettings
2213  *
2214  * Gets the #WebKitSettings:minimum-font-size property.
2215  *
2216  * Returns: Minimum font size, in pixels.
2217  */
2218 guint32 webkit_settings_get_minimum_font_size(WebKitSettings* settings)
2219 {
2220     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
2221
2222     return settings->priv->preferences->minimumFontSize();
2223 }
2224
2225 /**
2226  * webkit_settings_set_minimum_font_size:
2227  * @settings: a #WebKitSettings
2228  * @font_size: minimum font size to be set in pixels
2229  *
2230  * Set the #WebKitSettings:minimum-font-size property.
2231  */
2232 void webkit_settings_set_minimum_font_size(WebKitSettings* settings, guint32 fontSize)
2233 {
2234     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2235
2236     WebKitSettingsPrivate* priv = settings->priv;
2237     uint32_t currentSize = priv->preferences->minimumFontSize();
2238     if (currentSize == fontSize)
2239         return;
2240
2241     priv->preferences->setMinimumFontSize(fontSize);
2242     g_object_notify(G_OBJECT(settings), "minimum-font-size");
2243 }
2244
2245 /**
2246  * webkit_settings_get_default_charset:
2247  * @settings: a #WebKitSettings
2248  *
2249  * Gets the #WebKitSettings:default-charset property.
2250  *
2251  * Returns: Default charset.
2252  */
2253 const gchar* webkit_settings_get_default_charset(WebKitSettings* settings)
2254 {
2255     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
2256
2257     return settings->priv->defaultCharset.data();
2258 }
2259
2260 /**
2261  * webkit_settings_set_default_charset:
2262  * @settings: a #WebKitSettings
2263  * @default_charset: default charset to be set
2264  *
2265  * Set the #WebKitSettings:default-charset property.
2266  */
2267 void webkit_settings_set_default_charset(WebKitSettings* settings, const gchar* defaultCharset)
2268 {
2269     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2270     g_return_if_fail(defaultCharset);
2271
2272     WebKitSettingsPrivate* priv = settings->priv;
2273     if (!g_strcmp0(priv->defaultCharset.data(), defaultCharset))
2274         return;
2275
2276     String defaultCharsetString = String::fromUTF8(defaultCharset);
2277     priv->preferences->setDefaultTextEncodingName(defaultCharsetString);
2278     priv->defaultCharset = defaultCharsetString.utf8();
2279     g_object_notify(G_OBJECT(settings), "default-charset");
2280 }
2281
2282 #if PLATFORM(GTK)
2283 /**
2284  * webkit_settings_get_enable_private_browsing:
2285  * @settings: a #WebKitSettings
2286  *
2287  * Get the #WebKitSettings:enable-private-browsing property.
2288  *
2289  * Returns: %TRUE If private browsing is enabled or %FALSE otherwise.
2290  *
2291  * Deprecated: 2.16. Use #WebKitWebView:is-ephemeral or #WebKitWebContext:is-ephemeral instead.
2292  */
2293 gboolean webkit_settings_get_enable_private_browsing(WebKitSettings* settings)
2294 {
2295     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2296
2297     return settings->priv->preferences->privateBrowsingEnabled();
2298 }
2299
2300 /**
2301  * webkit_settings_set_enable_private_browsing:
2302  * @settings: a #WebKitSettings
2303  * @enabled: Value to be set
2304  *
2305  * Set the #WebKitSettings:enable-private-browsing property.
2306  *
2307  * Deprecated: 2.16. Use #WebKitWebView:is-ephemeral or #WebKitWebContext:is-ephemeral instead.
2308  */
2309 void webkit_settings_set_enable_private_browsing(WebKitSettings* settings, gboolean enabled)
2310 {
2311     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2312
2313     WebKitSettingsPrivate* priv = settings->priv;
2314     bool currentValue = priv->preferences->privateBrowsingEnabled();
2315     if (currentValue == enabled)
2316         return;
2317
2318     priv->preferences->setPrivateBrowsingEnabled(enabled);
2319     g_object_notify(G_OBJECT(settings), "enable-private-browsing");
2320 }
2321 #endif
2322
2323 /**
2324  * webkit_settings_get_enable_developer_extras:
2325  * @settings: a #WebKitSettings
2326  *
2327  * Get the #WebKitSettings:enable-developer-extras property.
2328  *
2329  * Returns: %TRUE If developer extras is enabled or %FALSE otherwise.
2330  */
2331 gboolean webkit_settings_get_enable_developer_extras(WebKitSettings* settings)
2332 {
2333     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2334
2335     return settings->priv->preferences->developerExtrasEnabled();
2336 }
2337
2338 /**
2339  * webkit_settings_set_enable_developer_extras:
2340  * @settings: a #WebKitSettings
2341  * @enabled: Value to be set
2342  *
2343  * Set the #WebKitSettings:enable-developer-extras property.
2344  */
2345 void webkit_settings_set_enable_developer_extras(WebKitSettings* settings, gboolean enabled)
2346 {
2347     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2348
2349     WebKitSettingsPrivate* priv = settings->priv;
2350     bool currentValue = priv->preferences->developerExtrasEnabled();
2351     if (currentValue == enabled)
2352         return;
2353
2354     priv->preferences->setDeveloperExtrasEnabled(enabled);
2355     g_object_notify(G_OBJECT(settings), "enable-developer-extras");
2356 }
2357
2358 /**
2359  * webkit_settings_get_enable_resizable_text_areas:
2360  * @settings: a #WebKitSettings
2361  *
2362  * Get the #WebKitSettings:enable-resizable-text-areas property.
2363  *
2364  * Returns: %TRUE If text areas can be resized or %FALSE otherwise.
2365  */
2366 gboolean webkit_settings_get_enable_resizable_text_areas(WebKitSettings* settings)
2367 {
2368     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2369
2370     return settings->priv->preferences->textAreasAreResizable();
2371 }
2372
2373 /**
2374  * webkit_settings_set_enable_resizable_text_areas:
2375  * @settings: a #WebKitSettings
2376  * @enabled: Value to be set
2377  *
2378  * Set the #WebKitSettings:enable-resizable-text-areas property.
2379  */
2380 void webkit_settings_set_enable_resizable_text_areas(WebKitSettings* settings, gboolean enabled)
2381 {
2382     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2383
2384     WebKitSettingsPrivate* priv = settings->priv;
2385     bool currentValue = priv->preferences->textAreasAreResizable();
2386     if (currentValue == enabled)
2387         return;
2388
2389     priv->preferences->setTextAreasAreResizable(enabled);
2390     g_object_notify(G_OBJECT(settings), "enable-resizable-text-areas");
2391 }
2392
2393 /**
2394  * webkit_settings_get_enable_tabs_to_links:
2395  * @settings: a #WebKitSettings
2396  *
2397  * Get the #WebKitSettings:enable-tabs-to-links property.
2398  *
2399  * Returns: %TRUE If tabs to link is enabled or %FALSE otherwise.
2400  */
2401 gboolean webkit_settings_get_enable_tabs_to_links(WebKitSettings* settings)
2402 {
2403     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2404
2405     return settings->priv->preferences->tabsToLinks();
2406 }
2407
2408 /**
2409  * webkit_settings_set_enable_tabs_to_links:
2410  * @settings: a #WebKitSettings
2411  * @enabled: Value to be set
2412  *
2413  * Set the #WebKitSettings:enable-tabs-to-links property.
2414  */
2415 void webkit_settings_set_enable_tabs_to_links(WebKitSettings* settings, gboolean enabled)
2416 {
2417     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2418
2419     WebKitSettingsPrivate* priv = settings->priv;
2420     bool currentValue = priv->preferences->tabsToLinks();
2421     if (currentValue == enabled)
2422         return;
2423
2424     priv->preferences->setTabsToLinks(enabled);
2425     g_object_notify(G_OBJECT(settings), "enable-tabs-to-links");
2426 }
2427
2428 /**
2429  * webkit_settings_get_enable_dns_prefetching:
2430  * @settings: a #WebKitSettings
2431  *
2432  * Get the #WebKitSettings:enable-dns-prefetching property.
2433  *
2434  * Returns: %TRUE If DNS prefetching is enabled or %FALSE otherwise.
2435  */
2436 gboolean webkit_settings_get_enable_dns_prefetching(WebKitSettings* settings)
2437 {
2438     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2439
2440     return settings->priv->preferences->dnsPrefetchingEnabled();
2441 }
2442
2443 /**
2444  * webkit_settings_set_enable_dns_prefetching:
2445  * @settings: a #WebKitSettings
2446  * @enabled: Value to be set
2447  *
2448  * Set the #WebKitSettings:enable-dns-prefetching property.
2449  */
2450 void webkit_settings_set_enable_dns_prefetching(WebKitSettings* settings, gboolean enabled)
2451 {
2452     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2453
2454     WebKitSettingsPrivate* priv = settings->priv;
2455     bool currentValue = priv->preferences->dnsPrefetchingEnabled();
2456     if (currentValue == enabled)
2457         return;
2458
2459     priv->preferences->setDNSPrefetchingEnabled(enabled);
2460     g_object_notify(G_OBJECT(settings), "enable-dns-prefetching");
2461 }
2462
2463 /**
2464  * webkit_settings_get_enable_caret_browsing:
2465  * @settings: a #WebKitSettings
2466  *
2467  * Get the #WebKitSettings:enable-caret-browsing property.
2468  *
2469  * Returns: %TRUE If caret browsing is enabled or %FALSE otherwise.
2470  */
2471 gboolean webkit_settings_get_enable_caret_browsing(WebKitSettings* settings)
2472 {
2473     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2474
2475     return settings->priv->preferences->caretBrowsingEnabled();
2476 }
2477
2478 /**
2479  * webkit_settings_set_enable_caret_browsing:
2480  * @settings: a #WebKitSettings
2481  * @enabled: Value to be set
2482  *
2483  * Set the #WebKitSettings:enable-caret-browsing property.
2484  */
2485 void webkit_settings_set_enable_caret_browsing(WebKitSettings* settings, gboolean enabled)
2486 {
2487     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2488
2489     WebKitSettingsPrivate* priv = settings->priv;
2490     bool currentValue = priv->preferences->caretBrowsingEnabled();
2491     if (currentValue == enabled)
2492         return;
2493
2494     priv->preferences->setCaretBrowsingEnabled(enabled);
2495     g_object_notify(G_OBJECT(settings), "enable-caret-browsing");
2496 }
2497
2498 /**
2499  * webkit_settings_get_enable_fullscreen:
2500  * @settings: a #WebKitSettings
2501  *
2502  * Get the #WebKitSettings:enable-fullscreen property.
2503  *
2504  * Returns: %TRUE If fullscreen support is enabled or %FALSE otherwise.
2505  */
2506 gboolean webkit_settings_get_enable_fullscreen(WebKitSettings* settings)
2507 {
2508     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2509
2510     return settings->priv->preferences->fullScreenEnabled();
2511 }
2512
2513 /**
2514  * webkit_settings_set_enable_fullscreen:
2515  * @settings: a #WebKitSettings
2516  * @enabled: Value to be set
2517  *
2518  * Set the #WebKitSettings:enable-fullscreen property.
2519  */
2520 void webkit_settings_set_enable_fullscreen(WebKitSettings* settings, gboolean enabled)
2521 {
2522     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2523
2524     WebKitSettingsPrivate* priv = settings->priv;
2525     bool currentValue = priv->preferences->fullScreenEnabled();
2526     if (currentValue == enabled)
2527         return;
2528
2529     priv->preferences->setFullScreenEnabled(enabled);
2530     g_object_notify(G_OBJECT(settings), "enable-fullscreen");
2531 }
2532
2533 /**
2534  * webkit_settings_get_print_backgrounds:
2535  * @settings: a #WebKitSettings
2536  *
2537  * Get the #WebKitSettings:print-backgrounds property.
2538  *
2539  * Returns: %TRUE If background images should be printed or %FALSE otherwise.
2540  */
2541 gboolean webkit_settings_get_print_backgrounds(WebKitSettings* settings)
2542 {
2543     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2544
2545     return settings->priv->preferences->shouldPrintBackgrounds();
2546 }
2547
2548 /**
2549  * webkit_settings_set_print_backgrounds:
2550  * @settings: a #WebKitSettings
2551  * @print_backgrounds: Value to be set
2552  *
2553  * Set the #WebKitSettings:print-backgrounds property.
2554  */
2555 void webkit_settings_set_print_backgrounds(WebKitSettings* settings, gboolean printBackgrounds)
2556 {
2557     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2558
2559     WebKitSettingsPrivate* priv = settings->priv;
2560     bool currentValue = priv->preferences->shouldPrintBackgrounds();
2561     if (currentValue == printBackgrounds)
2562         return;
2563
2564     priv->preferences->setShouldPrintBackgrounds(printBackgrounds);
2565     g_object_notify(G_OBJECT(settings), "print-backgrounds");
2566 }
2567
2568 /**
2569  * webkit_settings_get_enable_webaudio:
2570  * @settings: a #WebKitSettings
2571  *
2572  * Get the #WebKitSettings:enable-webaudio property.
2573  *
2574  * Returns: %TRUE If webaudio support is enabled or %FALSE otherwise.
2575  */
2576 gboolean webkit_settings_get_enable_webaudio(WebKitSettings* settings)
2577 {
2578     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2579
2580     return settings->priv->preferences->webAudioEnabled();
2581 }
2582
2583 /**
2584  * webkit_settings_set_enable_webaudio:
2585  * @settings: a #WebKitSettings
2586  * @enabled: Value to be set
2587  *
2588  * Set the #WebKitSettings:enable-webaudio property.
2589  */
2590 void webkit_settings_set_enable_webaudio(WebKitSettings* settings, gboolean enabled)
2591 {
2592     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2593
2594     WebKitSettingsPrivate* priv = settings->priv;
2595     bool currentValue = priv->preferences->webAudioEnabled();
2596     if (currentValue == enabled)
2597         return;
2598
2599     priv->preferences->setWebAudioEnabled(enabled);
2600     g_object_notify(G_OBJECT(settings), "enable-webaudio");
2601 }
2602
2603 /**
2604  * webkit_settings_get_enable_webgl:
2605  * @settings: a #WebKitSettings
2606  *
2607  * Get the #WebKitSettings:enable-webgl property.
2608  *
2609  * Returns: %TRUE If WebGL support is enabled or %FALSE otherwise.
2610  */
2611 gboolean webkit_settings_get_enable_webgl(WebKitSettings* settings)
2612 {
2613     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2614
2615     return settings->priv->preferences->webGLEnabled();
2616 }
2617
2618 /**
2619  * webkit_settings_set_enable_webgl:
2620  * @settings: a #WebKitSettings
2621  * @enabled: Value to be set
2622  *
2623  * Set the #WebKitSettings:enable-webgl property.
2624  */
2625 void webkit_settings_set_enable_webgl(WebKitSettings* settings, gboolean enabled)
2626 {
2627     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2628
2629     WebKitSettingsPrivate* priv = settings->priv;
2630     bool currentValue = priv->preferences->webGLEnabled();
2631     if (currentValue == enabled)
2632         return;
2633
2634     priv->preferences->setWebGLEnabled(enabled);
2635     g_object_notify(G_OBJECT(settings), "enable-webgl");
2636 }
2637
2638 /**
2639  * webkit_settings_get_allow_modal_dialogs:
2640  * @settings: a #WebKitSettings
2641  *
2642  * Get the #WebKitSettings:allow-modal-dialogs property.
2643  *
2644  * Returns: %TRUE if it's allowed to create and run modal dialogs or %FALSE otherwise.
2645  */
2646 gboolean webkit_settings_get_allow_modal_dialogs(WebKitSettings* settings)
2647 {
2648     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2649     return settings->priv->allowModalDialogs;
2650 }
2651
2652 /**
2653  * webkit_settings_set_allow_modal_dialogs:
2654  * @settings: a #WebKitSettings
2655  * @allowed: Value to be set
2656  *
2657  * Set the #WebKitSettings:allow-modal-dialogs property.
2658  */
2659 void webkit_settings_set_allow_modal_dialogs(WebKitSettings* settings, gboolean allowed)
2660 {
2661     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2662
2663     WebKitSettingsPrivate* priv = settings->priv;
2664     if (priv->allowModalDialogs == allowed)
2665         return;
2666
2667     priv->allowModalDialogs = allowed;
2668     g_object_notify(G_OBJECT(settings), "allow-modal-dialogs");
2669 }
2670
2671 /**
2672  * webkit_settings_get_zoom_text_only:
2673  * @settings: a #WebKitSettings
2674  *
2675  * Get the #WebKitSettings:zoom-text-only property.
2676  *
2677  * Returns: %TRUE If zoom level of the view should only affect the text
2678  *    or %FALSE if all view contents should be scaled.
2679  */
2680 gboolean webkit_settings_get_zoom_text_only(WebKitSettings* settings)
2681 {
2682     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2683
2684     return settings->priv->zoomTextOnly;
2685 }
2686
2687 /**
2688  * webkit_settings_set_zoom_text_only:
2689  * @settings: a #WebKitSettings
2690  * @zoom_text_only: Value to be set
2691  *
2692  * Set the #WebKitSettings:zoom-text-only property.
2693  */
2694 void webkit_settings_set_zoom_text_only(WebKitSettings* settings, gboolean zoomTextOnly)
2695 {
2696     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2697
2698     WebKitSettingsPrivate* priv = settings->priv;
2699     if (priv->zoomTextOnly == zoomTextOnly)
2700         return;
2701
2702     priv->zoomTextOnly = zoomTextOnly;
2703     g_object_notify(G_OBJECT(settings), "zoom-text-only");
2704 }
2705
2706 /**
2707  * webkit_settings_get_javascript_can_access_clipboard:
2708  * @settings: a #WebKitSettings
2709  *
2710  * Get the #WebKitSettings:javascript-can-access-clipboard property.
2711  *
2712  * Returns: %TRUE If javascript-can-access-clipboard is enabled or %FALSE otherwise.
2713  */
2714 gboolean webkit_settings_get_javascript_can_access_clipboard(WebKitSettings* settings)
2715 {
2716     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2717
2718     return settings->priv->preferences->javaScriptCanAccessClipboard()
2719         && settings->priv->preferences->domPasteAllowed();
2720 }
2721
2722 /**
2723  * webkit_settings_set_javascript_can_access_clipboard:
2724  * @settings: a #WebKitSettings
2725  * @enabled: Value to be set
2726  *
2727  * Set the #WebKitSettings:javascript-can-access-clipboard property.
2728  */
2729 void webkit_settings_set_javascript_can_access_clipboard(WebKitSettings* settings, gboolean enabled)
2730 {
2731     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2732
2733     WebKitSettingsPrivate* priv = settings->priv;
2734     bool currentValue = priv->preferences->javaScriptCanAccessClipboard() && priv->preferences->domPasteAllowed();
2735     if (currentValue == enabled)
2736         return;
2737
2738     priv->preferences->setJavaScriptCanAccessClipboard(enabled);
2739     priv->preferences->setDOMPasteAllowed(enabled);
2740     g_object_notify(G_OBJECT(settings), "javascript-can-access-clipboard");
2741 }
2742
2743 /**
2744  * webkit_settings_get_media_playback_requires_user_gesture:
2745  * @settings: a #WebKitSettings
2746  *
2747  * Get the #WebKitSettings:media-playback-requires-user-gesture property.
2748  *
2749  * Returns: %TRUE If an user gesture is needed to play or load media
2750  *    or %FALSE if no user gesture is needed.
2751  */
2752 gboolean webkit_settings_get_media_playback_requires_user_gesture(WebKitSettings* settings)
2753 {
2754     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2755
2756     return settings->priv->preferences->requiresUserGestureForMediaPlayback();
2757 }
2758
2759 /**
2760  * webkit_settings_set_media_playback_requires_user_gesture:
2761  * @settings: a #WebKitSettings
2762  * @enabled: Value to be set
2763  *
2764  * Set the #WebKitSettings:media-playback-requires-user-gesture property.
2765  */
2766 void webkit_settings_set_media_playback_requires_user_gesture(WebKitSettings* settings, gboolean enabled)
2767 {
2768     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2769
2770     WebKitSettingsPrivate* priv = settings->priv;
2771     bool currentValue = priv->preferences->requiresUserGestureForMediaPlayback();
2772     if (currentValue == enabled)
2773         return;
2774
2775     priv->preferences->setRequiresUserGestureForMediaPlayback(enabled);
2776     g_object_notify(G_OBJECT(settings), "media-playback-requires-user-gesture");
2777 }
2778
2779 /**
2780  * webkit_settings_get_media_playback_allows_inline:
2781  * @settings: a #WebKitSettings
2782  *
2783  * Get the #WebKitSettings:media-playback-allows-inline property.
2784  *
2785  * Returns: %TRUE If inline playback is allowed for media
2786  *    or %FALSE if only fullscreen playback is allowed.
2787  */
2788 gboolean webkit_settings_get_media_playback_allows_inline(WebKitSettings* settings)
2789 {
2790     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), TRUE);
2791
2792     return settings->priv->preferences->allowsInlineMediaPlayback();
2793 }
2794
2795 /**
2796  * webkit_settings_set_media_playback_allows_inline:
2797  * @settings: a #WebKitSettings
2798  * @enabled: Value to be set
2799  *
2800  * Set the #WebKitSettings:media-playback-allows-inline property.
2801  */
2802 void webkit_settings_set_media_playback_allows_inline(WebKitSettings* settings, gboolean enabled)
2803 {
2804     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2805
2806     WebKitSettingsPrivate* priv = settings->priv;
2807     bool currentValue = priv->preferences->allowsInlineMediaPlayback();
2808     if (currentValue == enabled)
2809         return;
2810
2811     priv->preferences->setAllowsInlineMediaPlayback(enabled);
2812     g_object_notify(G_OBJECT(settings), "media-playback-allows-inline");
2813 }
2814
2815 /**
2816  * webkit_settings_get_draw_compositing_indicators:
2817  * @settings: a #WebKitSettings
2818  *
2819  * Get the #WebKitSettings:draw-compositing-indicators property.
2820  *
2821  * Returns: %TRUE If compositing borders are drawn or %FALSE otherwise.
2822  */
2823 gboolean webkit_settings_get_draw_compositing_indicators(WebKitSettings* settings)
2824 {
2825     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2826     return settings->priv->preferences->compositingBordersVisible()
2827         && settings->priv->preferences->compositingRepaintCountersVisible();
2828 }
2829
2830 /**
2831  * webkit_settings_set_draw_compositing_indicators:
2832  * @settings: a #WebKitSettings
2833  * @enabled: Value to be set
2834  *
2835  * Set the #WebKitSettings:draw-compositing-indicators property.
2836  */
2837 void webkit_settings_set_draw_compositing_indicators(WebKitSettings* settings, gboolean enabled)
2838 {
2839     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2840
2841     WebKitSettingsPrivate* priv = settings->priv;
2842     if (priv->preferences->compositingBordersVisible() == enabled
2843         && priv->preferences->compositingRepaintCountersVisible() == enabled)
2844         return;
2845
2846     priv->preferences->setCompositingBordersVisible(enabled);
2847     priv->preferences->setCompositingRepaintCountersVisible(enabled);
2848     g_object_notify(G_OBJECT(settings), "draw-compositing-indicators");
2849 }
2850
2851 /**
2852  * webkit_settings_get_enable_site_specific_quirks:
2853  * @settings: a #WebKitSettings
2854  *
2855  * Get the #WebKitSettings:enable-site-specific-quirks property.
2856  *
2857  * Returns: %TRUE if site specific quirks are enabled or %FALSE otherwise.
2858  */
2859 gboolean webkit_settings_get_enable_site_specific_quirks(WebKitSettings* settings)
2860 {
2861     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2862
2863     return settings->priv->preferences->needsSiteSpecificQuirks();
2864 }
2865
2866 /**
2867  * webkit_settings_set_enable_site_specific_quirks:
2868  * @settings: a #WebKitSettings
2869  * @enabled: Value to be set
2870  *
2871  * Set the #WebKitSettings:enable-site-specific-quirks property.
2872  */
2873 void webkit_settings_set_enable_site_specific_quirks(WebKitSettings* settings, gboolean enabled)
2874 {
2875     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2876
2877     WebKitSettingsPrivate* priv = settings->priv;
2878     bool currentValue = priv->preferences->needsSiteSpecificQuirks();
2879     if (currentValue == enabled)
2880         return;
2881
2882     priv->preferences->setNeedsSiteSpecificQuirks(enabled);
2883     g_object_notify(G_OBJECT(settings), "enable-site-specific-quirks");
2884 }
2885
2886 /**
2887  * webkit_settings_get_enable_page_cache:
2888  * @settings: a #WebKitSettings
2889  *
2890  * Get the #WebKitSettings:enable-page-cache property.
2891  *
2892  * Returns: %TRUE if page cache enabled or %FALSE otherwise.
2893  */
2894 gboolean webkit_settings_get_enable_page_cache(WebKitSettings* settings)
2895 {
2896     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2897
2898     return settings->priv->preferences->usesPageCache();
2899 }
2900
2901 /**
2902  * webkit_settings_set_enable_page_cache:
2903  * @settings: a #WebKitSettings
2904  * @enabled: Value to be set
2905  *
2906  * Set the #WebKitSettings:enable-page-cache property.
2907  */
2908 void webkit_settings_set_enable_page_cache(WebKitSettings* settings, gboolean enabled)
2909 {
2910     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2911
2912     WebKitSettingsPrivate* priv = settings->priv;
2913     bool currentValue = priv->preferences->usesPageCache();
2914     if (currentValue == enabled)
2915         return;
2916
2917     priv->preferences->setUsesPageCache(enabled);
2918     g_object_notify(G_OBJECT(settings), "enable-page-cache");
2919 }
2920
2921 /**
2922  * webkit_settings_get_user_agent:
2923  * @settings: a #WebKitSettings
2924  *
2925  * Get the #WebKitSettings:user-agent property.
2926  *
2927  * Returns: The current value of the user-agent property.
2928  */
2929 const char* webkit_settings_get_user_agent(WebKitSettings* settings)
2930 {
2931     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
2932
2933     WebKitSettingsPrivate* priv = settings->priv;
2934     ASSERT(!priv->userAgent.isNull());
2935     return priv->userAgent.data();
2936 }
2937
2938 /**
2939  * webkit_settings_set_user_agent:
2940  * @settings: a #WebKitSettings
2941  * @user_agent: (allow-none): The new custom user agent string or %NULL to use the default user agent
2942  *
2943  * Set the #WebKitSettings:user-agent property.
2944  */
2945 void webkit_settings_set_user_agent(WebKitSettings* settings, const char* userAgent)
2946 {
2947     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2948
2949     WebKitSettingsPrivate* priv = settings->priv;
2950     CString newUserAgent = (!userAgent || !strlen(userAgent)) ? WebCore::standardUserAgent("").utf8() : userAgent;
2951     if (newUserAgent == priv->userAgent)
2952         return;
2953
2954     priv->userAgent = newUserAgent;
2955     g_object_notify(G_OBJECT(settings), "user-agent");
2956 }
2957
2958 /**
2959  * webkit_settings_set_user_agent_with_application_details:
2960  * @settings: a #WebKitSettings
2961  * @application_name: (allow-none): The application name used for the user agent or %NULL to use the default user agent.
2962  * @application_version: (allow-none): The application version for the user agent or %NULL to user the default version.
2963  *
2964  * Set the #WebKitSettings:user-agent property by appending the application details to the default user
2965  * agent. If no application name or version is given, the default user agent used will be used. If only
2966  * the version is given, the default engine version is used with the given application name.
2967  */
2968 void webkit_settings_set_user_agent_with_application_details(WebKitSettings* settings, const char* applicationName, const char* applicationVersion)
2969 {
2970     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
2971
2972     CString newUserAgent = WebCore::standardUserAgent(String::fromUTF8(applicationName), String::fromUTF8(applicationVersion)).utf8();
2973     webkit_settings_set_user_agent(settings, newUserAgent.data());
2974 }
2975
2976 /**
2977  * webkit_settings_get_enable_smooth_scrolling:
2978  * @settings: a #WebKitSettings
2979  *
2980  * Get the #WebKitSettings:enable-smooth-scrolling property.
2981  *
2982  * Returns: %TRUE if smooth scrolling is enabled or %FALSE otherwise.
2983  */
2984 gboolean webkit_settings_get_enable_smooth_scrolling(WebKitSettings* settings)
2985 {
2986     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
2987
2988     return settings->priv->preferences->scrollAnimatorEnabled();
2989 }
2990
2991 /**
2992  * webkit_settings_set_enable_smooth_scrolling:
2993  * @settings: a #WebKitSettings
2994  * @enabled: Value to be set
2995  *
2996  * Set the #WebKitSettings:enable-smooth-scrolling property.
2997  */
2998 void webkit_settings_set_enable_smooth_scrolling(WebKitSettings* settings, gboolean enabled)
2999 {
3000     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
3001
3002     WebKitSettingsPrivate* priv = settings->priv;
3003     bool currentValue = priv->preferences->scrollAnimatorEnabled();
3004     if (currentValue == enabled)
3005         return;
3006
3007     priv->preferences->setScrollAnimatorEnabled(enabled);
3008     g_object_notify(G_OBJECT(settings), "enable-smooth-scrolling");
3009 }
3010
3011 /**
3012  * webkit_settings_get_enable_accelerated_2d_canvas:
3013  * @settings: a #WebKitSettings
3014  *
3015  * Get the #WebKitSettings:enable-accelerated-2d-canvas property.
3016  *
3017  * Returns: %TRUE if accelerated 2D canvas is enabled or %FALSE otherwise.
3018  *
3019  * Since: 2.2
3020  */
3021 gboolean webkit_settings_get_enable_accelerated_2d_canvas(WebKitSettings* settings)
3022 {
3023     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
3024
3025     return settings->priv->preferences->accelerated2dCanvasEnabled();
3026 }
3027
3028 /**
3029  * webkit_settings_set_enable_accelerated_2d_canvas:
3030  * @settings: a #WebKitSettings
3031  * @enabled: Value to be set
3032  *
3033  * Set the #WebKitSettings:enable-accelerated-2d-canvas property.
3034  *
3035  * Since: 2.2
3036  */
3037 void webkit_settings_set_enable_accelerated_2d_canvas(WebKitSettings* settings, gboolean enabled)
3038 {
3039     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
3040
3041     WebKitSettingsPrivate* priv = settings->priv;
3042     if (priv->preferences->accelerated2dCanvasEnabled() == enabled)
3043         return;
3044
3045     priv->preferences->setAccelerated2dCanvasEnabled(enabled);
3046     g_object_notify(G_OBJECT(settings), "enable-accelerated-2d-canvas");
3047 }
3048
3049 /**
3050  * webkit_settings_get_enable_write_console_messages_to_stdout:
3051  * @settings: a #WebKitSettings
3052  *
3053  * Get the #WebKitSettings:enable-write-console-messages-to-stdout property.
3054  *
3055  * Returns: %TRUE if writing console messages to stdout is enabled or %FALSE
3056  * otherwise.
3057  *
3058  * Since: 2.2
3059  */
3060 gboolean webkit_settings_get_enable_write_console_messages_to_stdout(WebKitSettings* settings)
3061 {
3062     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
3063
3064     return settings->priv->preferences->logsPageMessagesToSystemConsoleEnabled();
3065 }
3066
3067 /**
3068  * webkit_settings_set_enable_write_console_messages_to_stdout:
3069  * @settings: a #WebKitSettings
3070  * @enabled: Value to be set
3071  *
3072  * Set the #WebKitSettings:enable-write-console-messages-to-stdout property.
3073  *
3074  * Since: 2.2
3075  */
3076 void webkit_settings_set_enable_write_console_messages_to_stdout(WebKitSettings* settings, gboolean enabled)
3077 {
3078     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
3079
3080     WebKitSettingsPrivate* priv = settings->priv;
3081     bool currentValue = priv->preferences->logsPageMessagesToSystemConsoleEnabled();
3082     if (currentValue == enabled)
3083         return;
3084
3085     priv->preferences->setLogsPageMessagesToSystemConsoleEnabled(enabled);
3086     g_object_notify(G_OBJECT(settings), "enable-write-console-messages-to-stdout");
3087 }
3088
3089 /**
3090  * webkit_settings_get_enable_media_stream:
3091  * @settings: a #WebKitSettings
3092  *
3093  * Get the #WebKitSettings:enable-media-stream property.
3094  *
3095  * Returns: %TRUE If mediastream support is enabled or %FALSE otherwise.
3096  *
3097  * Since: 2.4
3098  */
3099 gboolean webkit_settings_get_enable_media_stream(WebKitSettings* settings)
3100 {
3101     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
3102
3103     return settings->priv->preferences->mediaStreamEnabled();
3104 }
3105
3106 /**
3107  * webkit_settings_set_enable_media_stream:
3108  * @settings: a #WebKitSettings
3109  * @enabled: Value to be set
3110  *
3111  * Set the #WebKitSettings:enable-media-stream property.
3112  *
3113  * Since: 2.4
3114  */
3115 void webkit_settings_set_enable_media_stream(WebKitSettings* settings, gboolean enabled)
3116 {
3117     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
3118
3119     WebKitSettingsPrivate* priv = settings->priv;
3120     bool currentValue = priv->preferences->mediaStreamEnabled();
3121     if (currentValue == enabled)
3122         return;
3123
3124     priv->preferences->setMediaDevicesEnabled(enabled);
3125     priv->preferences->setMediaStreamEnabled(enabled);
3126     priv->preferences->setPeerConnectionEnabled(enabled);
3127     g_object_notify(G_OBJECT(settings), "enable-media-stream");
3128 }
3129
3130 /**
3131  * webkit_settings_set_enable_spatial_navigation:
3132  * @settings: a #WebKitSettings
3133  * @enabled: Value to be set
3134  *
3135  * Set the #WebKitSettings:enable-spatial-navigation property.
3136  *
3137  * Since: 2.2
3138  */
3139 void webkit_settings_set_enable_spatial_navigation(WebKitSettings* settings, gboolean enabled)
3140 {
3141     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
3142
3143     WebKitSettingsPrivate* priv = settings->priv;
3144     bool currentValue = priv->preferences->spatialNavigationEnabled();
3145
3146     if (currentValue == enabled)
3147         return;
3148
3149     priv->preferences->setSpatialNavigationEnabled(enabled);
3150     g_object_notify(G_OBJECT(settings), "enable-spatial-navigation");
3151 }
3152
3153
3154 /**
3155  * webkit_settings_get_enable_spatial_navigation:
3156  * @settings: a #WebKitSettings
3157  *
3158  * Get the #WebKitSettings:enable-spatial-navigation property.
3159  *
3160  * Returns: %TRUE If HTML5 spatial navigation support is enabled or %FALSE otherwise.
3161  *
3162  * Since: 2.2
3163  */
3164 gboolean webkit_settings_get_enable_spatial_navigation(WebKitSettings* settings)
3165 {
3166     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
3167
3168     return settings->priv->preferences->spatialNavigationEnabled();
3169 }
3170
3171 /**
3172  * webkit_settings_get_enable_mediasource:
3173  * @settings: a #WebKitSettings
3174  *
3175  * Get the #WebKitSettings:enable-mediasource property.
3176  *
3177  * Returns: %TRUE If MediaSource support is enabled or %FALSE otherwise.
3178  *
3179  * Since: 2.4
3180  */
3181 gboolean webkit_settings_get_enable_mediasource(WebKitSettings* settings)
3182 {
3183     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
3184
3185     return settings->priv->preferences->mediaSourceEnabled();
3186 }
3187
3188 /**
3189  * webkit_settings_set_enable_mediasource:
3190  * @settings: a #WebKitSettings
3191  * @enabled: Value to be set
3192  *
3193  * Set the #WebKitSettings:enable-mediasource property.
3194  *
3195  * Since: 2.4
3196  */
3197 void webkit_settings_set_enable_mediasource(WebKitSettings* settings, gboolean enabled)
3198 {
3199     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
3200
3201     WebKitSettingsPrivate* priv = settings->priv;
3202     bool currentValue = priv->preferences->mediaSourceEnabled();
3203     if (currentValue == enabled)
3204         return;
3205
3206     priv->preferences->setMediaSourceEnabled(enabled);
3207     g_object_notify(G_OBJECT(settings), "enable-mediasource");
3208 }
3209
3210 /**
3211  * webkit_settings_get_enable_encrypted_media:
3212  * @settings: a #WebKitSettings
3213  *
3214  * Get the #WebKitSettings:enable-encrypted-media property.
3215  *
3216  * Returns: %TRUE if EncryptedMedia support is enabled or %FALSE otherwise.
3217  *
3218  * Since: 2.20
3219  */
3220 gboolean webkit_settings_get_enable_encrypted_media(WebKitSettings* settings)
3221 {
3222     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
3223
3224     return settings->priv->preferences->encryptedMediaAPIEnabled();
3225 }
3226
3227
3228 /**
3229  * webkit_settings_set_enable_encrypted_media:
3230  * @settings: a #WebKitSettings
3231  * @enabled: Value to be set
3232  *
3233  * Set the #WebKitSettings:enable-encrypted-media property.
3234  *
3235  * Since: 2.20
3236  */
3237 void webkit_settings_set_enable_encrypted_media(WebKitSettings* settings, gboolean enabled)
3238 {
3239     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
3240
3241     WebKitSettingsPrivate* priv = settings->priv;
3242     bool currentValue = priv->preferences->encryptedMediaAPIEnabled();
3243     if (currentValue == enabled)
3244         return;
3245
3246     priv->preferences->setEncryptedMediaAPIEnabled(enabled);
3247     g_object_notify(G_OBJECT(settings), "enable-encrypted-media");
3248 }
3249
3250 /**
3251  * webkit_settings_get_enable_media_capabilities:
3252  * @settings: a #WebKitSettings
3253  *
3254  * Get the #WebKitSettings:enable-media-capabilities property.
3255  *
3256  * Returns: %TRUE if MediaCapabilities support is enabled or %FALSE otherwise.
3257  *
3258  * Since: 2.22
3259  */
3260 gboolean webkit_settings_get_enable_media_capabilities(WebKitSettings* settings)
3261 {
3262     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
3263
3264     return settings->priv->preferences->mediaCapabilitiesEnabled();
3265 }
3266
3267
3268 /**
3269  * webkit_settings_set_enable_media_capabilities:
3270  * @settings: a #WebKitSettings
3271  * @enabled: Value to be set
3272  *
3273  * Set the #WebKitSettings:enable-media-capabilities property.
3274  *
3275  * Since: 2.22
3276  */
3277 void webkit_settings_set_enable_media_capabilities(WebKitSettings* settings, gboolean enabled)
3278 {
3279     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
3280
3281     WebKitSettingsPrivate* priv = settings->priv;
3282     bool currentValue = priv->preferences->mediaCapabilitiesEnabled();
3283     if (currentValue == enabled)
3284         return;
3285
3286     priv->preferences->setMediaCapabilitiesEnabled(enabled);
3287     g_object_notify(G_OBJECT(settings), "enable-media-capabilities");
3288 }
3289
3290 /**
3291  * webkit_settings_get_allow_file_access_from_file_urls:
3292  * @settings: a #WebKitSettings
3293  *
3294  * Get the #WebKitSettings:allow-file-access-from-file-urls property.
3295  *
3296  * Returns: %TRUE If file access from file URLs is allowed or %FALSE otherwise.
3297  *
3298  * Since: 2.10
3299  */
3300 gboolean webkit_settings_get_allow_file_access_from_file_urls(WebKitSettings* settings)
3301 {
3302     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
3303
3304     return settings->priv->preferences->allowFileAccessFromFileURLs();
3305 }
3306
3307 /**
3308  * webkit_settings_set_allow_file_access_from_file_urls:
3309  * @settings: a #WebKitSettings
3310  * @allowed: Value to be set
3311  *
3312  * Set the #WebKitSettings:allow-file-access-from-file-urls property.
3313  *
3314  * Since: 2.10
3315  */
3316 void webkit_settings_set_allow_file_access_from_file_urls(WebKitSettings* settings, gboolean allowed)
3317 {
3318     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
3319
3320     WebKitSettingsPrivate* priv = settings->priv;
3321     if (priv->preferences->allowFileAccessFromFileURLs() == allowed)
3322         return;
3323
3324     priv->preferences->setAllowFileAccessFromFileURLs(allowed);
3325     g_object_notify(G_OBJECT(settings), "allow-file-access-from-file-urls");
3326 }
3327
3328 /**
3329  * webkit_settings_get_allow_universal_access_from_file_urls:
3330  * @settings: a #WebKitSettings
3331  *
3332  * Get the #WebKitSettings:allow-universal-access-from-file-urls property.
3333  *
3334  * Returns: %TRUE If universal access from file URLs is allowed or %FALSE otherwise.
3335  *
3336  * Since: 2.14
3337  */
3338 gboolean webkit_settings_get_allow_universal_access_from_file_urls(WebKitSettings* settings)
3339 {
3340     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
3341
3342     return settings->priv->preferences->allowUniversalAccessFromFileURLs();
3343 }
3344
3345 /**
3346  * webkit_settings_set_allow_universal_access_from_file_urls:
3347  * @settings: a #WebKitSettings
3348  * @allowed: Value to be set
3349  *
3350  * Set the #WebKitSettings:allow-universal-access-from-file-urls property.
3351  *
3352  * Since: 2.14
3353  */
3354 void webkit_settings_set_allow_universal_access_from_file_urls(WebKitSettings* settings, gboolean allowed)
3355 {
3356     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
3357
3358     WebKitSettingsPrivate* priv = settings->priv;
3359     if (priv->preferences->allowUniversalAccessFromFileURLs() == allowed)
3360         return;
3361
3362     priv->preferences->setAllowUniversalAccessFromFileURLs(allowed);
3363     g_object_notify(G_OBJECT(settings), "allow-universal-access-from-file-urls");
3364 }
3365
3366 #if PLATFORM(GTK)
3367 /**
3368  * webkit_settings_get_hardware_acceleration_policy:
3369  * @settings: a #WebKitSettings
3370  *
3371  * Get the #WebKitSettings:hardware-acceleration-policy property.
3372  *
3373  * Return: a #WebKitHardwareAccelerationPolicy
3374  *
3375  * Since: 2.16
3376  */
3377 WebKitHardwareAccelerationPolicy webkit_settings_get_hardware_acceleration_policy(WebKitSettings* settings)
3378 {
3379     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), WEBKIT_HARDWARE_ACCELERATION_POLICY_ON_DEMAND);
3380
3381     WebKitSettingsPrivate* priv = settings->priv;
3382     if (!priv->preferences->acceleratedCompositingEnabled())
3383         return WEBKIT_HARDWARE_ACCELERATION_POLICY_NEVER;
3384
3385     if (priv->preferences->forceCompositingMode())
3386         return WEBKIT_HARDWARE_ACCELERATION_POLICY_ALWAYS;
3387
3388     return WEBKIT_HARDWARE_ACCELERATION_POLICY_ON_DEMAND;
3389 }
3390
3391 /**
3392  * webkit_settings_set_hardware_acceleration_policy:
3393  * @settings: a #WebKitSettings
3394  * @policy: a #WebKitHardwareAccelerationPolicy
3395  *
3396  * Set the #WebKitSettings:hardware-acceleration-policy property.
3397  *
3398  * Since: 2.16
3399  */
3400 void webkit_settings_set_hardware_acceleration_policy(WebKitSettings* settings, WebKitHardwareAccelerationPolicy policy)
3401 {
3402     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
3403
3404     WebKitSettingsPrivate* priv = settings->priv;
3405     bool changed = false;
3406     switch (policy) {
3407     case WEBKIT_HARDWARE_ACCELERATION_POLICY_ALWAYS:
3408         if (!HardwareAccelerationManager::singleton().canUseHardwareAcceleration())
3409             return;
3410         if (!priv->preferences->acceleratedCompositingEnabled()) {
3411             priv->preferences->setAcceleratedCompositingEnabled(true);
3412             changed = true;
3413         }
3414         if (!priv->preferences->forceCompositingMode()) {
3415             priv->preferences->setForceCompositingMode(true);
3416             changed = true;
3417         }
3418         break;
3419     case WEBKIT_HARDWARE_ACCELERATION_POLICY_NEVER:
3420         if (HardwareAccelerationManager::singleton().forceHardwareAcceleration())
3421             return;
3422         if (priv->preferences->acceleratedCompositingEnabled()) {
3423             priv->preferences->setAcceleratedCompositingEnabled(false);
3424             changed = true;
3425         }
3426
3427         if (priv->preferences->forceCompositingMode()) {
3428             priv->preferences->setForceCompositingMode(false);
3429             changed = true;
3430         }
3431         break;
3432     case WEBKIT_HARDWARE_ACCELERATION_POLICY_ON_DEMAND:
3433         if (!priv->preferences->acceleratedCompositingEnabled() && HardwareAccelerationManager::singleton().canUseHardwareAcceleration()) {
3434             priv->preferences->setAcceleratedCompositingEnabled(true);
3435             changed = true;
3436         }
3437
3438         if (priv->preferences->forceCompositingMode() && !HardwareAccelerationManager::singleton().forceHardwareAcceleration()) {
3439             priv->preferences->setForceCompositingMode(false);
3440             changed = true;
3441         }
3442         break;
3443     }
3444
3445     if (changed)
3446         g_object_notify(G_OBJECT(settings), "hardware-acceleration-policy");
3447 }
3448
3449 /**
3450  * webkit_settings_font_size_to_points:
3451  * @pixels: the font size in pixels to convert to points
3452  *
3453  * Convert @pixels to the equivalent value in points, based on the current
3454  * screen DPI. Applications can use this function to convert font size values
3455  * in pixels to font size values in points when getting the font size properties
3456  * of #WebKitSettings.
3457  *
3458  * Returns: the equivalent font size in points.
3459  *
3460  * Since: 2.20
3461  */
3462 guint32 webkit_settings_font_size_to_points(guint32 pixels)
3463 {
3464     return std::round(pixels * 72 / WebCore::screenDPI());
3465 }
3466
3467 /**
3468  * webkit_settings_font_size_to_pixels:
3469  * @points: the font size in points to convert to pixels
3470  *
3471  * Convert @points to the equivalent value in pixels, based on the current
3472  * screen DPI. Applications can use this function to convert font size values
3473  * in points to font size values in pixels when setting the font size properties
3474  * of #WebKitSettings.
3475  *
3476  * Returns: the equivalent font size in pixels.
3477  *
3478  * Since: 2.20
3479  */
3480 guint32 webkit_settings_font_size_to_pixels(guint32 points)
3481 {
3482     return std::round(points * WebCore::screenDPI() / 72);
3483 }
3484 #endif // PLATFORM(GTK)