1/*
2 * THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT EDIT.
3 *
4 * Copyright (C) 2017 Apple Inc. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
17 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
19 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
25 * THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28#include "config.h"
29#include "WebPreferences.h"
30
31#include "WebPreferencesKeys.h"
32
33namespace WebKit {
34
35void WebPreferences::setAccessibilityObjectModelEnabled(const bool& value)
36{
37 if (!m_store.setBoolValueForKey(WebPreferencesKey::accessibilityObjectModelEnabledKey(), value))
38 return;
39 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::accessibilityObjectModelEnabledKey(), value);
40}
41
42bool WebPreferences::accessibilityObjectModelEnabled() const
43{
44 return m_store.getBoolValueForKey(WebPreferencesKey::accessibilityObjectModelEnabledKey());
45}
46
47void WebPreferences::setAdClickAttributionDebugModeEnabled(const bool& value)
48{
49 if (!m_store.setBoolValueForKey(WebPreferencesKey::adClickAttributionDebugModeEnabledKey(), value))
50 return;
51 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::adClickAttributionDebugModeEnabledKey(), value);
52}
53
54bool WebPreferences::adClickAttributionDebugModeEnabled() const
55{
56 return m_store.getBoolValueForKey(WebPreferencesKey::adClickAttributionDebugModeEnabledKey());
57}
58
59void WebPreferences::setAdClickAttributionEnabled(const bool& value)
60{
61 if (!m_store.setBoolValueForKey(WebPreferencesKey::adClickAttributionEnabledKey(), value))
62 return;
63 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::adClickAttributionEnabledKey(), value);
64}
65
66bool WebPreferences::adClickAttributionEnabled() const
67{
68 return m_store.getBoolValueForKey(WebPreferencesKey::adClickAttributionEnabledKey());
69}
70
71void WebPreferences::setBlankAnchorTargetImpliesNoOpenerEnabled(const bool& value)
72{
73 if (!m_store.setBoolValueForKey(WebPreferencesKey::blankAnchorTargetImpliesNoOpenerEnabledKey(), value))
74 return;
75 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::blankAnchorTargetImpliesNoOpenerEnabledKey(), value);
76}
77
78bool WebPreferences::blankAnchorTargetImpliesNoOpenerEnabled() const
79{
80 return m_store.getBoolValueForKey(WebPreferencesKey::blankAnchorTargetImpliesNoOpenerEnabledKey());
81}
82
83void WebPreferences::setCSSCustomPropertiesAndValuesEnabled(const bool& value)
84{
85 if (!m_store.setBoolValueForKey(WebPreferencesKey::cssCustomPropertiesAndValuesEnabledKey(), value))
86 return;
87 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::cssCustomPropertiesAndValuesEnabledKey(), value);
88}
89
90bool WebPreferences::cssCustomPropertiesAndValuesEnabled() const
91{
92 return m_store.getBoolValueForKey(WebPreferencesKey::cssCustomPropertiesAndValuesEnabledKey());
93}
94
95void WebPreferences::setCSSPaintingAPIEnabled(const bool& value)
96{
97 if (!m_store.setBoolValueForKey(WebPreferencesKey::cssPaintingAPIEnabledKey(), value))
98 return;
99 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::cssPaintingAPIEnabledKey(), value);
100}
101
102bool WebPreferences::cssPaintingAPIEnabled() const
103{
104 return m_store.getBoolValueForKey(WebPreferencesKey::cssPaintingAPIEnabledKey());
105}
106
107void WebPreferences::setCSSTypedOMEnabled(const bool& value)
108{
109 if (!m_store.setBoolValueForKey(WebPreferencesKey::cssTypedOMEnabledKey(), value))
110 return;
111 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::cssTypedOMEnabledKey(), value);
112}
113
114bool WebPreferences::cssTypedOMEnabled() const
115{
116 return m_store.getBoolValueForKey(WebPreferencesKey::cssTypedOMEnabledKey());
117}
118
119void WebPreferences::setCoreMathMLEnabled(const bool& value)
120{
121 if (!m_store.setBoolValueForKey(WebPreferencesKey::coreMathMLEnabledKey(), value))
122 return;
123 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::coreMathMLEnabledKey(), value);
124}
125
126bool WebPreferences::coreMathMLEnabled() const
127{
128 return m_store.getBoolValueForKey(WebPreferencesKey::coreMathMLEnabledKey());
129}
130
131void WebPreferences::setDarkModeCSSEnabled(const bool& value)
132{
133 if (!m_store.setBoolValueForKey(WebPreferencesKey::darkModeCSSEnabledKey(), value))
134 return;
135 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::darkModeCSSEnabledKey(), value);
136}
137
138bool WebPreferences::darkModeCSSEnabled() const
139{
140 return m_store.getBoolValueForKey(WebPreferencesKey::darkModeCSSEnabledKey());
141}
142
143void WebPreferences::setFetchAPIKeepAliveEnabled(const bool& value)
144{
145 if (!m_store.setBoolValueForKey(WebPreferencesKey::fetchAPIKeepAliveEnabledKey(), value))
146 return;
147 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::fetchAPIKeepAliveEnabledKey(), value);
148}
149
150bool WebPreferences::fetchAPIKeepAliveEnabled() const
151{
152 return m_store.getBoolValueForKey(WebPreferencesKey::fetchAPIKeepAliveEnabledKey());
153}
154
155void WebPreferences::setHTTPSUpgradeEnabled(const bool& value)
156{
157 if (!m_store.setBoolValueForKey(WebPreferencesKey::httpSUpgradeEnabledKey(), value))
158 return;
159 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::httpSUpgradeEnabledKey(), value);
160}
161
162bool WebPreferences::httpSUpgradeEnabled() const
163{
164 return m_store.getBoolValueForKey(WebPreferencesKey::httpSUpgradeEnabledKey());
165}
166
167void WebPreferences::setImageBitmapOffscreenCanvasEnabled(const bool& value)
168{
169 if (!m_store.setBoolValueForKey(WebPreferencesKey::imageBitmapOffscreenCanvasEnabledKey(), value))
170 return;
171 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::imageBitmapOffscreenCanvasEnabledKey(), value);
172}
173
174bool WebPreferences::imageBitmapOffscreenCanvasEnabled() const
175{
176 return m_store.getBoolValueForKey(WebPreferencesKey::imageBitmapOffscreenCanvasEnabledKey());
177}
178
179void WebPreferences::setIntersectionObserverEnabled(const bool& value)
180{
181 if (!m_store.setBoolValueForKey(WebPreferencesKey::intersectionObserverEnabledKey(), value))
182 return;
183 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::intersectionObserverEnabledKey(), value);
184}
185
186bool WebPreferences::intersectionObserverEnabled() const
187{
188 return m_store.getBoolValueForKey(WebPreferencesKey::intersectionObserverEnabledKey());
189}
190
191void WebPreferences::setIsITPFirstPartyWebsiteDataRemovalEnabled(const bool& value)
192{
193 if (!m_store.setBoolValueForKey(WebPreferencesKey::isITPFirstPartyWebsiteDataRemovalEnabledKey(), value))
194 return;
195 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::isITPFirstPartyWebsiteDataRemovalEnabledKey(), value);
196}
197
198bool WebPreferences::isITPFirstPartyWebsiteDataRemovalEnabled() const
199{
200 return m_store.getBoolValueForKey(WebPreferencesKey::isITPFirstPartyWebsiteDataRemovalEnabledKey());
201}
202
203void WebPreferences::setLinkPrefetchEnabled(const bool& value)
204{
205 if (!m_store.setBoolValueForKey(WebPreferencesKey::linkPrefetchEnabledKey(), value))
206 return;
207 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::linkPrefetchEnabledKey(), value);
208}
209
210bool WebPreferences::linkPrefetchEnabled() const
211{
212 return m_store.getBoolValueForKey(WebPreferencesKey::linkPrefetchEnabledKey());
213}
214
215void WebPreferences::setLinkPreloadResponsiveImagesEnabled(const bool& value)
216{
217 if (!m_store.setBoolValueForKey(WebPreferencesKey::linkPreloadResponsiveImagesEnabledKey(), value))
218 return;
219 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::linkPreloadResponsiveImagesEnabledKey(), value);
220}
221
222bool WebPreferences::linkPreloadResponsiveImagesEnabled() const
223{
224 return m_store.getBoolValueForKey(WebPreferencesKey::linkPreloadResponsiveImagesEnabledKey());
225}
226
227void WebPreferences::setMediaCapabilitiesExtensionsEnabled(const bool& value)
228{
229 if (!m_store.setBoolValueForKey(WebPreferencesKey::mediaCapabilitiesExtensionsEnabledKey(), value))
230 return;
231 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::mediaCapabilitiesExtensionsEnabledKey(), value);
232}
233
234bool WebPreferences::mediaCapabilitiesExtensionsEnabled() const
235{
236 return m_store.getBoolValueForKey(WebPreferencesKey::mediaCapabilitiesExtensionsEnabledKey());
237}
238
239void WebPreferences::setMediaRecorderEnabled(const bool& value)
240{
241 if (!m_store.setBoolValueForKey(WebPreferencesKey::mediaRecorderEnabledKey(), value))
242 return;
243 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::mediaRecorderEnabledKey(), value);
244}
245
246bool WebPreferences::mediaRecorderEnabled() const
247{
248 return m_store.getBoolValueForKey(WebPreferencesKey::mediaRecorderEnabledKey());
249}
250
251void WebPreferences::setPageAtRuleSupportEnabled(const bool& value)
252{
253 if (!m_store.setBoolValueForKey(WebPreferencesKey::pageAtRuleSupportEnabledKey(), value))
254 return;
255 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::pageAtRuleSupportEnabledKey(), value);
256}
257
258bool WebPreferences::pageAtRuleSupportEnabled() const
259{
260 return m_store.getBoolValueForKey(WebPreferencesKey::pageAtRuleSupportEnabledKey());
261}
262
263void WebPreferences::setPointerEventsEnabled(const bool& value)
264{
265 if (!m_store.setBoolValueForKey(WebPreferencesKey::pointerEventsEnabledKey(), value))
266 return;
267 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::pointerEventsEnabledKey(), value);
268}
269
270bool WebPreferences::pointerEventsEnabled() const
271{
272 return m_store.getBoolValueForKey(WebPreferencesKey::pointerEventsEnabledKey());
273}
274
275void WebPreferences::setProcessSwapOnCrossSiteNavigationEnabled(const bool& value)
276{
277 if (!m_store.setBoolValueForKey(WebPreferencesKey::processSwapOnCrossSiteNavigationEnabledKey(), value))
278 return;
279 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::processSwapOnCrossSiteNavigationEnabledKey(), value);
280}
281
282bool WebPreferences::processSwapOnCrossSiteNavigationEnabled() const
283{
284 return m_store.getBoolValueForKey(WebPreferencesKey::processSwapOnCrossSiteNavigationEnabledKey());
285}
286
287void WebPreferences::setReferrerPolicyAttributeEnabled(const bool& value)
288{
289 if (!m_store.setBoolValueForKey(WebPreferencesKey::referrerPolicyAttributeEnabledKey(), value))
290 return;
291 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::referrerPolicyAttributeEnabledKey(), value);
292}
293
294bool WebPreferences::referrerPolicyAttributeEnabled() const
295{
296 return m_store.getBoolValueForKey(WebPreferencesKey::referrerPolicyAttributeEnabledKey());
297}
298
299void WebPreferences::setResizeObserverEnabled(const bool& value)
300{
301 if (!m_store.setBoolValueForKey(WebPreferencesKey::resizeObserverEnabledKey(), value))
302 return;
303 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::resizeObserverEnabledKey(), value);
304}
305
306bool WebPreferences::resizeObserverEnabled() const
307{
308 return m_store.getBoolValueForKey(WebPreferencesKey::resizeObserverEnabledKey());
309}
310
311void WebPreferences::setScreenCaptureEnabled(const bool& value)
312{
313 if (!m_store.setBoolValueForKey(WebPreferencesKey::screenCaptureEnabledKey(), value))
314 return;
315 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::screenCaptureEnabledKey(), value);
316}
317
318bool WebPreferences::screenCaptureEnabled() const
319{
320 return m_store.getBoolValueForKey(WebPreferencesKey::screenCaptureEnabledKey());
321}
322
323void WebPreferences::setServerTimingEnabled(const bool& value)
324{
325 if (!m_store.setBoolValueForKey(WebPreferencesKey::serverTimingEnabledKey(), value))
326 return;
327 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::serverTimingEnabledKey(), value);
328}
329
330bool WebPreferences::serverTimingEnabled() const
331{
332 return m_store.getBoolValueForKey(WebPreferencesKey::serverTimingEnabledKey());
333}
334
335void WebPreferences::setSpringTimingFunctionEnabled(const bool& value)
336{
337 if (!m_store.setBoolValueForKey(WebPreferencesKey::springTimingFunctionEnabledKey(), value))
338 return;
339 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::springTimingFunctionEnabledKey(), value);
340}
341
342bool WebPreferences::springTimingFunctionEnabled() const
343{
344 return m_store.getBoolValueForKey(WebPreferencesKey::springTimingFunctionEnabledKey());
345}
346
347void WebPreferences::setSyntheticEditingCommandsEnabled(const bool& value)
348{
349 if (!m_store.setBoolValueForKey(WebPreferencesKey::syntheticEditingCommandsEnabledKey(), value))
350 return;
351 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::syntheticEditingCommandsEnabledKey(), value);
352}
353
354bool WebPreferences::syntheticEditingCommandsEnabled() const
355{
356 return m_store.getBoolValueForKey(WebPreferencesKey::syntheticEditingCommandsEnabledKey());
357}
358
359void WebPreferences::setThirdPartyIframeRedirectBlockingEnabled(const bool& value)
360{
361 if (!m_store.setBoolValueForKey(WebPreferencesKey::thirdPartyIframeRedirectBlockingEnabledKey(), value))
362 return;
363 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::thirdPartyIframeRedirectBlockingEnabledKey(), value);
364}
365
366bool WebPreferences::thirdPartyIframeRedirectBlockingEnabled() const
367{
368 return m_store.getBoolValueForKey(WebPreferencesKey::thirdPartyIframeRedirectBlockingEnabledKey());
369}
370
371void WebPreferences::setVisualViewportAPIEnabled(const bool& value)
372{
373 if (!m_store.setBoolValueForKey(WebPreferencesKey::visualViewportAPIEnabledKey(), value))
374 return;
375 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::visualViewportAPIEnabledKey(), value);
376}
377
378bool WebPreferences::visualViewportAPIEnabled() const
379{
380 return m_store.getBoolValueForKey(WebPreferencesKey::visualViewportAPIEnabledKey());
381}
382
383void WebPreferences::setWebAnimationsCSSIntegrationEnabled(const bool& value)
384{
385 if (!m_store.setBoolValueForKey(WebPreferencesKey::webAnimationsCSSIntegrationEnabledKey(), value))
386 return;
387 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::webAnimationsCSSIntegrationEnabledKey(), value);
388}
389
390bool WebPreferences::webAnimationsCSSIntegrationEnabled() const
391{
392 return m_store.getBoolValueForKey(WebPreferencesKey::webAnimationsCSSIntegrationEnabledKey());
393}
394
395void WebPreferences::setWebAnimationsEnabled(const bool& value)
396{
397 if (!m_store.setBoolValueForKey(WebPreferencesKey::webAnimationsEnabledKey(), value))
398 return;
399 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::webAnimationsEnabledKey(), value);
400}
401
402bool WebPreferences::webAnimationsEnabled() const
403{
404 return m_store.getBoolValueForKey(WebPreferencesKey::webAnimationsEnabledKey());
405}
406
407void WebPreferences::setWebAuthenticationEnabled(const bool& value)
408{
409 if (!m_store.setBoolValueForKey(WebPreferencesKey::webAuthenticationEnabledKey(), value))
410 return;
411 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::webAuthenticationEnabledKey(), value);
412}
413
414bool WebPreferences::webAuthenticationEnabled() const
415{
416 return m_store.getBoolValueForKey(WebPreferencesKey::webAuthenticationEnabledKey());
417}
418
419void WebPreferences::setWebGL2Enabled(const bool& value)
420{
421 if (!m_store.setBoolValueForKey(WebPreferencesKey::webGL2EnabledKey(), value))
422 return;
423 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::webGL2EnabledKey(), value);
424}
425
426bool WebPreferences::webGL2Enabled() const
427{
428 return m_store.getBoolValueForKey(WebPreferencesKey::webGL2EnabledKey());
429}
430
431void WebPreferences::setWebGPUEnabled(const bool& value)
432{
433 if (!m_store.setBoolValueForKey(WebPreferencesKey::webGPUEnabledKey(), value))
434 return;
435 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::webGPUEnabledKey(), value);
436}
437
438bool WebPreferences::webGPUEnabled() const
439{
440 return m_store.getBoolValueForKey(WebPreferencesKey::webGPUEnabledKey());
441}
442
443void WebPreferences::setWebRTCH264SimulcastEnabled(const bool& value)
444{
445 if (!m_store.setBoolValueForKey(WebPreferencesKey::webRTCH264SimulcastEnabledKey(), value))
446 return;
447 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::webRTCH264SimulcastEnabledKey(), value);
448}
449
450bool WebPreferences::webRTCH264SimulcastEnabled() const
451{
452 return m_store.getBoolValueForKey(WebPreferencesKey::webRTCH264SimulcastEnabledKey());
453}
454
455void WebPreferences::setWebRTCMDNSICECandidatesEnabled(const bool& value)
456{
457 if (!m_store.setBoolValueForKey(WebPreferencesKey::webRTCMDNSICECandidatesEnabledKey(), value))
458 return;
459 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::webRTCMDNSICECandidatesEnabledKey(), value);
460}
461
462bool WebPreferences::webRTCMDNSICECandidatesEnabled() const
463{
464 return m_store.getBoolValueForKey(WebPreferencesKey::webRTCMDNSICECandidatesEnabledKey());
465}
466
467void WebPreferences::setWebRTCUnifiedPlanEnabled(const bool& value)
468{
469 if (!m_store.setBoolValueForKey(WebPreferencesKey::webRTCUnifiedPlanEnabledKey(), value))
470 return;
471 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::webRTCUnifiedPlanEnabledKey(), value);
472}
473
474bool WebPreferences::webRTCUnifiedPlanEnabled() const
475{
476 return m_store.getBoolValueForKey(WebPreferencesKey::webRTCUnifiedPlanEnabledKey());
477}
478
479void WebPreferences::setWebRTCVP8CodecEnabled(const bool& value)
480{
481 if (!m_store.setBoolValueForKey(WebPreferencesKey::webRTCVP8CodecEnabledKey(), value))
482 return;
483 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::webRTCVP8CodecEnabledKey(), value);
484}
485
486bool WebPreferences::webRTCVP8CodecEnabled() const
487{
488 return m_store.getBoolValueForKey(WebPreferencesKey::webRTCVP8CodecEnabledKey());
489}
490
491void WebPreferences::setWebSQLDisabled(const bool& value)
492{
493 if (!m_store.setBoolValueForKey(WebPreferencesKey::webSQLDisabledKey(), value))
494 return;
495 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::webSQLDisabledKey(), value);
496}
497
498bool WebPreferences::webSQLDisabled() const
499{
500 return m_store.getBoolValueForKey(WebPreferencesKey::webSQLDisabledKey());
501}
502
503void WebPreferences::setWebVREnabled(const bool& value)
504{
505 if (!m_store.setBoolValueForKey(WebPreferencesKey::webVREnabledKey(), value))
506 return;
507 updateBoolValueForExperimentalFeatureKey(WebPreferencesKey::webVREnabledKey(), value);
508}
509
510bool WebPreferences::webVREnabled() const
511{
512 return m_store.getBoolValueForKey(WebPreferencesKey::webVREnabledKey());
513}
514
515const Vector<RefPtr<API::Object>>& WebPreferences::experimentalFeatures()
516{
517 static NeverDestroyed<Vector<RefPtr<API::Object>>> features(std::initializer_list<RefPtr<API::Object>> {
518 API::ExperimentalFeature::create("Accessibility Object Model", "AccessibilityObjectModelEnabled", "Accessibility Object Model support", false, false),
519 API::ExperimentalFeature::create("Ad Click Attribution Debug Mode", "AdClickAttributionDebugModeEnabled", "Enable Ad Click Attribution Debug Mode", false, false),
520 API::ExperimentalFeature::create("Ad Click Attribution", "AdClickAttributionEnabled", "Enable Ad Click Attribution for Cross-Site Link Navigations", false, false),
521 API::ExperimentalFeature::create("Blank anchor target implies rel=noopener", "BlankAnchorTargetImpliesNoOpenerEnabled", "target=_blank on anchor elements implies rel=noopener", true, false),
522 API::ExperimentalFeature::create("CSS Custom Properties and Values API", "CSSCustomPropertiesAndValuesEnabled", "Enable CSS Custom Properties and Values API", false, false),
523#if ENABLE(CSS_PAINTING_API)
524 API::ExperimentalFeature::create("CSS Painting API", "CSSPaintingAPIEnabled", "Enable the CSS Painting API", false, false),
525#endif
526#if ENABLE(CSS_TYPED_OM)
527 API::ExperimentalFeature::create("CSS Typed OM", "CSSTypedOMEnabled", "Enable the CSS Typed OM", false, false),
528#endif
529 API::ExperimentalFeature::create("MathML Core", "CoreMathMLEnabled", "Disable features removed from the MathML Core spec.", DEFAULT_CORE_MATHML_ENABLED, false),
530#if ENABLE(DARK_MODE_CSS)
531 API::ExperimentalFeature::create("Dark Mode CSS Support", "DarkModeCSSEnabled", "Enable Dark Mode CSS Support", true, false),
532#endif
533 API::ExperimentalFeature::create("Fetch API Request KeepAlive", "FetchAPIKeepAliveEnabled", "Enable Fetch API Request KeepAlive", true, false),
534 API::ExperimentalFeature::create("Automatic HTTPS upgrade", "HTTPSUpgradeEnabled", "Automatic HTTPS upgrade for known supported sites", false, false),
535 API::ExperimentalFeature::create("ImageBitmap and OffscreenCanvas", "ImageBitmapOffscreenCanvasEnabled", "Support for the ImageBitmap and OffscreenCanvas APIs", DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, false),
536#if ENABLE(INTERSECTION_OBSERVER)
537 API::ExperimentalFeature::create("Intersection Observer", "IntersectionObserverEnabled", "Enable Intersection Observer support", true, false),
538#endif
539 API::ExperimentalFeature::create("ITP First Party Website Data Removal", "IsITPFirstPartyWebsiteDataRemovalEnabled", "Enable Intelligent Tracking Prevention First Party Website Data Removal", true, false),
540 API::ExperimentalFeature::create("LinkPrefetch", "LinkPrefetchEnabled", "Enable LinkedPrefetch", false, false),
541 API::ExperimentalFeature::create("Link preload responsive images", "LinkPreloadResponsiveImagesEnabled", "Enable link preload responsive images", false, false),
542 API::ExperimentalFeature::create("Media Capabilities Extensions", "MediaCapabilitiesExtensionsEnabled", "Media Capabilities Extensions", true, false),
543#if ENABLE(MEDIA_STREAM)
544 API::ExperimentalFeature::create("MediaRecorder", "MediaRecorderEnabled", "MediaRecorder", false, false),
545#endif
546 API::ExperimentalFeature::create("@page CSS at-rule support", "PageAtRuleSupportEnabled", "Enable @page support", false, false),
547 API::ExperimentalFeature::create("Pointer Events", "PointerEventsEnabled", "Enable Pointer Events", true, false),
548 API::ExperimentalFeature::create("Swap Processes on Cross-Site Navigation", "ProcessSwapOnCrossSiteNavigationEnabled", "Swap WebContent processes on cross-site navigations", DEFAULT_PROCESS_SWAP_ON_CROSS_SITE_NAVIGATION_ENABLED, false),
549 API::ExperimentalFeature::create("Referrer Policy attribute", "ReferrerPolicyAttributeEnabled", "Enable Referrer Policy attribute", false, false),
550#if ENABLE(RESIZE_OBSERVER)
551 API::ExperimentalFeature::create("Resize Observer", "ResizeObserverEnabled", "Enable Resize Observer support", false, false),
552#endif
553#if ENABLE(MEDIA_STREAM) && PLATFORM(MAC)
554 API::ExperimentalFeature::create("ScreenCapture", "ScreenCaptureEnabled", "Enable ScreenCapture", true, false),
555#endif
556 API::ExperimentalFeature::create("Server Timing", "ServerTimingEnabled", "Enable Server Timing API", false, false),
557 API::ExperimentalFeature::create("CSS Spring Animations", "SpringTimingFunctionEnabled", "CSS Spring Animation prototype", DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, false),
558 API::ExperimentalFeature::create("Synthetic Editing Commands", "SyntheticEditingCommandsEnabled", "Enable Synthetic Editing Commands", true, false),
559 API::ExperimentalFeature::create("Block top-level redirects by third-party iframes", "ThirdPartyIframeRedirectBlockingEnabled", "Block top-level redirects by third-party iframes", true, false),
560 API::ExperimentalFeature::create("Visual Viewport API", "VisualViewportAPIEnabled", "Enable Visual Viewport API", true, false),
561 API::ExperimentalFeature::create("CSS Animations via Web Animations", "WebAnimationsCSSIntegrationEnabled", "Expose CSS Animations and CSS Transitions through getAnimations()", false, false),
562 API::ExperimentalFeature::create("Web Animations", "WebAnimationsEnabled", "Web Animations prototype", DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, false),
563#if ENABLE(WEB_AUTHN)
564 API::ExperimentalFeature::create("Web Authentication", "WebAuthenticationEnabled", "Enable Web Authentication support", DEFAULT_WEB_AUTHENTICATION_ENABLED, false),
565#endif
566#if ENABLE(WEBGL2)
567 API::ExperimentalFeature::create("WebGL 2.0", "WebGL2Enabled", "WebGL 2 prototype", false, false),
568#endif
569#if ENABLE(WEBGPU)
570 API::ExperimentalFeature::create("WebGPU", "WebGPUEnabled", "WebGPU Sketch prototype", false, false),
571#endif
572#if ENABLE(WEB_RTC)
573 API::ExperimentalFeature::create("WebRTC H264 Simulcast", "WebRTCH264SimulcastEnabled", "Enable WebRTC H264 Simulcast", true, false),
574#endif
575#if ENABLE(WEB_RTC)
576 API::ExperimentalFeature::create("WebRTC mDNS ICE candidates", "WebRTCMDNSICECandidatesEnabled", "Enable WebRTC mDNS ICE candidates", true, false),
577#endif
578#if ENABLE(WEB_RTC)
579 API::ExperimentalFeature::create("WebRTC Unified Plan", "WebRTCUnifiedPlanEnabled", "Use WebRTC Unified Plan", true, false),
580#endif
581#if ENABLE(WEB_RTC)
582 API::ExperimentalFeature::create("WebRTC VP8 codec", "WebRTCVP8CodecEnabled", "Enable WebRTC VP8 codec", true, false),
583#endif
584 API::ExperimentalFeature::create("Disable Web SQL", "WebSQLDisabled", "Disable Web SQL", true, false),
585#if PLATFORM(GTK) || PLATFORM(WPE)
586 API::ExperimentalFeature::create("WebVR", "WebVREnabled", "WebVR Module support", DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, false),
587#endif
588 });
589
590 return features;
591}
592
593bool WebPreferences::isFeatureEnabled(const API::ExperimentalFeature& feature) const
594{
595 struct FeatureGetterMapping {
596 const char* name;
597 bool (WebPreferences::*function) () const;
598 };
599
600 static FeatureGetterMapping getters[] = {
601 { "AccessibilityObjectModelEnabled", &WebPreferences::accessibilityObjectModelEnabled },
602 { "AdClickAttributionDebugModeEnabled", &WebPreferences::adClickAttributionDebugModeEnabled },
603 { "AdClickAttributionEnabled", &WebPreferences::adClickAttributionEnabled },
604 { "BlankAnchorTargetImpliesNoOpenerEnabled", &WebPreferences::blankAnchorTargetImpliesNoOpenerEnabled },
605 { "CSSCustomPropertiesAndValuesEnabled", &WebPreferences::cssCustomPropertiesAndValuesEnabled },
606#if ENABLE(CSS_PAINTING_API)
607 { "CSSPaintingAPIEnabled", &WebPreferences::cssPaintingAPIEnabled },
608#endif
609#if ENABLE(CSS_TYPED_OM)
610 { "CSSTypedOMEnabled", &WebPreferences::cssTypedOMEnabled },
611#endif
612 { "CoreMathMLEnabled", &WebPreferences::coreMathMLEnabled },
613#if ENABLE(DARK_MODE_CSS)
614 { "DarkModeCSSEnabled", &WebPreferences::darkModeCSSEnabled },
615#endif
616 { "FetchAPIKeepAliveEnabled", &WebPreferences::fetchAPIKeepAliveEnabled },
617 { "HTTPSUpgradeEnabled", &WebPreferences::httpSUpgradeEnabled },
618 { "ImageBitmapOffscreenCanvasEnabled", &WebPreferences::imageBitmapOffscreenCanvasEnabled },
619#if ENABLE(INTERSECTION_OBSERVER)
620 { "IntersectionObserverEnabled", &WebPreferences::intersectionObserverEnabled },
621#endif
622 { "IsITPFirstPartyWebsiteDataRemovalEnabled", &WebPreferences::isITPFirstPartyWebsiteDataRemovalEnabled },
623 { "LinkPrefetchEnabled", &WebPreferences::linkPrefetchEnabled },
624 { "LinkPreloadResponsiveImagesEnabled", &WebPreferences::linkPreloadResponsiveImagesEnabled },
625 { "MediaCapabilitiesExtensionsEnabled", &WebPreferences::mediaCapabilitiesExtensionsEnabled },
626#if ENABLE(MEDIA_STREAM)
627 { "MediaRecorderEnabled", &WebPreferences::mediaRecorderEnabled },
628#endif
629 { "PageAtRuleSupportEnabled", &WebPreferences::pageAtRuleSupportEnabled },
630 { "PointerEventsEnabled", &WebPreferences::pointerEventsEnabled },
631 { "ProcessSwapOnCrossSiteNavigationEnabled", &WebPreferences::processSwapOnCrossSiteNavigationEnabled },
632 { "ReferrerPolicyAttributeEnabled", &WebPreferences::referrerPolicyAttributeEnabled },
633#if ENABLE(RESIZE_OBSERVER)
634 { "ResizeObserverEnabled", &WebPreferences::resizeObserverEnabled },
635#endif
636#if ENABLE(MEDIA_STREAM) && PLATFORM(MAC)
637 { "ScreenCaptureEnabled", &WebPreferences::screenCaptureEnabled },
638#endif
639 { "ServerTimingEnabled", &WebPreferences::serverTimingEnabled },
640 { "SpringTimingFunctionEnabled", &WebPreferences::springTimingFunctionEnabled },
641 { "SyntheticEditingCommandsEnabled", &WebPreferences::syntheticEditingCommandsEnabled },
642 { "ThirdPartyIframeRedirectBlockingEnabled", &WebPreferences::thirdPartyIframeRedirectBlockingEnabled },
643 { "VisualViewportAPIEnabled", &WebPreferences::visualViewportAPIEnabled },
644 { "WebAnimationsCSSIntegrationEnabled", &WebPreferences::webAnimationsCSSIntegrationEnabled },
645 { "WebAnimationsEnabled", &WebPreferences::webAnimationsEnabled },
646#if ENABLE(WEB_AUTHN)
647 { "WebAuthenticationEnabled", &WebPreferences::webAuthenticationEnabled },
648#endif
649#if ENABLE(WEBGL2)
650 { "WebGL2Enabled", &WebPreferences::webGL2Enabled },
651#endif
652#if ENABLE(WEBGPU)
653 { "WebGPUEnabled", &WebPreferences::webGPUEnabled },
654#endif
655#if ENABLE(WEB_RTC)
656 { "WebRTCH264SimulcastEnabled", &WebPreferences::webRTCH264SimulcastEnabled },
657#endif
658#if ENABLE(WEB_RTC)
659 { "WebRTCMDNSICECandidatesEnabled", &WebPreferences::webRTCMDNSICECandidatesEnabled },
660#endif
661#if ENABLE(WEB_RTC)
662 { "WebRTCUnifiedPlanEnabled", &WebPreferences::webRTCUnifiedPlanEnabled },
663#endif
664#if ENABLE(WEB_RTC)
665 { "WebRTCVP8CodecEnabled", &WebPreferences::webRTCVP8CodecEnabled },
666#endif
667 { "WebSQLDisabled", &WebPreferences::webSQLDisabled },
668#if PLATFORM(GTK) || PLATFORM(WPE)
669 { "WebVREnabled", &WebPreferences::webVREnabled },
670#endif
671 };
672
673 const String& key = feature.key();
674
675 for (auto& getter : getters) {
676 if (key == getter.name)
677 return (this->*getter.function)();
678 }
679
680 return false;
681}
682
683void WebPreferences::setFeatureEnabled(const API::ExperimentalFeature& feature, bool value)
684{
685 setExperimentalFeatureEnabledForKey(feature.key(), value);
686}
687
688void WebPreferences::setExperimentalFeatureEnabledForKey(const String& key, bool value)
689{
690 struct FeatureSetterMapping {
691 const char* name;
692 void (WebPreferences::*function) (const bool&);
693 };
694
695 static FeatureSetterMapping setters[] = {
696 { "AccessibilityObjectModelEnabled", &WebPreferences::setAccessibilityObjectModelEnabled },
697 { "AdClickAttributionDebugModeEnabled", &WebPreferences::setAdClickAttributionDebugModeEnabled },
698 { "AdClickAttributionEnabled", &WebPreferences::setAdClickAttributionEnabled },
699 { "BlankAnchorTargetImpliesNoOpenerEnabled", &WebPreferences::setBlankAnchorTargetImpliesNoOpenerEnabled },
700 { "CSSCustomPropertiesAndValuesEnabled", &WebPreferences::setCSSCustomPropertiesAndValuesEnabled },
701#if ENABLE(CSS_PAINTING_API)
702 { "CSSPaintingAPIEnabled", &WebPreferences::setCSSPaintingAPIEnabled },
703#endif
704#if ENABLE(CSS_TYPED_OM)
705 { "CSSTypedOMEnabled", &WebPreferences::setCSSTypedOMEnabled },
706#endif
707 { "CoreMathMLEnabled", &WebPreferences::setCoreMathMLEnabled },
708#if ENABLE(DARK_MODE_CSS)
709 { "DarkModeCSSEnabled", &WebPreferences::setDarkModeCSSEnabled },
710#endif
711 { "FetchAPIKeepAliveEnabled", &WebPreferences::setFetchAPIKeepAliveEnabled },
712 { "HTTPSUpgradeEnabled", &WebPreferences::setHTTPSUpgradeEnabled },
713 { "ImageBitmapOffscreenCanvasEnabled", &WebPreferences::setImageBitmapOffscreenCanvasEnabled },
714#if ENABLE(INTERSECTION_OBSERVER)
715 { "IntersectionObserverEnabled", &WebPreferences::setIntersectionObserverEnabled },
716#endif
717 { "IsITPFirstPartyWebsiteDataRemovalEnabled", &WebPreferences::setIsITPFirstPartyWebsiteDataRemovalEnabled },
718 { "LinkPrefetchEnabled", &WebPreferences::setLinkPrefetchEnabled },
719 { "LinkPreloadResponsiveImagesEnabled", &WebPreferences::setLinkPreloadResponsiveImagesEnabled },
720 { "MediaCapabilitiesExtensionsEnabled", &WebPreferences::setMediaCapabilitiesExtensionsEnabled },
721#if ENABLE(MEDIA_STREAM)
722 { "MediaRecorderEnabled", &WebPreferences::setMediaRecorderEnabled },
723#endif
724 { "PageAtRuleSupportEnabled", &WebPreferences::setPageAtRuleSupportEnabled },
725 { "PointerEventsEnabled", &WebPreferences::setPointerEventsEnabled },
726 { "ProcessSwapOnCrossSiteNavigationEnabled", &WebPreferences::setProcessSwapOnCrossSiteNavigationEnabled },
727 { "ReferrerPolicyAttributeEnabled", &WebPreferences::setReferrerPolicyAttributeEnabled },
728#if ENABLE(RESIZE_OBSERVER)
729 { "ResizeObserverEnabled", &WebPreferences::setResizeObserverEnabled },
730#endif
731#if ENABLE(MEDIA_STREAM) && PLATFORM(MAC)
732 { "ScreenCaptureEnabled", &WebPreferences::setScreenCaptureEnabled },
733#endif
734 { "ServerTimingEnabled", &WebPreferences::setServerTimingEnabled },
735 { "SpringTimingFunctionEnabled", &WebPreferences::setSpringTimingFunctionEnabled },
736 { "SyntheticEditingCommandsEnabled", &WebPreferences::setSyntheticEditingCommandsEnabled },
737 { "ThirdPartyIframeRedirectBlockingEnabled", &WebPreferences::setThirdPartyIframeRedirectBlockingEnabled },
738 { "VisualViewportAPIEnabled", &WebPreferences::setVisualViewportAPIEnabled },
739 { "WebAnimationsCSSIntegrationEnabled", &WebPreferences::setWebAnimationsCSSIntegrationEnabled },
740 { "WebAnimationsEnabled", &WebPreferences::setWebAnimationsEnabled },
741#if ENABLE(WEB_AUTHN)
742 { "WebAuthenticationEnabled", &WebPreferences::setWebAuthenticationEnabled },
743#endif
744#if ENABLE(WEBGL2)
745 { "WebGL2Enabled", &WebPreferences::setWebGL2Enabled },
746#endif
747#if ENABLE(WEBGPU)
748 { "WebGPUEnabled", &WebPreferences::setWebGPUEnabled },
749#endif
750#if ENABLE(WEB_RTC)
751 { "WebRTCH264SimulcastEnabled", &WebPreferences::setWebRTCH264SimulcastEnabled },
752#endif
753#if ENABLE(WEB_RTC)
754 { "WebRTCMDNSICECandidatesEnabled", &WebPreferences::setWebRTCMDNSICECandidatesEnabled },
755#endif
756#if ENABLE(WEB_RTC)
757 { "WebRTCUnifiedPlanEnabled", &WebPreferences::setWebRTCUnifiedPlanEnabled },
758#endif
759#if ENABLE(WEB_RTC)
760 { "WebRTCVP8CodecEnabled", &WebPreferences::setWebRTCVP8CodecEnabled },
761#endif
762 { "WebSQLDisabled", &WebPreferences::setWebSQLDisabled },
763#if PLATFORM(GTK) || PLATFORM(WPE)
764 { "WebVREnabled", &WebPreferences::setWebVREnabled },
765#endif
766 };
767
768 for (auto& setter : setters) {
769 if (key == setter.name) {
770 (this->*setter.function)(value);
771 return;
772 }
773 }
774}
775
776void WebPreferences::enableAllExperimentalFeatures()
777{
778 setAccessibilityObjectModelEnabled(true);
779 setAdClickAttributionDebugModeEnabled(true);
780 setAdClickAttributionEnabled(true);
781 setBlankAnchorTargetImpliesNoOpenerEnabled(true);
782 setCSSCustomPropertiesAndValuesEnabled(true);
783#if ENABLE(CSS_PAINTING_API)
784 setCSSPaintingAPIEnabled(true);
785#endif
786#if ENABLE(CSS_TYPED_OM)
787 setCSSTypedOMEnabled(true);
788#endif
789 setCoreMathMLEnabled(true);
790#if ENABLE(DARK_MODE_CSS)
791 setDarkModeCSSEnabled(true);
792#endif
793 setFetchAPIKeepAliveEnabled(true);
794 setHTTPSUpgradeEnabled(true);
795 setImageBitmapOffscreenCanvasEnabled(true);
796#if ENABLE(INTERSECTION_OBSERVER)
797 setIntersectionObserverEnabled(true);
798#endif
799 setIsITPFirstPartyWebsiteDataRemovalEnabled(true);
800 setLinkPrefetchEnabled(true);
801 setLinkPreloadResponsiveImagesEnabled(true);
802 setMediaCapabilitiesExtensionsEnabled(true);
803#if ENABLE(MEDIA_STREAM)
804 setMediaRecorderEnabled(true);
805#endif
806 setPageAtRuleSupportEnabled(true);
807 setPointerEventsEnabled(true);
808 setProcessSwapOnCrossSiteNavigationEnabled(true);
809 setReferrerPolicyAttributeEnabled(true);
810#if ENABLE(RESIZE_OBSERVER)
811 setResizeObserverEnabled(true);
812#endif
813#if ENABLE(MEDIA_STREAM) && PLATFORM(MAC)
814 setScreenCaptureEnabled(true);
815#endif
816 setServerTimingEnabled(true);
817 setSpringTimingFunctionEnabled(true);
818 setSyntheticEditingCommandsEnabled(true);
819 setThirdPartyIframeRedirectBlockingEnabled(true);
820 setVisualViewportAPIEnabled(true);
821 setWebAnimationsCSSIntegrationEnabled(true);
822 setWebAnimationsEnabled(true);
823#if ENABLE(WEB_AUTHN)
824 setWebAuthenticationEnabled(true);
825#endif
826#if ENABLE(WEBGL2)
827 setWebGL2Enabled(true);
828#endif
829#if ENABLE(WEBGPU)
830 setWebGPUEnabled(true);
831#endif
832#if ENABLE(WEB_RTC)
833 setWebRTCH264SimulcastEnabled(true);
834#endif
835#if ENABLE(WEB_RTC)
836 setWebRTCMDNSICECandidatesEnabled(true);
837#endif
838#if ENABLE(WEB_RTC)
839 setWebRTCUnifiedPlanEnabled(true);
840#endif
841#if ENABLE(WEB_RTC)
842 setWebRTCVP8CodecEnabled(true);
843#endif
844 setWebSQLDisabled(true);
845#if PLATFORM(GTK) || PLATFORM(WPE)
846 setWebVREnabled(true);
847#endif
848}
849
850}
851