Replace WebRTCLegacyAPIDisabled by WebRTCLegacyAPIEnabled and switch off WebRTC legac...
[WebKit-https.git] / Source / WebKit / UIProcess / API / C / WKPreferences.cpp
1 /*
2  * Copyright (C) 2010-2016 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #include "config.h"
27
28 #include "WKPreferencesRef.h"
29 #include "WKPreferencesRefPrivate.h"
30 #include "WKAPICast.h"
31 #include "WebPreferences.h"
32 #include <WebCore/Settings.h>
33 #include <wtf/RefPtr.h>
34
35 #if ENABLE(APPLE_PAY)
36 #include "WebPaymentCoordinatorProxy.h"
37 #endif
38
39 using namespace WebKit;
40
41 WKTypeID WKPreferencesGetTypeID()
42 {
43     return toAPI(WebPreferences::APIType);
44 }
45
46 WKPreferencesRef WKPreferencesCreate()
47 {
48     auto preferences = WebPreferences::createWithLegacyDefaults(String(), "WebKit2.", "WebKit2.");
49     return toAPI(&preferences.leakRef());
50 }
51
52 WKPreferencesRef WKPreferencesCreateWithIdentifier(WKStringRef identifierRef)
53 {
54     auto preferences = WebPreferences::createWithLegacyDefaults(toWTFString(identifierRef), "WebKit2.", "WebKit2.");
55     return toAPI(&preferences.leakRef());
56 }
57
58 WKPreferencesRef WKPreferencesCreateCopy(WKPreferencesRef preferencesRef)
59 {
60     auto preferences = toImpl(preferencesRef)->copy();
61     return toAPI(&preferences.leakRef());
62 }
63
64 void WKPreferencesEnableAllExperimentalFeatures(WKPreferencesRef preferencesRef)
65 {
66     toImpl(preferencesRef)->enableAllExperimentalFeatures();
67 }
68
69 void WKPreferencesSetJavaScriptEnabled(WKPreferencesRef preferencesRef, bool javaScriptEnabled)
70 {
71     toImpl(preferencesRef)->setJavaScriptEnabled(javaScriptEnabled);
72 }
73
74 bool WKPreferencesGetJavaScriptEnabled(WKPreferencesRef preferencesRef)
75 {
76     return toImpl(preferencesRef)->javaScriptEnabled();
77 }
78
79 void WKPreferencesSetJavaScriptMarkupEnabled(WKPreferencesRef preferencesRef, bool javaScriptMarkupEnabled)
80 {
81     toImpl(preferencesRef)->setJavaScriptMarkupEnabled(javaScriptMarkupEnabled);
82 }
83
84 bool WKPreferencesGetJavaScriptMarkupEnabled(WKPreferencesRef preferencesRef)
85 {
86     return toImpl(preferencesRef)->javaScriptMarkupEnabled();
87 }
88
89 void WKPreferencesSetLoadsImagesAutomatically(WKPreferencesRef preferencesRef, bool loadsImagesAutomatically)
90 {
91     toImpl(preferencesRef)->setLoadsImagesAutomatically(loadsImagesAutomatically);
92 }
93
94 bool WKPreferencesGetLoadsImagesAutomatically(WKPreferencesRef preferencesRef)
95 {
96     return toImpl(preferencesRef)->loadsImagesAutomatically();
97 }
98
99 void WKPreferencesSetLoadsSiteIconsIgnoringImageLoadingPreference(WKPreferencesRef preferencesRef, bool loadsSiteIconsIgnoringImageLoadingPreference)
100 {
101     toImpl(preferencesRef)->setLoadsSiteIconsIgnoringImageLoadingPreference(loadsSiteIconsIgnoringImageLoadingPreference);
102 }
103
104 bool WKPreferencesGetLoadsSiteIconsIgnoringImageLoadingPreference(WKPreferencesRef preferencesRef)
105 {
106     return toImpl(preferencesRef)->loadsSiteIconsIgnoringImageLoadingPreference();
107 }
108
109 void WKPreferencesSetOfflineWebApplicationCacheEnabled(WKPreferencesRef preferencesRef, bool offlineWebApplicationCacheEnabled)
110 {
111     toImpl(preferencesRef)->setOfflineWebApplicationCacheEnabled(offlineWebApplicationCacheEnabled);
112 }
113
114 bool WKPreferencesGetOfflineWebApplicationCacheEnabled(WKPreferencesRef preferencesRef)
115 {
116     return toImpl(preferencesRef)->offlineWebApplicationCacheEnabled();
117 }
118
119 void WKPreferencesSetLocalStorageEnabled(WKPreferencesRef preferencesRef, bool localStorageEnabled)
120 {
121     toImpl(preferencesRef)->setLocalStorageEnabled(localStorageEnabled);
122 }
123
124 bool WKPreferencesGetLocalStorageEnabled(WKPreferencesRef preferencesRef)
125 {
126     return toImpl(preferencesRef)->localStorageEnabled();
127 }
128
129 void WKPreferencesSetDatabasesEnabled(WKPreferencesRef preferencesRef, bool databasesEnabled)
130 {
131     toImpl(preferencesRef)->setDatabasesEnabled(databasesEnabled);
132 }
133
134 bool WKPreferencesGetDatabasesEnabled(WKPreferencesRef preferencesRef)
135 {
136     return toImpl(preferencesRef)->databasesEnabled();
137 }
138
139 void WKPreferencesSetXSSAuditorEnabled(WKPreferencesRef preferencesRef, bool xssAuditorEnabled)
140 {
141     toImpl(preferencesRef)->setXSSAuditorEnabled(xssAuditorEnabled);
142 }
143
144 bool WKPreferencesGetXSSAuditorEnabled(WKPreferencesRef preferencesRef)
145 {
146     return toImpl(preferencesRef)->xssAuditorEnabled();
147 }
148
149 void WKPreferencesSetFrameFlatteningEnabled(WKPreferencesRef preferencesRef, bool frameFlatteningEnabled)
150 {
151     // FIXME: Expose more frame flattening values.
152     toImpl(preferencesRef)->setFrameFlattening(frameFlatteningEnabled ? static_cast<uint32_t>(WebCore::FrameFlattening::FullyEnabled) : static_cast<uint32_t>(WebCore::FrameFlattening::Disabled));
153 }
154
155 bool WKPreferencesGetFrameFlatteningEnabled(WKPreferencesRef preferencesRef)
156 {
157     // FIXME: Expose more frame flattening values.
158     return toImpl(preferencesRef)->frameFlattening() != static_cast<uint32_t>(WebCore::FrameFlattening::Disabled);
159 }
160
161 void WKPreferencesSetPluginsEnabled(WKPreferencesRef preferencesRef, bool pluginsEnabled)
162 {
163     toImpl(preferencesRef)->setPluginsEnabled(pluginsEnabled);
164 }
165
166 bool WKPreferencesGetPluginsEnabled(WKPreferencesRef preferencesRef)
167 {
168     return toImpl(preferencesRef)->pluginsEnabled();
169 }
170
171 void WKPreferencesSetJavaEnabled(WKPreferencesRef preferencesRef, bool javaEnabled)
172 {
173     toImpl(preferencesRef)->setJavaEnabled(javaEnabled);
174 }
175
176 bool WKPreferencesGetJavaEnabled(WKPreferencesRef preferencesRef)
177 {
178     return toImpl(preferencesRef)->javaEnabled();
179 }
180
181 void WKPreferencesSetJavaEnabledForLocalFiles(WKPreferencesRef preferencesRef, bool javaEnabledForLocalFiles)
182 {
183     toImpl(preferencesRef)->setJavaEnabledForLocalFiles(javaEnabledForLocalFiles);
184 }
185
186 bool WKPreferencesGetJavaEnabledForLocalFiles(WKPreferencesRef preferencesRef)
187 {
188     return toImpl(preferencesRef)->javaEnabledForLocalFiles();
189 }
190
191 void WKPreferencesSetJavaScriptCanOpenWindowsAutomatically(WKPreferencesRef preferencesRef, bool javaScriptCanOpenWindowsAutomatically)
192 {
193     toImpl(preferencesRef)->setJavaScriptCanOpenWindowsAutomatically(javaScriptCanOpenWindowsAutomatically);
194 }
195
196 bool WKPreferencesGetJavaScriptCanOpenWindowsAutomatically(WKPreferencesRef preferencesRef)
197 {
198     return toImpl(preferencesRef)->javaScriptCanOpenWindowsAutomatically();
199 }
200
201 void WKPreferencesSetHyperlinkAuditingEnabled(WKPreferencesRef preferencesRef, bool hyperlinkAuditingEnabled)
202 {
203     toImpl(preferencesRef)->setHyperlinkAuditingEnabled(hyperlinkAuditingEnabled);
204 }
205
206 bool WKPreferencesGetHyperlinkAuditingEnabled(WKPreferencesRef preferencesRef)
207 {
208     return toImpl(preferencesRef)->hyperlinkAuditingEnabled();
209 }
210
211 void WKPreferencesSetStandardFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
212 {
213     toImpl(preferencesRef)->setStandardFontFamily(toWTFString(family));
214 }
215
216 WKStringRef WKPreferencesCopyStandardFontFamily(WKPreferencesRef preferencesRef)
217 {
218     return toCopiedAPI(toImpl(preferencesRef)->standardFontFamily());
219 }
220
221 void WKPreferencesSetFixedFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
222 {
223     toImpl(preferencesRef)->setFixedFontFamily(toWTFString(family));
224 }
225
226 WKStringRef WKPreferencesCopyFixedFontFamily(WKPreferencesRef preferencesRef)
227 {
228     return toCopiedAPI(toImpl(preferencesRef)->fixedFontFamily());
229 }
230
231 void WKPreferencesSetSerifFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
232 {
233     toImpl(preferencesRef)->setSerifFontFamily(toWTFString(family));
234 }
235
236 WKStringRef WKPreferencesCopySerifFontFamily(WKPreferencesRef preferencesRef)
237 {
238     return toCopiedAPI(toImpl(preferencesRef)->serifFontFamily());
239 }
240
241 void WKPreferencesSetSansSerifFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
242 {
243     toImpl(preferencesRef)->setSansSerifFontFamily(toWTFString(family));
244 }
245
246 WKStringRef WKPreferencesCopySansSerifFontFamily(WKPreferencesRef preferencesRef)
247 {
248     return toCopiedAPI(toImpl(preferencesRef)->sansSerifFontFamily());
249 }
250
251 void WKPreferencesSetCursiveFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
252 {
253     toImpl(preferencesRef)->setCursiveFontFamily(toWTFString(family));
254 }
255
256 WKStringRef WKPreferencesCopyCursiveFontFamily(WKPreferencesRef preferencesRef)
257 {
258     return toCopiedAPI(toImpl(preferencesRef)->cursiveFontFamily());
259 }
260
261 void WKPreferencesSetFantasyFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
262 {
263     toImpl(preferencesRef)->setFantasyFontFamily(toWTFString(family));
264 }
265
266 WKStringRef WKPreferencesCopyFantasyFontFamily(WKPreferencesRef preferencesRef)
267 {
268     return toCopiedAPI(toImpl(preferencesRef)->fantasyFontFamily());
269 }
270
271 void WKPreferencesSetPictographFontFamily(WKPreferencesRef preferencesRef, WKStringRef family)
272 {
273     toImpl(preferencesRef)->setPictographFontFamily(toWTFString(family));
274 }
275
276 WKStringRef WKPreferencesCopyPictographFontFamily(WKPreferencesRef preferencesRef)
277 {
278     return toCopiedAPI(toImpl(preferencesRef)->pictographFontFamily());
279 }
280
281 void WKPreferencesSetDefaultFontSize(WKPreferencesRef preferencesRef, uint32_t size)
282 {
283     toImpl(preferencesRef)->setDefaultFontSize(size);
284 }
285
286 uint32_t WKPreferencesGetDefaultFontSize(WKPreferencesRef preferencesRef)
287 {
288     return toImpl(preferencesRef)->defaultFontSize();
289 }
290
291 void WKPreferencesSetDefaultFixedFontSize(WKPreferencesRef preferencesRef, uint32_t size)
292 {
293     toImpl(preferencesRef)->setDefaultFixedFontSize(size);
294 }
295
296 uint32_t WKPreferencesGetDefaultFixedFontSize(WKPreferencesRef preferencesRef)
297 {
298     return toImpl(preferencesRef)->defaultFixedFontSize();
299 }
300
301 void WKPreferencesSetMinimumFontSize(WKPreferencesRef preferencesRef, uint32_t size)
302 {
303     toImpl(preferencesRef)->setMinimumFontSize(size);
304 }
305
306 uint32_t WKPreferencesGetMinimumFontSize(WKPreferencesRef preferencesRef)
307 {
308     return toImpl(preferencesRef)->minimumFontSize();
309 }
310
311
312 void WKPreferencesSetCookieEnabled(WKPreferencesRef preferencesRef, bool enabled)
313 {
314     toImpl(preferencesRef)->setCookieEnabled(enabled);
315 }
316
317 bool WKPreferencesGetCookieEnabled(WKPreferencesRef preferencesRef)
318 {
319     return toImpl(preferencesRef)->cookieEnabled();
320 }
321
322 void WKPreferencesSetEditableLinkBehavior(WKPreferencesRef preferencesRef, WKEditableLinkBehavior wkBehavior)
323 {
324     toImpl(preferencesRef)->setEditableLinkBehavior(toEditableLinkBehavior(wkBehavior));
325 }
326
327 WKEditableLinkBehavior WKPreferencesGetEditableLinkBehavior(WKPreferencesRef preferencesRef)
328 {
329     return toAPI(static_cast<WebCore::EditableLinkBehavior>(toImpl(preferencesRef)->editableLinkBehavior()));
330 }
331
332 void WKPreferencesSetDefaultTextEncodingName(WKPreferencesRef preferencesRef, WKStringRef name)
333 {
334     toImpl(preferencesRef)->setDefaultTextEncodingName(toWTFString(name));
335 }
336
337 WKStringRef WKPreferencesCopyDefaultTextEncodingName(WKPreferencesRef preferencesRef)
338 {
339     return toCopiedAPI(toImpl(preferencesRef)->defaultTextEncodingName());
340 }
341
342 void WKPreferencesSetPrivateBrowsingEnabled(WKPreferencesRef preferencesRef, bool enabled)
343 {
344     toImpl(preferencesRef)->setPrivateBrowsingEnabled(enabled);
345 }
346
347 bool WKPreferencesGetPrivateBrowsingEnabled(WKPreferencesRef preferencesRef)
348 {
349     return toImpl(preferencesRef)->privateBrowsingEnabled();
350 }
351
352 void WKPreferencesSetDeveloperExtrasEnabled(WKPreferencesRef preferencesRef, bool enabled)
353 {
354     toImpl(preferencesRef)->setDeveloperExtrasEnabled(enabled);
355 }
356
357 bool WKPreferencesGetDeveloperExtrasEnabled(WKPreferencesRef preferencesRef)
358 {
359     return toImpl(preferencesRef)->developerExtrasEnabled();
360 }
361
362 void WKPreferencesSetJavaScriptRuntimeFlags(WKPreferencesRef preferencesRef, WKJavaScriptRuntimeFlagSet javaScriptRuntimeFlagSet)
363 {
364     toImpl(preferencesRef)->setJavaScriptRuntimeFlags(javaScriptRuntimeFlagSet);
365 }
366
367 WKJavaScriptRuntimeFlagSet WKPreferencesGetJavaScriptRuntimeFlags(WKPreferencesRef preferencesRef)
368 {
369     return toImpl(preferencesRef)->javaScriptRuntimeFlags();
370 }
371
372 void WKPreferencesSetTextAreasAreResizable(WKPreferencesRef preferencesRef, bool resizable)
373 {
374     toImpl(preferencesRef)->setTextAreasAreResizable(resizable);
375 }
376
377 bool WKPreferencesGetTextAreasAreResizable(WKPreferencesRef preferencesRef)
378 {
379     return toImpl(preferencesRef)->textAreasAreResizable();
380 }
381
382 void WKPreferencesSetFontSmoothingLevel(WKPreferencesRef preferencesRef, WKFontSmoothingLevel wkLevel)
383 {
384     toImpl(preferencesRef)->setFontSmoothingLevel(toFontSmoothingLevel(wkLevel));
385 }
386
387 WKFontSmoothingLevel WKPreferencesGetFontSmoothingLevel(WKPreferencesRef preferencesRef)
388 {
389     return toAPI(static_cast<FontSmoothingLevel>(toImpl(preferencesRef)->fontSmoothingLevel()));
390 }
391
392 void WKPreferencesSetSubpixelAntialiasedLayerTextEnabled(WKPreferencesRef preferencesRef, bool flag)
393 {
394     toImpl(preferencesRef)->setSubpixelAntialiasedLayerTextEnabled(flag);
395 }
396
397 bool WKPreferencesGetSubpixelAntialiasedLayerTextEnabled(WKPreferencesRef preferencesRef)
398 {
399     return toImpl(preferencesRef)->subpixelAntialiasedLayerTextEnabled();
400 }
401
402 void WKPreferencesSetAcceleratedDrawingEnabled(WKPreferencesRef preferencesRef, bool flag)
403 {
404     toImpl(preferencesRef)->setAcceleratedDrawingEnabled(flag);
405 }
406
407 bool WKPreferencesGetAcceleratedDrawingEnabled(WKPreferencesRef preferencesRef)
408 {
409     return toImpl(preferencesRef)->acceleratedDrawingEnabled();
410 }
411
412 void WKPreferencesSetCanvasUsesAcceleratedDrawing(WKPreferencesRef preferencesRef, bool flag)
413 {
414     toImpl(preferencesRef)->setCanvasUsesAcceleratedDrawing(flag);
415 }
416
417 bool WKPreferencesGetCanvasUsesAcceleratedDrawing(WKPreferencesRef preferencesRef)
418 {
419     return toImpl(preferencesRef)->canvasUsesAcceleratedDrawing();
420 }
421
422 void WKPreferencesSetAcceleratedCompositingEnabled(WKPreferencesRef preferencesRef, bool flag)
423 {
424     toImpl(preferencesRef)->setAcceleratedCompositingEnabled(flag);
425 }
426
427 bool WKPreferencesGetAcceleratedCompositingEnabled(WKPreferencesRef preferencesRef)
428 {
429     return toImpl(preferencesRef)->acceleratedCompositingEnabled();
430 }
431
432 void WKPreferencesSetAcceleratedCompositingForOverflowScrollEnabled(WKPreferencesRef preferencesRef, bool flag)
433 {
434     toImpl(preferencesRef)->setAcceleratedCompositingForOverflowScrollEnabled(flag);
435 }
436
437 bool WKPreferencesGetAcceleratedCompositingForOverflowScrollEnabled(WKPreferencesRef preferencesRef)
438 {
439     return toImpl(preferencesRef)->acceleratedCompositingForOverflowScrollEnabled();
440 }
441
442 void WKPreferencesSetCompositingBordersVisible(WKPreferencesRef preferencesRef, bool flag)
443 {
444     toImpl(preferencesRef)->setCompositingBordersVisible(flag);
445 }
446
447 bool WKPreferencesGetCompositingBordersVisible(WKPreferencesRef preferencesRef)
448 {
449     return toImpl(preferencesRef)->compositingBordersVisible();
450 }
451
452 void WKPreferencesSetCompositingRepaintCountersVisible(WKPreferencesRef preferencesRef, bool flag)
453 {
454     toImpl(preferencesRef)->setCompositingRepaintCountersVisible(flag);
455 }
456
457 bool WKPreferencesGetCompositingRepaintCountersVisible(WKPreferencesRef preferencesRef)
458 {
459     return toImpl(preferencesRef)->compositingRepaintCountersVisible();
460 }
461
462 void WKPreferencesSetTiledScrollingIndicatorVisible(WKPreferencesRef preferencesRef, bool flag)
463 {
464     toImpl(preferencesRef)->setTiledScrollingIndicatorVisible(flag);
465 }
466
467 bool WKPreferencesGetTiledScrollingIndicatorVisible(WKPreferencesRef preferencesRef)
468 {
469     return toImpl(preferencesRef)->tiledScrollingIndicatorVisible();
470 }
471
472 void WKPreferencesSetWebGLEnabled(WKPreferencesRef preferencesRef, bool flag)
473 {
474     toImpl(preferencesRef)->setWebGLEnabled(flag);
475 }
476
477 bool WKPreferencesGetWebGLEnabled(WKPreferencesRef preferencesRef)
478 {
479     return toImpl(preferencesRef)->webGLEnabled();
480 }
481
482 void WKPreferencesSetForceSoftwareWebGLRendering(WKPreferencesRef preferencesRef, bool flag)
483 {
484     toImpl(preferencesRef)->setForceSoftwareWebGLRendering(flag);
485 }
486
487 bool WKPreferencesGetForceSoftwareWebGLRendering(WKPreferencesRef preferencesRef)
488 {
489     return toImpl(preferencesRef)->forceSoftwareWebGLRendering();
490 }
491
492 void WKPreferencesSetAccelerated2DCanvasEnabled(WKPreferencesRef preferencesRef, bool flag)
493 {
494     toImpl(preferencesRef)->setAccelerated2dCanvasEnabled(flag);
495 }
496
497 bool WKPreferencesGetAccelerated2DCanvasEnabled(WKPreferencesRef preferencesRef)
498 {
499     return toImpl(preferencesRef)->accelerated2dCanvasEnabled();
500 }
501
502 void WKPreferencesSetCSSAnimationTriggersEnabled(WKPreferencesRef preferencesRef, bool flag)
503 {
504     toImpl(preferencesRef)->setCSSAnimationTriggersEnabled(flag);
505 }
506
507 bool WKPreferencesGetCSSAnimationTriggersEnabled(WKPreferencesRef preferencesRef)
508 {
509     return toImpl(preferencesRef)->cssAnimationTriggersEnabled();
510 }
511
512 void WKPreferencesSetWebAnimationsEnabled(WKPreferencesRef preferencesRef, bool flag)
513 {
514     toImpl(preferencesRef)->setWebAnimationsEnabled(flag);
515 }
516
517 bool WKPreferencesGetWebAnimationsEnabled(WKPreferencesRef preferencesRef)
518 {
519     return toImpl(preferencesRef)->webAnimationsEnabled();
520 }
521
522 void WKPreferencesSetNeedsSiteSpecificQuirks(WKPreferencesRef preferencesRef, bool flag)
523 {
524     toImpl(preferencesRef)->setNeedsSiteSpecificQuirks(flag);
525 }
526
527 bool WKPreferencesUseLegacyTextAlignPositionedElementBehavior(WKPreferencesRef preferencesRef)
528 {
529     return toImpl(preferencesRef)->useLegacyTextAlignPositionedElementBehavior();
530 }
531
532 void WKPreferencesSetUseLegacyTextAlignPositionedElementBehavior(WKPreferencesRef preferencesRef, bool flag)
533 {
534     toImpl(preferencesRef)->setUseLegacyTextAlignPositionedElementBehavior(flag);
535 }
536
537 bool WKPreferencesGetNeedsSiteSpecificQuirks(WKPreferencesRef preferencesRef)
538 {
539     return toImpl(preferencesRef)->needsSiteSpecificQuirks();
540 }
541
542 void WKPreferencesSetForceFTPDirectoryListings(WKPreferencesRef preferencesRef, bool flag)
543 {
544     toImpl(preferencesRef)->setForceFTPDirectoryListings(flag);
545 }
546
547 bool WKPreferencesGetForceFTPDirectoryListings(WKPreferencesRef preferencesRef)
548 {
549     return toImpl(preferencesRef)->forceFTPDirectoryListings();
550 }
551
552 void WKPreferencesSetFTPDirectoryTemplatePath(WKPreferencesRef preferencesRef, WKStringRef pathRef)
553 {
554     toImpl(preferencesRef)->setFTPDirectoryTemplatePath(toWTFString(pathRef));
555 }
556
557 WKStringRef WKPreferencesCopyFTPDirectoryTemplatePath(WKPreferencesRef preferencesRef)
558 {
559     return toCopiedAPI(toImpl(preferencesRef)->ftpDirectoryTemplatePath());
560 }
561
562 void WKPreferencesSetTabsToLinks(WKPreferencesRef preferencesRef, bool tabsToLinks)
563 {
564     toImpl(preferencesRef)->setTabsToLinks(tabsToLinks);
565 }
566
567 bool WKPreferencesGetTabsToLinks(WKPreferencesRef preferencesRef)
568 {
569     return toImpl(preferencesRef)->tabsToLinks();
570 }
571
572 void WKPreferencesSetDNSPrefetchingEnabled(WKPreferencesRef preferencesRef, bool enabled)
573 {
574     toImpl(preferencesRef)->setDNSPrefetchingEnabled(enabled);
575 }
576
577 bool WKPreferencesGetDNSPrefetchingEnabled(WKPreferencesRef preferencesRef)
578 {
579     return toImpl(preferencesRef)->dnsPrefetchingEnabled();
580 }
581
582 void WKPreferencesSetAuthorAndUserStylesEnabled(WKPreferencesRef preferencesRef, bool enabled)
583 {
584     toImpl(preferencesRef)->setAuthorAndUserStylesEnabled(enabled);
585 }
586
587 bool WKPreferencesGetAuthorAndUserStylesEnabled(WKPreferencesRef preferencesRef)
588 {
589     return toImpl(preferencesRef)->authorAndUserStylesEnabled();
590 }
591
592 void WKPreferencesSetShouldPrintBackgrounds(WKPreferencesRef preferencesRef, bool flag)
593 {
594     toImpl(preferencesRef)->setShouldPrintBackgrounds(flag);
595 }
596
597 bool WKPreferencesGetShouldPrintBackgrounds(WKPreferencesRef preferencesRef)
598 {
599     return toImpl(preferencesRef)->shouldPrintBackgrounds();
600 }
601
602 void WKPreferencesSetDOMTimersThrottlingEnabled(WKPreferencesRef preferencesRef, bool enabled)
603 {
604     toImpl(preferencesRef)->setDOMTimersThrottlingEnabled(enabled);
605 }
606
607 bool WKPreferencesGetDOMTimersThrottlingEnabled(WKPreferencesRef preferencesRef)
608 {
609     return toImpl(preferencesRef)->domTimersThrottlingEnabled();
610 }
611
612 void WKPreferencesSetWebArchiveDebugModeEnabled(WKPreferencesRef preferencesRef, bool enabled)
613 {
614     toImpl(preferencesRef)->setWebArchiveDebugModeEnabled(enabled);
615 }
616
617 bool WKPreferencesGetWebArchiveDebugModeEnabled(WKPreferencesRef preferencesRef)
618 {
619     return toImpl(preferencesRef)->webArchiveDebugModeEnabled();
620 }
621
622 void WKPreferencesSetLocalFileContentSniffingEnabled(WKPreferencesRef preferencesRef, bool enabled)
623 {
624     toImpl(preferencesRef)->setLocalFileContentSniffingEnabled(enabled);
625 }
626
627 bool WKPreferencesGetLocalFileContentSniffingEnabled(WKPreferencesRef preferencesRef)
628 {
629     return toImpl(preferencesRef)->localFileContentSniffingEnabled();
630 }
631
632 void WKPreferencesSetPageCacheEnabled(WKPreferencesRef preferencesRef, bool enabled)
633 {
634     toImpl(preferencesRef)->setUsesPageCache(enabled);
635 }
636
637 bool WKPreferencesGetPageCacheEnabled(WKPreferencesRef preferencesRef)
638 {
639     return toImpl(preferencesRef)->usesPageCache();
640 }
641
642 void WKPreferencesSetPageCacheSupportsPlugins(WKPreferencesRef preferencesRef, bool pageCacheSupportsPlugins)
643 {
644     toImpl(preferencesRef)->setPageCacheSupportsPlugins(pageCacheSupportsPlugins);
645 }
646
647 bool WKPreferencesGetPageCacheSupportsPlugins(WKPreferencesRef preferencesRef)
648 {
649     return toImpl(preferencesRef)->pageCacheSupportsPlugins();
650 }
651
652 void WKPreferencesSetPaginateDuringLayoutEnabled(WKPreferencesRef preferencesRef, bool enabled)
653 {
654     toImpl(preferencesRef)->setPaginateDuringLayoutEnabled(enabled);
655 }
656
657 bool WKPreferencesGetPaginateDuringLayoutEnabled(WKPreferencesRef preferencesRef)
658 {
659     return toImpl(preferencesRef)->paginateDuringLayoutEnabled();
660 }
661
662 void WKPreferencesSetDOMPasteAllowed(WKPreferencesRef preferencesRef, bool enabled)
663 {
664     toImpl(preferencesRef)->setDOMPasteAllowed(enabled);
665 }
666
667 bool WKPreferencesGetDOMPasteAllowed(WKPreferencesRef preferencesRef)
668 {
669     return toImpl(preferencesRef)->domPasteAllowed();
670 }
671
672 void WKPreferencesSetJavaScriptCanAccessClipboard(WKPreferencesRef preferencesRef, bool enabled)
673 {
674     toImpl(preferencesRef)->setJavaScriptCanAccessClipboard(enabled);
675 }
676
677 bool WKPreferencesGetJavaScriptCanAccessClipboard(WKPreferencesRef preferencesRef)
678 {
679     return toImpl(preferencesRef)->javaScriptCanAccessClipboard();
680 }
681
682 void WKPreferencesSetFullScreenEnabled(WKPreferencesRef preferencesRef, bool enabled)
683 {
684     toImpl(preferencesRef)->setFullScreenEnabled(enabled);
685 }
686
687 bool WKPreferencesGetFullScreenEnabled(WKPreferencesRef preferencesRef)
688 {
689     return toImpl(preferencesRef)->fullScreenEnabled();
690 }
691
692 void WKPreferencesSetAsynchronousSpellCheckingEnabled(WKPreferencesRef preferencesRef, bool enabled)
693 {
694     toImpl(preferencesRef)->setAsynchronousSpellCheckingEnabled(enabled);
695 }
696
697 bool WKPreferencesGetAsynchronousSpellCheckingEnabled(WKPreferencesRef preferencesRef)
698 {
699     return toImpl(preferencesRef)->asynchronousSpellCheckingEnabled();
700 }
701
702 void WKPreferencesSetAVFoundationEnabled(WKPreferencesRef preferencesRef, bool enabled)
703 {
704     toImpl(preferencesRef)->setAVFoundationEnabled(enabled);
705 }
706
707 bool WKPreferencesGetAVFoundationEnabled(WKPreferencesRef preferencesRef)
708 {
709     return toImpl(preferencesRef)->isAVFoundationEnabled();
710 }
711
712 void WKPreferencesSetAVFoundationNSURLSessionEnabled(WKPreferencesRef preferencesRef, bool enabled)
713 {
714     toImpl(preferencesRef)->setAVFoundationNSURLSessionEnabled(enabled);
715 }
716
717 bool WKPreferencesGetAVFoundationNSURLSessionEnabled(WKPreferencesRef preferencesRef)
718 {
719     return toImpl(preferencesRef)->isAVFoundationNSURLSessionEnabled();
720 }
721
722 void WKPreferencesSetWebSecurityEnabled(WKPreferencesRef preferencesRef, bool enabled)
723 {
724     toImpl(preferencesRef)->setWebSecurityEnabled(enabled);
725 }
726
727 bool WKPreferencesGetWebSecurityEnabled(WKPreferencesRef preferencesRef)
728 {
729     return toImpl(preferencesRef)->webSecurityEnabled();
730 }
731
732 void WKPreferencesSetUniversalAccessFromFileURLsAllowed(WKPreferencesRef preferencesRef, bool allowed)
733 {
734     toImpl(preferencesRef)->setAllowUniversalAccessFromFileURLs(allowed);
735 }
736
737 bool WKPreferencesGetUniversalAccessFromFileURLsAllowed(WKPreferencesRef preferencesRef)
738 {
739     return toImpl(preferencesRef)->allowUniversalAccessFromFileURLs();
740 }
741
742 void WKPreferencesSetFileAccessFromFileURLsAllowed(WKPreferencesRef preferencesRef, bool allowed)
743 {
744     toImpl(preferencesRef)->setAllowFileAccessFromFileURLs(allowed);
745 }
746
747 bool WKPreferencesGetFileAccessFromFileURLsAllowed(WKPreferencesRef preferencesRef)
748 {
749     return toImpl(preferencesRef)->allowFileAccessFromFileURLs();
750 }
751
752 void WKPreferencesSetNeedsStorageAccessFromFileURLsQuirk(WKPreferencesRef preferencesRef, bool needsQuirk)
753 {
754     toImpl(preferencesRef)->setNeedsStorageAccessFromFileURLsQuirk(needsQuirk);
755 }
756
757 bool WKPreferencesGetNeedsStorageAccessFromFileURLsQuirk(WKPreferencesRef preferencesRef)
758 {
759     return toImpl(preferencesRef)->needsStorageAccessFromFileURLsQuirk();
760 }
761
762 void WKPreferencesSetHixie76WebSocketProtocolEnabled(WKPreferencesRef, bool /*enabled*/)
763 {
764 }
765
766 bool WKPreferencesGetHixie76WebSocketProtocolEnabled(WKPreferencesRef)
767 {
768     return false;
769 }
770
771 void WKPreferencesSetMediaPlaybackRequiresUserGesture(WKPreferencesRef preferencesRef, bool flag)
772 {
773     toImpl(preferencesRef)->setRequiresUserGestureForMediaPlayback(flag);
774 }
775
776 bool WKPreferencesGetMediaPlaybackRequiresUserGesture(WKPreferencesRef preferencesRef)
777 {
778     return toImpl(preferencesRef)->requiresUserGestureForMediaPlayback();
779 }
780
781 void WKPreferencesSetVideoPlaybackRequiresUserGesture(WKPreferencesRef preferencesRef, bool flag)
782 {
783     toImpl(preferencesRef)->setRequiresUserGestureForVideoPlayback(flag);
784 }
785
786 bool WKPreferencesGetVideoPlaybackRequiresUserGesture(WKPreferencesRef preferencesRef)
787 {
788     return toImpl(preferencesRef)->requiresUserGestureForVideoPlayback();
789 }
790
791 void WKPreferencesSetAudioPlaybackRequiresUserGesture(WKPreferencesRef preferencesRef, bool flag)
792 {
793     toImpl(preferencesRef)->setRequiresUserGestureForAudioPlayback(flag);
794 }
795
796 bool WKPreferencesGetAudioPlaybackRequiresUserGesture(WKPreferencesRef preferencesRef)
797 {
798     return toImpl(preferencesRef)->requiresUserGestureForAudioPlayback();
799 }
800
801 void WKPreferencesSetMainContentUserGestureOverrideEnabled(WKPreferencesRef preferencesRef, bool flag)
802 {
803     toImpl(preferencesRef)->setMainContentUserGestureOverrideEnabled(flag);
804 }
805
806 bool WKPreferencesGetMainContentUserGestureOverrideEnabled(WKPreferencesRef preferencesRef)
807 {
808     return toImpl(preferencesRef)->mainContentUserGestureOverrideEnabled();
809 }
810
811 void WKPreferencesSetMediaPlaybackAllowsInline(WKPreferencesRef preferencesRef, bool flag)
812 {
813     toImpl(preferencesRef)->setAllowsInlineMediaPlayback(flag);
814 }
815
816 bool WKPreferencesGetMediaPlaybackAllowsInline(WKPreferencesRef preferencesRef)
817 {
818     return toImpl(preferencesRef)->allowsInlineMediaPlayback();
819 }
820
821 void WKPreferencesSetInlineMediaPlaybackRequiresPlaysInlineAttribute(WKPreferencesRef preferencesRef, bool flag)
822 {
823     toImpl(preferencesRef)->setInlineMediaPlaybackRequiresPlaysInlineAttribute(flag);
824 }
825
826 bool WKPreferencesGetInlineMediaPlaybackRequiresPlaysInlineAttribute(WKPreferencesRef preferencesRef)
827 {
828     return toImpl(preferencesRef)->inlineMediaPlaybackRequiresPlaysInlineAttribute();
829 }
830
831 void WKPreferencesSetBeaconAPIEnabled(WKPreferencesRef preferencesRef, bool flag)
832 {
833 #if ENABLE(BEACON_API)
834     toImpl(preferencesRef)->setBeaconAPIEnabled(flag);
835 #endif
836 }
837
838 bool WKPreferencesGetBeaconAPIEnabled(WKPreferencesRef preferencesRef)
839 {
840 #if ENABLE(BEACON_API)
841     return toImpl(preferencesRef)->beaconAPIEnabled();
842 #else
843     return false;
844 #endif
845 }
846
847 void WKPreferencesSetDirectoryUploadEnabled(WKPreferencesRef preferencesRef, bool flag)
848 {
849     toImpl(preferencesRef)->setDirectoryUploadEnabled(flag);
850 }
851
852 bool WKPreferencesGetDirectoryUploadEnabled(WKPreferencesRef preferencesRef)
853 {
854     return toImpl(preferencesRef)->directoryUploadEnabled();
855 }
856
857 void WKPreferencesSetMediaControlsScaleWithPageZoom(WKPreferencesRef preferencesRef, bool flag)
858 {
859     toImpl(preferencesRef)->setMediaControlsScaleWithPageZoom(flag);
860 }
861
862 bool WKPreferencesGetMediaControlsScaleWithPageZoom(WKPreferencesRef preferencesRef)
863 {
864     return toImpl(preferencesRef)->mediaControlsScaleWithPageZoom();
865 }
866
867 void WKPreferencesSetModernMediaControlsEnabled(WKPreferencesRef preferencesRef, bool flag)
868 {
869     toImpl(preferencesRef)->setModernMediaControlsEnabled(flag);
870 }
871
872 bool WKPreferencesGetModernMediaControlsEnabled(WKPreferencesRef preferencesRef)
873 {
874     return toImpl(preferencesRef)->modernMediaControlsEnabled();
875 }
876
877 void WKPreferencesSetWebAuthenticationEnabled(WKPreferencesRef preferencesRef, bool flag)
878 {
879     toImpl(preferencesRef)->setWebAuthenticationEnabled(flag);
880 }
881
882 bool WKPreferencesGetWebAuthenticationEnabled(WKPreferencesRef preferencesRef)
883 {
884     return toImpl(preferencesRef)->webAuthenticationEnabled();
885 }
886
887 void WKPreferencesSetInvisibleMediaAutoplayPermitted(WKPreferencesRef preferencesRef, bool flag)
888 {
889     toImpl(preferencesRef)->setInvisibleAutoplayNotPermitted(!flag);
890 }
891
892 bool WKPreferencesGetInvisibleMediaAutoplayPermitted(WKPreferencesRef preferencesRef)
893 {
894     return !toImpl(preferencesRef)->invisibleAutoplayNotPermitted();
895 }
896
897 void WKPreferencesSetShowsToolTipOverTruncatedText(WKPreferencesRef preferencesRef, bool flag)
898 {
899     toImpl(preferencesRef)->setShowsToolTipOverTruncatedText(flag);
900 }
901
902 bool WKPreferencesGetShowsToolTipOverTruncatedText(WKPreferencesRef preferencesRef)
903 {
904     return toImpl(preferencesRef)->showsToolTipOverTruncatedText();
905 }
906
907 void WKPreferencesSetMockScrollbarsEnabled(WKPreferencesRef preferencesRef, bool flag)
908 {
909     toImpl(preferencesRef)->setMockScrollbarsEnabled(flag);
910 }
911
912 bool WKPreferencesGetMockScrollbarsEnabled(WKPreferencesRef preferencesRef)
913 {
914     return toImpl(preferencesRef)->mockScrollbarsEnabled();
915 }
916
917 void WKPreferencesSetAttachmentElementEnabled(WKPreferencesRef preferencesRef, bool flag)
918 {
919     toImpl(preferencesRef)->setAttachmentElementEnabled(flag);
920 }
921
922 bool WKPreferencesGetAttachmentElementEnabled(WKPreferencesRef preferencesRef)
923 {
924     return toImpl(preferencesRef)->attachmentElementEnabled();
925 }
926
927 void WKPreferencesSetWebAudioEnabled(WKPreferencesRef preferencesRef, bool enabled)
928 {
929     toImpl(preferencesRef)->setWebAudioEnabled(enabled);
930 }
931
932 bool WKPreferencesGetWebAudioEnabled(WKPreferencesRef preferencesRef)
933 {
934     return toImpl(preferencesRef)->webAudioEnabled();
935 }
936
937 void WKPreferencesSetApplicationChromeModeEnabled(WKPreferencesRef, bool)
938 {
939     // FIXME: Remove once WebKit nightlies don't need to support Safari 8.
940 }
941
942 bool WKPreferencesGetApplicationChromeModeEnabled(WKPreferencesRef)
943 {
944     // FIXME: Remove once WebKit nightlies don't need to support Safari 8.
945     return false;
946 }
947
948 void WKPreferencesSetInspectorUsesWebKitUserInterface(WKPreferencesRef, bool)
949 {
950     // FIXME: Remove once WebKit nightlies don't need to support Safari 6 thru 7.
951 }
952
953 bool WKPreferencesGetInspectorUsesWebKitUserInterface(WKPreferencesRef)
954 {
955     // FIXME: Remove once WebKit nightlies don't need to support Safari 6 thru 7.
956     return false;
957 }
958
959 void WKPreferencesSetSuppressesIncrementalRendering(WKPreferencesRef preferencesRef, bool enabled)
960 {
961     toImpl(preferencesRef)->setSuppressesIncrementalRendering(enabled);
962 }
963
964 bool WKPreferencesGetSuppressesIncrementalRendering(WKPreferencesRef preferencesRef)
965 {
966     return toImpl(preferencesRef)->suppressesIncrementalRendering();
967 }
968
969 void WKPreferencesSetBackspaceKeyNavigationEnabled(WKPreferencesRef preferencesRef, bool enabled)
970 {
971     toImpl(preferencesRef)->setBackspaceKeyNavigationEnabled(enabled);
972 }
973
974 bool WKPreferencesGetBackspaceKeyNavigationEnabled(WKPreferencesRef preferencesRef)
975 {
976     return toImpl(preferencesRef)->backspaceKeyNavigationEnabled();
977 }
978
979 void WKPreferencesSetCaretBrowsingEnabled(WKPreferencesRef preferencesRef, bool enabled)
980 {
981     toImpl(preferencesRef)->setCaretBrowsingEnabled(enabled);
982 }
983
984 bool WKPreferencesGetCaretBrowsingEnabled(WKPreferencesRef preferencesRef)
985 {
986     return toImpl(preferencesRef)->caretBrowsingEnabled();
987 }
988
989 void WKPreferencesSetShouldDisplaySubtitles(WKPreferencesRef preferencesRef, bool enabled)
990 {
991     toImpl(preferencesRef)->setShouldDisplaySubtitles(enabled);
992 }
993
994 bool WKPreferencesGetShouldDisplaySubtitles(WKPreferencesRef preferencesRef)
995 {
996     return toImpl(preferencesRef)->shouldDisplaySubtitles();
997 }
998
999 void WKPreferencesSetShouldDisplayCaptions(WKPreferencesRef preferencesRef, bool enabled)
1000 {
1001     toImpl(preferencesRef)->setShouldDisplayCaptions(enabled);
1002 }
1003
1004 bool WKPreferencesGetShouldDisplayCaptions(WKPreferencesRef preferencesRef)
1005 {
1006     return toImpl(preferencesRef)->shouldDisplayCaptions();
1007 }
1008
1009 void WKPreferencesSetShouldDisplayTextDescriptions(WKPreferencesRef preferencesRef, bool enabled)
1010 {
1011     toImpl(preferencesRef)->setShouldDisplayTextDescriptions(enabled);
1012 }
1013
1014 bool WKPreferencesGetShouldDisplayTextDescriptions(WKPreferencesRef preferencesRef)
1015 {
1016     return toImpl(preferencesRef)->shouldDisplayTextDescriptions();
1017 }
1018
1019 void WKPreferencesSetNotificationsEnabled(WKPreferencesRef preferencesRef, bool enabled)
1020 {
1021     toImpl(preferencesRef)->setNotificationsEnabled(enabled);
1022 }
1023
1024 bool WKPreferencesGetNotificationsEnabled(WKPreferencesRef preferencesRef)
1025 {
1026     return toImpl(preferencesRef)->notificationsEnabled();
1027 }
1028
1029 void WKPreferencesSetShouldRespectImageOrientation(WKPreferencesRef preferencesRef, bool enabled)
1030 {
1031     toImpl(preferencesRef)->setShouldRespectImageOrientation(enabled);
1032 }
1033
1034 bool WKPreferencesGetShouldRespectImageOrientation(WKPreferencesRef preferencesRef)
1035 {
1036     return toImpl(preferencesRef)->shouldRespectImageOrientation();
1037 }
1038
1039 void WKPreferencesSetRequestAnimationFrameEnabled(WKPreferencesRef preferencesRef, bool flag)
1040 {
1041     toImpl(preferencesRef)->setRequestAnimationFrameEnabled(flag);
1042 }
1043
1044 bool WKPreferencesGetRequestAnimationFrameEnabled(WKPreferencesRef preferencesRef)
1045 {
1046     return toImpl(preferencesRef)->requestAnimationFrameEnabled();
1047 }
1048
1049 void WKPreferencesSetStorageBlockingPolicy(WKPreferencesRef preferencesRef, WKStorageBlockingPolicy policy)
1050 {
1051     toImpl(preferencesRef)->setStorageBlockingPolicy(toStorageBlockingPolicy(policy));
1052 }
1053
1054 WKStorageBlockingPolicy WKPreferencesGetStorageBlockingPolicy(WKPreferencesRef preferencesRef)
1055 {
1056     return toAPI(static_cast<WebCore::SecurityOrigin::StorageBlockingPolicy>(toImpl(preferencesRef)->storageBlockingPolicy()));
1057 }
1058
1059 void WKPreferencesResetTestRunnerOverrides(WKPreferencesRef preferencesRef)
1060 {
1061     // Currently we reset the overrides on the web process when preferencesDidChange() is called. Since WTR preferences
1062     // are usually always the same (in the UI process), they are not sent to web process, not triggering the reset.
1063     toImpl(preferencesRef)->forceUpdate();
1064 }
1065
1066 void WKPreferencesSetDiagnosticLoggingEnabled(WKPreferencesRef preferencesRef, bool enabled)
1067 {
1068     toImpl(preferencesRef)->setDiagnosticLoggingEnabled(enabled);
1069 }
1070
1071 bool WKPreferencesGetDiagnosticLoggingEnabled(WKPreferencesRef preferencesRef)
1072 {
1073     return toImpl(preferencesRef)->diagnosticLoggingEnabled();
1074 }
1075
1076 void WKPreferencesSetAsynchronousPluginInitializationEnabled(WKPreferencesRef preferencesRef, bool enabled)
1077 {
1078     toImpl(preferencesRef)->setAsynchronousPluginInitializationEnabled(enabled);
1079 }
1080
1081 bool WKPreferencesGetAsynchronousPluginInitializationEnabled(WKPreferencesRef preferencesRef)
1082 {
1083     return toImpl(preferencesRef)->asynchronousPluginInitializationEnabled();
1084 }
1085
1086 void WKPreferencesSetAsynchronousPluginInitializationEnabledForAllPlugins(WKPreferencesRef preferencesRef, bool enabled)
1087 {
1088     toImpl(preferencesRef)->setAsynchronousPluginInitializationEnabledForAllPlugins(enabled);
1089 }
1090
1091 bool WKPreferencesGetAsynchronousPluginInitializationEnabledForAllPlugins(WKPreferencesRef preferencesRef)
1092 {
1093     return toImpl(preferencesRef)->asynchronousPluginInitializationEnabledForAllPlugins();
1094 }
1095
1096 void WKPreferencesSetArtificialPluginInitializationDelayEnabled(WKPreferencesRef preferencesRef, bool enabled)
1097 {
1098     toImpl(preferencesRef)->setArtificialPluginInitializationDelayEnabled(enabled);
1099 }
1100
1101 bool WKPreferencesGetArtificialPluginInitializationDelayEnabled(WKPreferencesRef preferencesRef)
1102 {
1103     return toImpl(preferencesRef)->artificialPluginInitializationDelayEnabled();
1104 }
1105
1106 void WKPreferencesSetTabToLinksEnabled(WKPreferencesRef preferencesRef, bool enabled)
1107 {
1108     toImpl(preferencesRef)->setTabToLinksEnabled(enabled);
1109 }
1110
1111 bool WKPreferencesGetTabToLinksEnabled(WKPreferencesRef preferencesRef)
1112 {
1113     return toImpl(preferencesRef)->tabToLinksEnabled();
1114 }
1115
1116 void WKPreferencesSetInteractiveFormValidationEnabled(WKPreferencesRef preferencesRef, bool enabled)
1117 {
1118     toImpl(preferencesRef)->setInteractiveFormValidationEnabled(enabled);
1119 }
1120
1121 bool WKPreferencesGetInteractiveFormValidationEnabled(WKPreferencesRef preferencesRef)
1122 {
1123     return toImpl(preferencesRef)->interactiveFormValidationEnabled();
1124 }
1125
1126 void WKPreferencesSetScrollingPerformanceLoggingEnabled(WKPreferencesRef preferencesRef, bool enabled)
1127 {
1128     toImpl(preferencesRef)->setScrollingPerformanceLoggingEnabled(enabled);
1129 }
1130
1131 bool WKPreferencesGetScrollingPerformanceLoggingEnabled(WKPreferencesRef preferencesRef)
1132 {
1133     return toImpl(preferencesRef)->scrollingPerformanceLoggingEnabled();
1134 }
1135
1136 void WKPreferencesSetPlugInSnapshottingEnabled(WKPreferencesRef preferencesRef, bool enabled)
1137 {
1138     toImpl(preferencesRef)->setPlugInSnapshottingEnabled(enabled);
1139 }
1140
1141 bool WKPreferencesGetPlugInSnapshottingEnabled(WKPreferencesRef preferencesRef)
1142 {
1143     return toImpl(preferencesRef)->plugInSnapshottingEnabled();
1144 }
1145
1146 void WKPreferencesSetSnapshotAllPlugIns(WKPreferencesRef preferencesRef, bool enabled)
1147 {
1148     toImpl(preferencesRef)->setSnapshotAllPlugIns(enabled);
1149 }
1150
1151 bool WKPreferencesGetSnapshotAllPlugIns(WKPreferencesRef preferencesRef)
1152 {
1153     return toImpl(preferencesRef)->snapshotAllPlugIns();
1154 }
1155
1156 void WKPreferencesSetAutostartOriginPlugInSnapshottingEnabled(WKPreferencesRef preferencesRef, bool enabled)
1157 {
1158     toImpl(preferencesRef)->setAutostartOriginPlugInSnapshottingEnabled(enabled);
1159 }
1160
1161 bool WKPreferencesGetAutostartOriginPlugInSnapshottingEnabled(WKPreferencesRef preferencesRef)
1162 {
1163     return toImpl(preferencesRef)->autostartOriginPlugInSnapshottingEnabled();
1164 }
1165
1166 void WKPreferencesSetPrimaryPlugInSnapshotDetectionEnabled(WKPreferencesRef preferencesRef, bool enabled)
1167 {
1168     toImpl(preferencesRef)->setPrimaryPlugInSnapshotDetectionEnabled(enabled);
1169 }
1170
1171 bool WKPreferencesGetPrimaryPlugInSnapshotDetectionEnabled(WKPreferencesRef preferencesRef)
1172 {
1173     return toImpl(preferencesRef)->primaryPlugInSnapshotDetectionEnabled();
1174 }
1175
1176 void WKPreferencesSetPDFPluginEnabled(WKPreferencesRef preferencesRef, bool enabled)
1177 {
1178     toImpl(preferencesRef)->setPDFPluginEnabled(enabled);
1179 }
1180
1181 bool WKPreferencesGetPDFPluginEnabled(WKPreferencesRef preferencesRef)
1182 {
1183     return toImpl(preferencesRef)->pdfPluginEnabled();
1184 }
1185
1186 void WKPreferencesSetEncodingDetectorEnabled(WKPreferencesRef preferencesRef, bool enabled)
1187 {
1188     toImpl(preferencesRef)->setUsesEncodingDetector(enabled);
1189 }
1190
1191 bool WKPreferencesGetEncodingDetectorEnabled(WKPreferencesRef preferencesRef)
1192 {
1193     return toImpl(preferencesRef)->usesEncodingDetector();
1194 }
1195
1196 void WKPreferencesSetTextAutosizingEnabled(WKPreferencesRef preferencesRef, bool textAutosizingEnabled)
1197 {
1198     toImpl(preferencesRef)->setTextAutosizingEnabled(textAutosizingEnabled);
1199 }
1200
1201 bool WKPreferencesGetTextAutosizingEnabled(WKPreferencesRef preferencesRef)
1202 {
1203     return toImpl(preferencesRef)->textAutosizingEnabled();
1204 }
1205
1206 void WKPreferencesSetAggressiveTileRetentionEnabled(WKPreferencesRef preferencesRef, bool enabled)
1207 {
1208     toImpl(preferencesRef)->setAggressiveTileRetentionEnabled(enabled);
1209 }
1210
1211 bool WKPreferencesGetAggressiveTileRetentionEnabled(WKPreferencesRef preferencesRef)
1212 {
1213     return toImpl(preferencesRef)->aggressiveTileRetentionEnabled();
1214 }
1215
1216 void WKPreferencesSetQTKitEnabled(WKPreferencesRef preferencesRef, bool enabled)
1217 {
1218     toImpl(preferencesRef)->setQTKitEnabled(enabled);
1219 }
1220
1221 bool WKPreferencesGetQTKitEnabled(WKPreferencesRef preferencesRef)
1222 {
1223     return toImpl(preferencesRef)->isQTKitEnabled();
1224 }
1225
1226 void WKPreferencesSetLogsPageMessagesToSystemConsoleEnabled(WKPreferencesRef preferencesRef, bool enabled)
1227 {
1228     toImpl(preferencesRef)->setLogsPageMessagesToSystemConsoleEnabled(enabled);
1229 }
1230
1231 bool WKPreferencesGetLogsPageMessagesToSystemConsoleEnabled(WKPreferencesRef preferencesRef)
1232 {
1233     return toImpl(preferencesRef)->logsPageMessagesToSystemConsoleEnabled();
1234 }
1235
1236 void WKPreferencesSetPageVisibilityBasedProcessSuppressionEnabled(WKPreferencesRef preferencesRef, bool enabled)
1237 {
1238     toImpl(preferencesRef)->setPageVisibilityBasedProcessSuppressionEnabled(enabled);
1239 }
1240
1241 bool WKPreferencesGetPageVisibilityBasedProcessSuppressionEnabled(WKPreferencesRef preferencesRef)
1242 {
1243     return toImpl(preferencesRef)->pageVisibilityBasedProcessSuppressionEnabled();
1244 }
1245
1246 void WKPreferencesSetSmartInsertDeleteEnabled(WKPreferencesRef preferencesRef, bool enabled)
1247 {
1248     toImpl(preferencesRef)->setSmartInsertDeleteEnabled(enabled);
1249 }
1250
1251 bool WKPreferencesGetSmartInsertDeleteEnabled(WKPreferencesRef preferencesRef)
1252 {
1253     return toImpl(preferencesRef)->smartInsertDeleteEnabled();
1254 }
1255
1256 void WKPreferencesSetSelectTrailingWhitespaceEnabled(WKPreferencesRef preferencesRef, bool enabled)
1257 {
1258     toImpl(preferencesRef)->setSelectTrailingWhitespaceEnabled(enabled);
1259 }
1260
1261 bool WKPreferencesGetSelectTrailingWhitespaceEnabled(WKPreferencesRef preferencesRef)
1262 {
1263     return toImpl(preferencesRef)->selectTrailingWhitespaceEnabled();
1264 }
1265
1266 void WKPreferencesSetShowsURLsInToolTipsEnabled(WKPreferencesRef preferencesRef, bool enabled)
1267 {
1268     toImpl(preferencesRef)->setShowsURLsInToolTipsEnabled(enabled);
1269 }
1270
1271 bool WKPreferencesGetShowsURLsInToolTipsEnabled(WKPreferencesRef preferencesRef)
1272 {
1273     return toImpl(preferencesRef)->showsURLsInToolTipsEnabled();
1274 }
1275
1276 void WKPreferencesSetHiddenPageDOMTimerThrottlingEnabled(WKPreferencesRef preferencesRef, bool enabled)
1277 {
1278     toImpl(preferencesRef)->setHiddenPageDOMTimerThrottlingEnabled(enabled);
1279 }
1280
1281 void WKPreferencesSetHiddenPageDOMTimerThrottlingAutoIncreases(WKPreferencesRef preferencesRef, bool enabled)
1282 {
1283     toImpl(preferencesRef)->setHiddenPageDOMTimerThrottlingAutoIncreases(enabled);
1284 }
1285
1286 bool WKPreferencesGetHiddenPageDOMTimerThrottlingEnabled(WKPreferencesRef preferencesRef)
1287 {
1288     return toImpl(preferencesRef)->hiddenPageDOMTimerThrottlingEnabled();
1289 }
1290
1291 bool WKPreferencesGetHiddenPageDOMTimerThrottlingAutoIncreases(WKPreferencesRef preferencesRef)
1292 {
1293     return toImpl(preferencesRef)->hiddenPageDOMTimerThrottlingAutoIncreases();
1294 }
1295
1296 void WKPreferencesSetHiddenPageCSSAnimationSuspensionEnabled(WKPreferencesRef preferencesRef, bool enabled)
1297 {
1298     toImpl(preferencesRef)->setHiddenPageCSSAnimationSuspensionEnabled(enabled);
1299 }
1300
1301 bool WKPreferencesGetHiddenPageCSSAnimationSuspensionEnabled(WKPreferencesRef preferencesRef)
1302 {
1303     return toImpl(preferencesRef)->hiddenPageCSSAnimationSuspensionEnabled();
1304 }
1305
1306 void WKPreferencesSetIncrementalRenderingSuppressionTimeout(WKPreferencesRef preferencesRef, double timeout)
1307 {
1308     toImpl(preferencesRef)->setIncrementalRenderingSuppressionTimeout(timeout);
1309 }
1310
1311 double WKPreferencesGetIncrementalRenderingSuppressionTimeout(WKPreferencesRef preferencesRef)
1312 {
1313     return toAPI(toImpl(preferencesRef)->incrementalRenderingSuppressionTimeout());
1314 }
1315
1316 void WKPreferencesSetThreadedScrollingEnabled(WKPreferencesRef preferencesRef, bool enabled)
1317 {
1318     toImpl(preferencesRef)->setThreadedScrollingEnabled(enabled);
1319 }
1320
1321 bool WKPreferencesGetThreadedScrollingEnabled(WKPreferencesRef preferencesRef)
1322 {
1323     return toImpl(preferencesRef)->threadedScrollingEnabled();
1324 }
1325
1326 void WKPreferencesSetSimpleLineLayoutEnabled(WKPreferencesRef preferencesRef, bool flag)
1327 {
1328     toImpl(preferencesRef)->setSimpleLineLayoutEnabled(flag);
1329 }
1330
1331 bool WKPreferencesGetSimpleLineLayoutEnabled(WKPreferencesRef preferencesRef)
1332 {
1333     return toImpl(preferencesRef)->simpleLineLayoutEnabled();
1334 }
1335
1336 void WKPreferencesSetSimpleLineLayoutDebugBordersEnabled(WKPreferencesRef preferencesRef, bool flag)
1337 {
1338     toImpl(preferencesRef)->setSimpleLineLayoutDebugBordersEnabled(flag);
1339 }
1340
1341 bool WKPreferencesGetSimpleLineLayoutDebugBordersEnabled(WKPreferencesRef preferencesRef)
1342 {
1343     return toImpl(preferencesRef)->simpleLineLayoutDebugBordersEnabled();
1344 }
1345
1346 void WKPreferencesSetNewBlockInsideInlineModelEnabled(WKPreferencesRef, bool)
1347 {
1348     // FIXME: Remove Safari call to this.
1349 }
1350
1351 bool WKPreferencesGetNewBlockInsideInlineModelEnabled(WKPreferencesRef)
1352 {
1353     // FIXME: Remove Safari call for this.
1354     return false;
1355 }
1356
1357 void WKPreferencesSetDeferredCSSParserEnabled(WKPreferencesRef preferencesRef, bool flag)
1358 {
1359     toImpl(preferencesRef)->setDeferredCSSParserEnabled(flag);
1360 }
1361
1362 bool WKPreferencesGetDeferredCSSParserEnabled(WKPreferencesRef preferencesRef)
1363 {
1364     return toImpl(preferencesRef)->deferredCSSParserEnabled();
1365 }
1366
1367 void WKPreferencesSetSubpixelCSSOMElementMetricsEnabled(WKPreferencesRef preferencesRef, bool flag)
1368 {
1369     toImpl(preferencesRef)->setSubpixelCSSOMElementMetricsEnabled(flag);
1370 }
1371
1372 bool WKPreferencesGetSubpixelCSSOMElementMetricsEnabled(WKPreferencesRef preferencesRef)
1373 {
1374     return toImpl(preferencesRef)->subpixelCSSOMElementMetricsEnabled();
1375 }
1376
1377 void WKPreferencesSetUseGiantTiles(WKPreferencesRef preferencesRef, bool flag)
1378 {
1379     toImpl(preferencesRef)->setUseGiantTiles(flag);
1380 }
1381
1382 bool WKPreferencesGetUseGiantTiles(WKPreferencesRef preferencesRef)
1383 {
1384     return toImpl(preferencesRef)->useGiantTiles();
1385 }
1386
1387 void WKPreferencesSetMediaDevicesEnabled(WKPreferencesRef preferencesRef, bool enabled)
1388 {
1389     toImpl(preferencesRef)->setMediaDevicesEnabled(enabled);
1390 }
1391
1392 bool WKPreferencesGetMediaDevicesEnabled(WKPreferencesRef preferencesRef)
1393 {
1394     return toImpl(preferencesRef)->mediaDevicesEnabled();
1395 }
1396
1397 void WKPreferencesSetMediaStreamEnabled(WKPreferencesRef preferencesRef, bool enabled)
1398 {
1399     toImpl(preferencesRef)->setMediaStreamEnabled(enabled);
1400 }
1401
1402 bool WKPreferencesGetMediaStreamEnabled(WKPreferencesRef preferencesRef)
1403 {
1404     return toImpl(preferencesRef)->mediaStreamEnabled();
1405 }
1406
1407 void WKPreferencesSetPeerConnectionEnabled(WKPreferencesRef preferencesRef, bool enabled)
1408 {
1409     toImpl(preferencesRef)->setPeerConnectionEnabled(enabled);
1410 }
1411
1412 bool WKPreferencesGetPeerConnectionEnabled(WKPreferencesRef preferencesRef)
1413 {
1414     return toImpl(preferencesRef)->peerConnectionEnabled();
1415 }
1416
1417 void WKPreferencesSetWebRTCLegacyAPIEnabled(WKPreferencesRef preferencesRef, bool enabled)
1418 {
1419     toImpl(preferencesRef)->setWebRTCLegacyAPIEnabled(enabled);
1420 }
1421
1422 bool WKPreferencesGetWebRTCLegacyAPIEnabled(WKPreferencesRef preferencesRef)
1423 {
1424     return toImpl(preferencesRef)->webRTCLegacyAPIEnabled();
1425 }
1426
1427 void WKPreferencesSetSpatialNavigationEnabled(WKPreferencesRef preferencesRef, bool enabled)
1428 {
1429     toImpl(preferencesRef)->setSpatialNavigationEnabled(enabled);
1430 }
1431
1432 bool WKPreferencesGetSpatialNavigationEnabled(WKPreferencesRef preferencesRef)
1433 {
1434     return toImpl(preferencesRef)->spatialNavigationEnabled();
1435 }
1436
1437 void WKPreferencesSetMediaSourceEnabled(WKPreferencesRef preferencesRef, bool enabled)
1438 {
1439     toImpl(preferencesRef)->setMediaSourceEnabled(enabled);
1440 }
1441
1442 bool WKPreferencesGetMediaSourceEnabled(WKPreferencesRef preferencesRef)
1443 {
1444     return toImpl(preferencesRef)->mediaSourceEnabled();
1445 }
1446
1447 void WKPreferencesSetViewGestureDebuggingEnabled(WKPreferencesRef preferencesRef, bool enabled)
1448 {
1449     toImpl(preferencesRef)->setViewGestureDebuggingEnabled(enabled);
1450 }
1451
1452 bool WKPreferencesGetViewGestureDebuggingEnabled(WKPreferencesRef preferencesRef)
1453 {
1454     return toImpl(preferencesRef)->viewGestureDebuggingEnabled();
1455 }
1456
1457 void WKPreferencesSetShouldConvertPositionStyleOnCopy(WKPreferencesRef preferencesRef, bool convert)
1458 {
1459     toImpl(preferencesRef)->setShouldConvertPositionStyleOnCopy(convert);
1460 }
1461
1462 bool WKPreferencesGetShouldConvertPositionStyleOnCopy(WKPreferencesRef preferencesRef)
1463 {
1464     return toImpl(preferencesRef)->shouldConvertPositionStyleOnCopy();
1465 }
1466
1467 void WKPreferencesSetTelephoneNumberParsingEnabled(WKPreferencesRef preferencesRef, bool enabled)
1468 {
1469     toImpl(preferencesRef)->setTelephoneNumberParsingEnabled(enabled);
1470 }
1471
1472 bool WKPreferencesGetTelephoneNumberParsingEnabled(WKPreferencesRef preferencesRef)
1473 {
1474     return toImpl(preferencesRef)->telephoneNumberParsingEnabled();
1475 }
1476
1477 void WKPreferencesSetEnableInheritURIQueryComponent(WKPreferencesRef preferencesRef, bool enabled)
1478 {
1479     toImpl(preferencesRef)->setEnableInheritURIQueryComponent(enabled);
1480 }
1481
1482 bool WKPreferencesGetEnableInheritURIQueryComponent(WKPreferencesRef preferencesRef)
1483 {
1484     return toImpl(preferencesRef)->enableInheritURIQueryComponent();
1485 }
1486
1487 void WKPreferencesSetServiceControlsEnabled(WKPreferencesRef preferencesRef, bool enabled)
1488 {
1489     toImpl(preferencesRef)->setServiceControlsEnabled(enabled);
1490 }
1491
1492 bool WKPreferencesGetServiceControlsEnabled(WKPreferencesRef preferencesRef)
1493 {
1494     return toImpl(preferencesRef)->serviceControlsEnabled();
1495 }
1496
1497 void WKPreferencesSetImageControlsEnabled(WKPreferencesRef preferencesRef, bool enabled)
1498 {
1499     toImpl(preferencesRef)->setImageControlsEnabled(enabled);
1500 }
1501
1502 bool WKPreferencesGetImageControlsEnabled(WKPreferencesRef preferencesRef)
1503 {
1504     return toImpl(preferencesRef)->imageControlsEnabled();
1505 }
1506
1507 void WKPreferencesSetGamepadsEnabled(WKPreferencesRef preferencesRef, bool enabled)
1508 {
1509     toImpl(preferencesRef)->setGamepadsEnabled(enabled);
1510 }
1511
1512 bool WKPreferencesGetGamepadsEnabled(WKPreferencesRef preferencesRef)
1513 {
1514     return toImpl(preferencesRef)->gamepadsEnabled();
1515 }
1516
1517 // FIXME: Remove these when possible.
1518 void WKPreferencesSetLongMousePressEnabled(WKPreferencesRef preferencesRef, bool enabled)
1519 {
1520 }
1521
1522 bool WKPreferencesGetLongMousePressEnabled(WKPreferencesRef preferencesRef)
1523 {
1524     return false;
1525 }
1526
1527 void WKPreferencesSetMinimumZoomFontSize(WKPreferencesRef preferencesRef, double size)
1528 {
1529     toImpl(preferencesRef)->setMinimumZoomFontSize(size);
1530 }
1531
1532 double WKPreferencesGetMinimumZoomFontSize(WKPreferencesRef preferencesRef)
1533 {
1534     return toImpl(preferencesRef)->minimumZoomFontSize();
1535 }
1536
1537 void WKPreferencesSetAntialiasedFontDilationEnabled(WKPreferencesRef, bool)
1538 {
1539     // Feature removed.
1540 }
1541
1542 bool WKPreferencesGetAntialiasedFontDilationEnabled(WKPreferencesRef)
1543 {
1544     return false; // Feature removed.
1545 }
1546
1547 void WKPreferencesSetVisibleDebugOverlayRegions(WKPreferencesRef preferencesRef, WKDebugOverlayRegions visibleRegions)
1548 {
1549     toImpl(preferencesRef)->setVisibleDebugOverlayRegions(visibleRegions);
1550 }
1551
1552 WKDebugOverlayRegions WKPreferencesGetVisibleDebugOverlayRegions(WKPreferencesRef preferencesRef)
1553 {
1554     return toImpl(preferencesRef)->visibleDebugOverlayRegions();
1555 }
1556
1557 void WKPreferencesSetIgnoreViewportScalingConstraints(WKPreferencesRef preferencesRef, bool enabled)
1558 {
1559     toImpl(preferencesRef)->setIgnoreViewportScalingConstraints(enabled);
1560 }
1561
1562 bool WKPreferencesGetIgnoreViewportScalingConstraints(WKPreferencesRef preferencesRef)
1563 {
1564     return toImpl(preferencesRef)->ignoreViewportScalingConstraints();
1565 }
1566
1567 void WKPreferencesSetMetaRefreshEnabled(WKPreferencesRef preferencesRef, bool enabled)
1568 {
1569     toImpl(preferencesRef)->setHTTPEquivEnabled(enabled);
1570 }
1571
1572 bool WKPreferencesGetMetaRefreshEnabled(WKPreferencesRef preferencesRef)
1573 {
1574     return toImpl(preferencesRef)->httpEquivEnabled();
1575 }
1576
1577 void WKPreferencesSetHTTPEquivEnabled(WKPreferencesRef preferencesRef, bool enabled)
1578 {
1579     toImpl(preferencesRef)->setHTTPEquivEnabled(enabled);
1580 }
1581
1582 bool WKPreferencesGetHTTPEquivEnabled(WKPreferencesRef preferencesRef)
1583 {
1584     return toImpl(preferencesRef)->httpEquivEnabled();
1585 }
1586
1587 void WKPreferencesSetAllowsAirPlayForMediaPlayback(WKPreferencesRef preferencesRef, bool enabled)
1588 {
1589     toImpl(preferencesRef)->setAllowsAirPlayForMediaPlayback(enabled);
1590 }
1591
1592 bool WKPreferencesGetAllowsAirPlayForMediaPlayback(WKPreferencesRef preferencesRef)
1593 {
1594     return toImpl(preferencesRef)->allowsAirPlayForMediaPlayback();
1595 }
1596
1597 void WKPreferencesSetUserInterfaceDirectionPolicy(WKPreferencesRef preferencesRef, _WKUserInterfaceDirectionPolicy userInterfaceDirectionPolicy)
1598 {
1599     toImpl(preferencesRef)->setUserInterfaceDirectionPolicy(userInterfaceDirectionPolicy);
1600 }
1601
1602 _WKUserInterfaceDirectionPolicy WKPreferencesGetUserInterfaceDirectionPolicy(WKPreferencesRef preferencesRef)
1603 {
1604     return static_cast<_WKUserInterfaceDirectionPolicy>(toImpl(preferencesRef)->userInterfaceDirectionPolicy());
1605 }
1606
1607 void WKPreferencesSetResourceUsageOverlayVisible(WKPreferencesRef preferencesRef, bool enabled)
1608 {
1609     toImpl(preferencesRef)->setResourceUsageOverlayVisible(enabled);
1610 }
1611
1612 bool WKPreferencesGetResourceUsageOverlayVisible(WKPreferencesRef preferencesRef)
1613 {
1614     return toImpl(preferencesRef)->resourceUsageOverlayVisible();
1615 }
1616
1617 void WKPreferencesSetMockCaptureDevicesEnabled(WKPreferencesRef preferencesRef, bool enabled)
1618 {
1619     toImpl(preferencesRef)->setMockCaptureDevicesEnabled(enabled);
1620 }
1621
1622 bool WKPreferencesGetMockCaptureDevicesEnabled(WKPreferencesRef preferencesRef)
1623 {
1624     return toImpl(preferencesRef)->mockCaptureDevicesEnabled();
1625 }
1626
1627 void WKPreferencesSetICECandidateFilteringEnabled(WKPreferencesRef preferencesRef, bool enabled)
1628 {
1629     toImpl(preferencesRef)->setICECandidateFilteringEnabled(enabled);
1630 }
1631
1632 bool WKPreferencesGetICECandidateFilteringEnabled(WKPreferencesRef preferencesRef)
1633 {
1634     return toImpl(preferencesRef)->iceCandidateFilteringEnabled();
1635 }
1636
1637 void WKPreferencesSetEnumeratingAllNetworkInterfacesEnabled(WKPreferencesRef preferencesRef, bool enabled)
1638 {
1639     toImpl(preferencesRef)->setEnumeratingAllNetworkInterfacesEnabled(enabled);
1640 }
1641
1642 bool WKPreferencesGetEnumeratingAllNetworkInterfacesEnabled(WKPreferencesRef preferencesRef)
1643 {
1644     return toImpl(preferencesRef)->enumeratingAllNetworkInterfacesEnabled();
1645 }
1646
1647 void WKPreferencesSetMediaCaptureRequiresSecureConnection(WKPreferencesRef preferencesRef, bool enabled)
1648 {
1649     toImpl(preferencesRef)->setMediaCaptureRequiresSecureConnection(enabled);
1650 }
1651
1652 bool WKPreferencesGetMediaCaptureRequiresSecureConnection(WKPreferencesRef preferencesRef)
1653 {
1654     return toImpl(preferencesRef)->mediaCaptureRequiresSecureConnection();
1655 }
1656
1657 void WKPreferencesSetInactiveMediaCaptureSteamRepromptIntervalInMinutes(WKPreferencesRef preferencesRef, double interval)
1658 {
1659     toImpl(preferencesRef)->setInactiveMediaCaptureSteamRepromptIntervalInMinutes(interval);
1660 }
1661
1662 double WKPreferencesGetInactiveMediaCaptureSteamRepromptIntervalInMinutes(WKPreferencesRef preferencesRef)
1663 {
1664     return toImpl(preferencesRef)->inactiveMediaCaptureSteamRepromptIntervalInMinutes();
1665 }
1666
1667 void WKPreferencesSetFetchAPIEnabled(WKPreferencesRef preferencesRef, bool flag)
1668 {
1669     toImpl(preferencesRef)->setFetchAPIEnabled(flag);
1670 }
1671
1672 bool WKPreferencesGetFetchAPIEnabled(WKPreferencesRef preferencesRef)
1673 {
1674     return toImpl(preferencesRef)->fetchAPIEnabled();
1675 }
1676
1677 void WKPreferencesSetDisplayContentsEnabled(WKPreferencesRef preferencesRef, bool flag)
1678 {
1679     toImpl(preferencesRef)->setDisplayContentsEnabled(flag);
1680 }
1681
1682 bool WKPreferencesGetDisplayContentsEnabled(WKPreferencesRef preferencesRef)
1683 {
1684     return toImpl(preferencesRef)->displayContentsEnabled();
1685 }
1686
1687 void WKPreferencesSetDataTransferItemsEnabled(WKPreferencesRef preferencesRef, bool flag)
1688 {
1689     toImpl(preferencesRef)->setDataTransferItemsEnabled(flag);
1690 }
1691
1692 bool WKPreferencesGetDataTransferItemsEnabled(WKPreferencesRef preferencesRef)
1693 {
1694     return toImpl(preferencesRef)->dataTransferItemsEnabled();
1695 }
1696
1697 void WKPreferencesSetCustomPasteboardDataEnabled(WKPreferencesRef preferencesRef, bool flag)
1698 {
1699     toImpl(preferencesRef)->setCustomPasteboardDataEnabled(flag);
1700 }
1701
1702 bool WKPreferencesGetCustomPasteboardDataEnabled(WKPreferencesRef preferencesRef)
1703 {
1704     return toImpl(preferencesRef)->customPasteboardDataEnabled();
1705 }
1706
1707 void WKPreferencesSetDownloadAttributeEnabled(WKPreferencesRef preferencesRef, bool flag)
1708 {
1709     toImpl(preferencesRef)->setDownloadAttributeEnabled(flag);
1710 }
1711
1712 bool WKPreferencesGetDownloadAttributeEnabled(WKPreferencesRef preferencesRef)
1713 {
1714     return toImpl(preferencesRef)->downloadAttributeEnabled();
1715 }
1716
1717 void WKPreferencesSetIntersectionObserverEnabled(WKPreferencesRef preferencesRef, bool flag)
1718 {
1719     toImpl(preferencesRef)->setIntersectionObserverEnabled(flag);
1720 }
1721
1722 bool WKPreferencesGetIntersectionObserverEnabled(WKPreferencesRef preferencesRef)
1723 {
1724     return toImpl(preferencesRef)->intersectionObserverEnabled();
1725 }
1726
1727 void WKPreferencesSetMenuItemElementEnabled(WKPreferencesRef preferencesRef, bool flag)
1728 {
1729     return toImpl(preferencesRef)->setMenuItemElementEnabled(flag);
1730 }
1731
1732 bool WKPreferencesGetMenuItemElementEnabled(WKPreferencesRef preferencesRef)
1733 {
1734     return toImpl(preferencesRef)->menuItemElementEnabled();
1735 }
1736
1737 void WKPreferencesSetUserTimingEnabled(WKPreferencesRef preferencesRef, bool flag)
1738 {
1739     toImpl(preferencesRef)->setUserTimingEnabled(flag);
1740 }
1741
1742 bool WKPreferencesGetUserTimingEnabled(WKPreferencesRef preferencesRef)
1743 {
1744     return toImpl(preferencesRef)->userTimingEnabled();
1745 }
1746
1747 void WKPreferencesSetResourceTimingEnabled(WKPreferencesRef preferencesRef, bool flag)
1748 {
1749     toImpl(preferencesRef)->setResourceTimingEnabled(flag);
1750 }
1751
1752 bool WKPreferencesGetResourceTimingEnabled(WKPreferencesRef preferencesRef)
1753 {
1754     return toImpl(preferencesRef)->resourceTimingEnabled();
1755 }
1756
1757 void WKPreferencesSetSelectionPaintingWithoutSelectionGapsEnabled(WKPreferencesRef preferencesRef, bool flag)
1758 {
1759     toImpl(preferencesRef)->setSelectionPaintingWithoutSelectionGapsEnabled(flag);
1760 }
1761
1762 bool WKPreferencesGetSelectionPaintingWithoutSelectionGapsEnabled(WKPreferencesRef preferencesRef)
1763 {
1764     return toImpl(preferencesRef)->selectionPaintingWithoutSelectionGapsEnabled();
1765 }
1766
1767 void WKPreferencesSetAllowsPictureInPictureMediaPlayback(WKPreferencesRef preferencesRef, bool enabled)
1768 {
1769     toImpl(preferencesRef)->setAllowsPictureInPictureMediaPlayback(enabled);
1770 }
1771
1772 bool WKPreferencesGetAllowsPictureInPictureMediaPlayback(WKPreferencesRef preferencesRef)
1773 {
1774     return toImpl(preferencesRef)->allowsPictureInPictureMediaPlayback();
1775 }
1776
1777 WK_EXPORT bool WKPreferencesGetApplePayEnabled(WKPreferencesRef preferencesRef)
1778 {
1779     return WebKit::toImpl(preferencesRef)->applePayEnabled();
1780 }
1781
1782 void WKPreferencesSetApplePayEnabled(WKPreferencesRef preferencesRef, bool enabled)
1783 {
1784 #if ENABLE(APPLE_PAY)
1785     if (!WebPaymentCoordinatorProxy::platformSupportsPayments())
1786         enabled = false;
1787 #endif
1788     WebKit::toImpl(preferencesRef)->setApplePayEnabled(enabled);
1789 }
1790
1791 bool WKPreferencesGetApplePayCapabilityDisclosureAllowed(WKPreferencesRef preferencesRef)
1792 {
1793     return WebKit::toImpl(preferencesRef)->applePayCapabilityDisclosureAllowed();
1794 }
1795
1796 void WKPreferencesSetApplePayCapabilityDisclosureAllowed(WKPreferencesRef preferencesRef, bool allowed)
1797 {
1798     WebKit::toImpl(preferencesRef)->setApplePayCapabilityDisclosureAllowed(allowed);
1799 }
1800
1801 void WKPreferencesSetLinkPreloadEnabled(WKPreferencesRef preferencesRef, bool flag)
1802 {
1803     toImpl(preferencesRef)->setLinkPreloadEnabled(flag);
1804 }
1805
1806 bool WKPreferencesGetLinkPreloadEnabled(WKPreferencesRef preferencesRef)
1807 {
1808     return toImpl(preferencesRef)->linkPreloadEnabled();
1809 }
1810
1811 void WKPreferencesSetMediaPreloadingEnabled(WKPreferencesRef preferencesRef, bool flag)
1812 {
1813     toImpl(preferencesRef)->setMediaPreloadingEnabled(flag);
1814 }
1815
1816 bool WKPreferencesGetMediaPreloadingEnabled(WKPreferencesRef preferencesRef)
1817 {
1818     return toImpl(preferencesRef)->mediaPreloadingEnabled();
1819 }
1820
1821 void WKPreferencesSetLargeImageAsyncDecodingEnabled(WKPreferencesRef preferencesRef, bool flag)
1822 {
1823     toImpl(preferencesRef)->setLargeImageAsyncDecodingEnabled(flag);
1824 }
1825
1826 bool WKPreferencesGetLargeImageAsyncDecodingEnabled(WKPreferencesRef preferencesRef)
1827 {
1828     return toImpl(preferencesRef)->largeImageAsyncDecodingEnabled();
1829 }
1830
1831 void WKPreferencesSetAnimatedImageAsyncDecodingEnabled(WKPreferencesRef preferencesRef, bool flag)
1832 {
1833     toImpl(preferencesRef)->setAnimatedImageAsyncDecodingEnabled(flag);
1834 }
1835
1836 bool WKPreferencesGetAnimatedImageAsyncDecodingEnabled(WKPreferencesRef preferencesRef)
1837 {
1838     return toImpl(preferencesRef)->animatedImageAsyncDecodingEnabled();
1839 }
1840
1841 void WKPreferencesSetShouldSuppressKeyboardInputDuringProvisionalNavigation(WKPreferencesRef preferencesRef, bool flag)
1842 {
1843     toImpl(preferencesRef)->setShouldSuppressTextInputFromEditingDuringProvisionalNavigation(flag);
1844 }
1845
1846 bool WKPreferencesGetShouldSuppressKeyboardInputDuringProvisionalNavigation(WKPreferencesRef preferencesRef)
1847 {
1848     return toImpl(preferencesRef)->shouldSuppressTextInputFromEditingDuringProvisionalNavigation();
1849 }
1850
1851 void WKPreferencesSetMediaUserGestureInheritsFromDocument(WKPreferencesRef preferencesRef, bool flag)
1852 {
1853     toImpl(preferencesRef)->setMediaUserGestureInheritsFromDocument(flag);
1854 }
1855
1856 bool WKPreferencesGetMediaUserGestureInheritsFromDocument(WKPreferencesRef preferencesRef)
1857 {
1858     return toImpl(preferencesRef)->mediaUserGestureInheritsFromDocument();
1859 }
1860
1861 void WKPreferencesSetMediaContentTypesRequiringHardwareSupport(WKPreferencesRef preferencesRef, WKStringRef codecs)
1862 {
1863     toImpl(preferencesRef)->setMediaContentTypesRequiringHardwareSupport(toWTFString(codecs));
1864 }
1865
1866 WKStringRef WKPreferencesCopyMediaContentTypesRequiringHardwareSupport(WKPreferencesRef preferencesRef)
1867 {
1868     return toCopiedAPI(toImpl(preferencesRef)->mediaContentTypesRequiringHardwareSupport());
1869 }
1870
1871 void WKPreferencesSetIsSecureContextAttributeEnabled(WKPreferencesRef preferencesRef, bool flag)
1872 {
1873     toImpl(preferencesRef)->setIsSecureContextAttributeEnabled(flag);
1874 }
1875
1876 bool WKPreferencesGetIsSecureContextAttributeEnabled(WKPreferencesRef preferencesRef)
1877 {
1878     return toImpl(preferencesRef)->isSecureContextAttributeEnabled();
1879 }
1880
1881 bool WKPreferencesGetLegacyEncryptedMediaAPIEnabled(WKPreferencesRef preferencesRef)
1882 {
1883     return toImpl(preferencesRef)->legacyEncryptedMediaAPIEnabled();
1884 }
1885
1886 void WKPreferencesSetLegacyEncryptedMediaAPIEnabled(WKPreferencesRef preferencesRef, bool enabled)
1887 {
1888     return toImpl(preferencesRef)->setLegacyEncryptedMediaAPIEnabled(enabled);
1889 }
1890
1891 bool WKPreferencesGetAllowMediaContentTypesRequiringHardwareSupportAsFallback(WKPreferencesRef preferencesRef)
1892 {
1893     return toImpl(preferencesRef)->allowMediaContentTypesRequiringHardwareSupportAsFallback();
1894 }
1895
1896 void WKPreferencesSetAllowMediaContentTypesRequiringHardwareSupportAsFallback(WKPreferencesRef preferencesRef, bool allow)
1897 {
1898     return toImpl(preferencesRef)->setAllowMediaContentTypesRequiringHardwareSupportAsFallback(allow);
1899 }
1900
1901 void WKPreferencesSetInspectorAdditionsEnabled(WKPreferencesRef preferencesRef, bool flag)
1902 {
1903     toImpl(preferencesRef)->setInspectorAdditionsEnabled(flag);
1904 }
1905
1906 bool WKPreferencesGetInspectorAdditionsEnabled(WKPreferencesRef preferencesRef)
1907 {
1908     return toImpl(preferencesRef)->inspectorAdditionsEnabled();
1909 }
1910
1911 void WKPreferencesSetStorageAccessAPIEnabled(WKPreferencesRef preferencesRef, bool flag)
1912 {
1913     toImpl(preferencesRef)->setStorageAccessAPIEnabled(flag);
1914 }
1915
1916 bool WKPreferencesGetStorageAccessAPIEnabled(WKPreferencesRef preferencesRef)
1917 {
1918     return toImpl(preferencesRef)->storageAccessAPIEnabled();
1919 }
1920
1921 void WKPreferencesSetAccessibilityObjectModelEnabled(WKPreferencesRef preferencesRef, bool flag)
1922 {
1923     toImpl(preferencesRef)->setAccessibilityObjectModelEnabled(flag);
1924 }
1925
1926 bool WKPreferencesGetAccessibilityObjectModelEnabled(WKPreferencesRef preferencesRef)
1927 {
1928     return toImpl(preferencesRef)->accessibilityObjectModelEnabled();
1929 }
1930
1931 void WKPreferencesSetShouldAllowUserInstalledFonts(WKPreferencesRef preferencesRef, bool flag)
1932 {
1933     toImpl(preferencesRef)->setShouldAllowUserInstalledFonts(flag);
1934 }
1935
1936 bool WKPreferencesGetShouldAllowUserInstalledFonts(WKPreferencesRef preferencesRef)
1937 {
1938     return toImpl(preferencesRef)->shouldAllowUserInstalledFonts();
1939 }
1940
1941 void WKPreferencesSetMediaCapabilitiesEnabled(WKPreferencesRef preferencesRef, bool enabled)
1942 {
1943     toImpl(preferencesRef)->setMediaCapabilitiesEnabled(enabled);
1944 }
1945
1946 bool WKPreferencesGetMediaCapabilitiesEnabled(WKPreferencesRef preferencesRef)
1947 {
1948     return toImpl(preferencesRef)->mediaCapabilitiesEnabled();
1949 }
1950