1/*
2* THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT EDIT.
3*
4* Copyright (C) 2018 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::setApplePayRemoteUIEnabled(const bool& value)
36{
37 if (!m_store.setBoolValueForKey(WebPreferencesKey::applePayRemoteUIEnabledKey(), value))
38 return;
39 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::applePayRemoteUIEnabledKey(), value);
40}
41
42bool WebPreferences::applePayRemoteUIEnabled() const
43{
44 return m_store.getBoolValueForKey(WebPreferencesKey::applePayRemoteUIEnabledKey());
45}
46
47void WebPreferences::setAriaReflectionEnabled(const bool& value)
48{
49 if (!m_store.setBoolValueForKey(WebPreferencesKey::ariaReflectionEnabledKey(), value))
50 return;
51 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::ariaReflectionEnabledKey(), value);
52}
53
54bool WebPreferences::ariaReflectionEnabled() const
55{
56 return m_store.getBoolValueForKey(WebPreferencesKey::ariaReflectionEnabledKey());
57}
58
59void WebPreferences::setAsyncFrameScrollingEnabled(const bool& value)
60{
61 if (!m_store.setBoolValueForKey(WebPreferencesKey::asyncFrameScrollingEnabledKey(), value))
62 return;
63 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::asyncFrameScrollingEnabledKey(), value);
64}
65
66bool WebPreferences::asyncFrameScrollingEnabled() const
67{
68 return m_store.getBoolValueForKey(WebPreferencesKey::asyncFrameScrollingEnabledKey());
69}
70
71void WebPreferences::setAsyncOverflowScrollingEnabled(const bool& value)
72{
73 if (!m_store.setBoolValueForKey(WebPreferencesKey::asyncOverflowScrollingEnabledKey(), value))
74 return;
75 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::asyncOverflowScrollingEnabledKey(), value);
76}
77
78bool WebPreferences::asyncOverflowScrollingEnabled() const
79{
80 return m_store.getBoolValueForKey(WebPreferencesKey::asyncOverflowScrollingEnabledKey());
81}
82
83void WebPreferences::setBlockingOfSmallPluginsEnabled(const bool& value)
84{
85 if (!m_store.setBoolValueForKey(WebPreferencesKey::blockingOfSmallPluginsEnabledKey(), value))
86 return;
87 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::blockingOfSmallPluginsEnabledKey(), value);
88}
89
90bool WebPreferences::blockingOfSmallPluginsEnabled() const
91{
92 return m_store.getBoolValueForKey(WebPreferencesKey::blockingOfSmallPluginsEnabledKey());
93}
94
95void WebPreferences::setCSSLogicalEnabled(const bool& value)
96{
97 if (!m_store.setBoolValueForKey(WebPreferencesKey::cssLogicalEnabledKey(), value))
98 return;
99 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::cssLogicalEnabledKey(), value);
100}
101
102bool WebPreferences::cssLogicalEnabled() const
103{
104 return m_store.getBoolValueForKey(WebPreferencesKey::cssLogicalEnabledKey());
105}
106
107void WebPreferences::setCSSOMViewScrollingAPIEnabled(const bool& value)
108{
109 if (!m_store.setBoolValueForKey(WebPreferencesKey::cssOMViewScrollingAPIEnabledKey(), value))
110 return;
111 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::cssOMViewScrollingAPIEnabledKey(), value);
112}
113
114bool WebPreferences::cssOMViewScrollingAPIEnabled() const
115{
116 return m_store.getBoolValueForKey(WebPreferencesKey::cssOMViewScrollingAPIEnabledKey());
117}
118
119void WebPreferences::setCaptureAudioInUIProcessEnabled(const bool& value)
120{
121 if (!m_store.setBoolValueForKey(WebPreferencesKey::captureAudioInUIProcessEnabledKey(), value))
122 return;
123 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::captureAudioInUIProcessEnabledKey(), value);
124}
125
126bool WebPreferences::captureAudioInUIProcessEnabled() const
127{
128 return m_store.getBoolValueForKey(WebPreferencesKey::captureAudioInUIProcessEnabledKey());
129}
130
131void WebPreferences::setCaptureVideoInUIProcessEnabled(const bool& value)
132{
133 if (!m_store.setBoolValueForKey(WebPreferencesKey::captureVideoInUIProcessEnabledKey(), value))
134 return;
135 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::captureVideoInUIProcessEnabledKey(), value);
136}
137
138bool WebPreferences::captureVideoInUIProcessEnabled() const
139{
140 return m_store.getBoolValueForKey(WebPreferencesKey::captureVideoInUIProcessEnabledKey());
141}
142
143void WebPreferences::setDOMPasteAccessRequestsEnabled(const bool& value)
144{
145 if (!m_store.setBoolValueForKey(WebPreferencesKey::domPasteAccessRequestsEnabledKey(), value))
146 return;
147 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::domPasteAccessRequestsEnabledKey(), value);
148}
149
150bool WebPreferences::domPasteAccessRequestsEnabled() const
151{
152 return m_store.getBoolValueForKey(WebPreferencesKey::domPasteAccessRequestsEnabledKey());
153}
154
155void WebPreferences::setDataListElementEnabled(const bool& value)
156{
157 if (!m_store.setBoolValueForKey(WebPreferencesKey::dataListElementEnabledKey(), value))
158 return;
159 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::dataListElementEnabledKey(), value);
160}
161
162bool WebPreferences::dataListElementEnabled() const
163{
164 return m_store.getBoolValueForKey(WebPreferencesKey::dataListElementEnabledKey());
165}
166
167void WebPreferences::setExperimentalPlugInSandboxProfilesEnabled(const bool& value)
168{
169 if (!m_store.setBoolValueForKey(WebPreferencesKey::experimentalPlugInSandboxProfilesEnabledKey(), value))
170 return;
171 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::experimentalPlugInSandboxProfilesEnabledKey(), value);
172}
173
174bool WebPreferences::experimentalPlugInSandboxProfilesEnabled() const
175{
176 return m_store.getBoolValueForKey(WebPreferencesKey::experimentalPlugInSandboxProfilesEnabledKey());
177}
178
179void WebPreferences::setFastClicksEverywhere(const bool& value)
180{
181 if (!m_store.setBoolValueForKey(WebPreferencesKey::fastClicksEverywhereKey(), value))
182 return;
183 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::fastClicksEverywhereKey(), value);
184}
185
186bool WebPreferences::fastClicksEverywhere() const
187{
188 return m_store.getBoolValueForKey(WebPreferencesKey::fastClicksEverywhereKey());
189}
190
191void WebPreferences::setFasterClicksEnabled(const bool& value)
192{
193 if (!m_store.setBoolValueForKey(WebPreferencesKey::fasterClicksEnabledKey(), value))
194 return;
195 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::fasterClicksEnabledKey(), value);
196}
197
198bool WebPreferences::fasterClicksEnabled() const
199{
200 return m_store.getBoolValueForKey(WebPreferencesKey::fasterClicksEnabledKey());
201}
202
203void WebPreferences::setFrameFlatteningEnabled(const bool& value)
204{
205 if (!m_store.setBoolValueForKey(WebPreferencesKey::frameFlatteningEnabledKey(), value))
206 return;
207 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::frameFlatteningEnabledKey(), value);
208}
209
210bool WebPreferences::frameFlatteningEnabled() const
211{
212 return m_store.getBoolValueForKey(WebPreferencesKey::frameFlatteningEnabledKey());
213}
214
215void WebPreferences::setFullScreenEnabled(const bool& value)
216{
217 if (!m_store.setBoolValueForKey(WebPreferencesKey::fullScreenEnabledKey(), value))
218 return;
219 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::fullScreenEnabledKey(), value);
220}
221
222bool WebPreferences::fullScreenEnabled() const
223{
224 return m_store.getBoolValueForKey(WebPreferencesKey::fullScreenEnabledKey());
225}
226
227void WebPreferences::setInputTypeColorEnabled(const bool& value)
228{
229 if (!m_store.setBoolValueForKey(WebPreferencesKey::inputTypeColorEnabledKey(), value))
230 return;
231 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::inputTypeColorEnabledKey(), value);
232}
233
234bool WebPreferences::inputTypeColorEnabled() const
235{
236 return m_store.getBoolValueForKey(WebPreferencesKey::inputTypeColorEnabledKey());
237}
238
239void WebPreferences::setIsITPDatabaseEnabled(const bool& value)
240{
241 if (!m_store.setBoolValueForKey(WebPreferencesKey::isITPDatabaseEnabledKey(), value))
242 return;
243 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::isITPDatabaseEnabledKey(), value);
244}
245
246bool WebPreferences::isITPDatabaseEnabled() const
247{
248 return m_store.getBoolValueForKey(WebPreferencesKey::isITPDatabaseEnabledKey());
249}
250
251void WebPreferences::setLayoutFormattingContextEnabled(const bool& value)
252{
253 if (!m_store.setBoolValueForKey(WebPreferencesKey::layoutFormattingContextEnabledKey(), value))
254 return;
255 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::layoutFormattingContextEnabledKey(), value);
256}
257
258bool WebPreferences::layoutFormattingContextEnabled() const
259{
260 return m_store.getBoolValueForKey(WebPreferencesKey::layoutFormattingContextEnabledKey());
261}
262
263void WebPreferences::setLegacyOverflowScrollingTouchEnabled(const bool& value)
264{
265 if (!m_store.setBoolValueForKey(WebPreferencesKey::legacyOverflowScrollingTouchEnabledKey(), value))
266 return;
267 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::legacyOverflowScrollingTouchEnabledKey(), value);
268}
269
270bool WebPreferences::legacyOverflowScrollingTouchEnabled() const
271{
272 return m_store.getBoolValueForKey(WebPreferencesKey::legacyOverflowScrollingTouchEnabledKey());
273}
274
275void WebPreferences::setMouseEventsSimulationEnabled(const bool& value)
276{
277 if (!m_store.setBoolValueForKey(WebPreferencesKey::mouseEventsSimulationEnabledKey(), value))
278 return;
279 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::mouseEventsSimulationEnabledKey(), value);
280}
281
282bool WebPreferences::mouseEventsSimulationEnabled() const
283{
284 return m_store.getBoolValueForKey(WebPreferencesKey::mouseEventsSimulationEnabledKey());
285}
286
287void WebPreferences::setRestrictedHTTPResponseAccess(const bool& value)
288{
289 if (!m_store.setBoolValueForKey(WebPreferencesKey::restrictedHTTPResponseAccessKey(), value))
290 return;
291 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::restrictedHTTPResponseAccessKey(), value);
292}
293
294bool WebPreferences::restrictedHTTPResponseAccess() const
295{
296 return m_store.getBoolValueForKey(WebPreferencesKey::restrictedHTTPResponseAccessKey());
297}
298
299void WebPreferences::setSelectionAcrossShadowBoundariesEnabled(const bool& value)
300{
301 if (!m_store.setBoolValueForKey(WebPreferencesKey::selectionAcrossShadowBoundariesEnabledKey(), value))
302 return;
303 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::selectionAcrossShadowBoundariesEnabledKey(), value);
304}
305
306bool WebPreferences::selectionAcrossShadowBoundariesEnabled() const
307{
308 return m_store.getBoolValueForKey(WebPreferencesKey::selectionAcrossShadowBoundariesEnabledKey());
309}
310
311void WebPreferences::setServiceWorkersEnabled(const bool& value)
312{
313 if (!m_store.setBoolValueForKey(WebPreferencesKey::serviceWorkersEnabledKey(), value))
314 return;
315 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::serviceWorkersEnabledKey(), value);
316}
317
318bool WebPreferences::serviceWorkersEnabled() const
319{
320 return m_store.getBoolValueForKey(WebPreferencesKey::serviceWorkersEnabledKey());
321}
322
323void WebPreferences::setUndoManagerAPIEnabled(const bool& value)
324{
325 if (!m_store.setBoolValueForKey(WebPreferencesKey::undoManagerAPIEnabledKey(), value))
326 return;
327 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::undoManagerAPIEnabledKey(), value);
328}
329
330bool WebPreferences::undoManagerAPIEnabled() const
331{
332 return m_store.getBoolValueForKey(WebPreferencesKey::undoManagerAPIEnabledKey());
333}
334
335void WebPreferences::setWebAPIStatisticsEnabled(const bool& value)
336{
337 if (!m_store.setBoolValueForKey(WebPreferencesKey::webAPIStatisticsEnabledKey(), value))
338 return;
339 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::webAPIStatisticsEnabledKey(), value);
340}
341
342bool WebPreferences::webAPIStatisticsEnabled() const
343{
344 return m_store.getBoolValueForKey(WebPreferencesKey::webAPIStatisticsEnabledKey());
345}
346
347void WebPreferences::setWebGLCompressedTextureASTCSupportEnabled(const bool& value)
348{
349 if (!m_store.setBoolValueForKey(WebPreferencesKey::webGLCompressedTextureASTCSupportEnabledKey(), value))
350 return;
351 updateBoolValueForInternalDebugFeatureKey(WebPreferencesKey::webGLCompressedTextureASTCSupportEnabledKey(), value);
352}
353
354bool WebPreferences::webGLCompressedTextureASTCSupportEnabled() const
355{
356 return m_store.getBoolValueForKey(WebPreferencesKey::webGLCompressedTextureASTCSupportEnabledKey());
357}
358
359const Vector<RefPtr<API::Object>>& WebPreferences::internalDebugFeatures()
360{
361 static NeverDestroyed<Vector<RefPtr<API::Object>>> features(std::initializer_list<RefPtr<API::Object>> {
362#if ENABLE(APPLE_PAY_REMOTE_UI)
363 API::InternalDebugFeature::create("Apple Pay Remote UI", "ApplePayRemoteUIEnabled", "Enable Apple Pay Remote UI", true, false),
364#endif
365 API::InternalDebugFeature::create("ARIA Reflection", "AriaReflectionEnabled", "ARIA Reflection support", true, false),
366 API::InternalDebugFeature::create("Async Frame Scrolling", "AsyncFrameScrollingEnabled", "Perform frame scrolling off the main thread", DEFAULT_ASYNC_FRAME_SCROLLING_ENABLED, false),
367 API::InternalDebugFeature::create("Async Overflow Scrolling", "AsyncOverflowScrollingEnabled", "Perform overflow scrolling off the main thread", DEFAULT_ASYNC_OVERFLOW_SCROLLING_ENABLED, false),
368 API::InternalDebugFeature::create("Block small plugins", "BlockingOfSmallPluginsEnabled", "Stop plugins smaller than a certain threshold from loading.", true, false),
369 API::InternalDebugFeature::create("CSS Logical Properties and Values", "CSSLogicalEnabled", "Enable CSS Logical Properties and Values", false, false),
370 API::InternalDebugFeature::create("CSSOM View Scrolling API", "CSSOMViewScrollingAPIEnabled", "Implement standard behavior for scrollLeft, scrollTop, scrollWidth, scrollHeight, scrollTo, scrollBy and scrollingElement.", true, false),
371#if ENABLE(MEDIA_STREAM)
372 API::InternalDebugFeature::create("Capture audio in UIProcess", "CaptureAudioInUIProcessEnabled", "Enable audio capture in UIProcess", DEFAULT_CAPTURE_AUDIO_IN_UIPROCESS, false),
373#endif
374#if ENABLE(MEDIA_STREAM)
375 API::InternalDebugFeature::create("Capture video in UIProcess", "CaptureVideoInUIProcessEnabled", "Enable video capture in UIProcess", false, false),
376#endif
377 API::InternalDebugFeature::create("DOM Paste Access Requests", "DOMPasteAccessRequestsEnabled", "Enable DOM Paste Access Requests", DEFAULT_DOM_PASTE_ACCESS_REQUESTS_ENABLED, false),
378#if ENABLE(DATALIST_ELEMENT)
379 API::InternalDebugFeature::create("DataList Element", "DataListElementEnabled", "Enable datalist elements", DEFAULT_DATALIST_ELEMENT_ENABLED, false),
380#endif
381 API::InternalDebugFeature::create("Sandbox Plug-Ins", "ExperimentalPlugInSandboxProfilesEnabled", "Enable Plug-In sandboxing", false, false),
382#if PLATFORM(IOS_FAMILY)
383 API::InternalDebugFeature::create("Fast clicks everywhere", "FastClicksEverywhere", "Force fast clicks on all pages", DEFAULT_FAST_CLICKS_EVERYWHERE, false),
384#endif
385#if PLATFORM(IOS_FAMILY)
386 API::InternalDebugFeature::create("Faster clicks", "FasterClicksEnabled", "Support faster clicks on zoomable pages", true, false),
387#endif
388 API::InternalDebugFeature::create("Frame flattening", "FrameFlatteningEnabled", "Enable frame flattening, which adjusts the height of an iframe to fit its contents", DEFAULT_FRAME_FLATTENING, false),
389#if ENABLE(FULLSCREEN_API)
390 API::InternalDebugFeature::create("Fullscreen API", "FullScreenEnabled", "Fullscreen API", false, EXPERIMENTAL_FULLSCREEN_API_HIDDEN),
391#endif
392#if ENABLE(INPUT_TYPE_COLOR)
393 API::InternalDebugFeature::create("Color Inputs", "InputTypeColorEnabled", "Enable input elements of type color", DEFAULT_INPUT_TYPE_COLOR_ENABLED, false),
394#endif
395 API::InternalDebugFeature::create("ITP Database Backend", "IsITPDatabaseEnabled", "Enable Intelligent Tracking Prevention Database Backend", false, false),
396#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
397 API::InternalDebugFeature::create("Next-gen layout", "LayoutFormattingContextEnabled", "Enable next-gen layout", false, false),
398#endif
399#if ENABLE(OVERFLOW_SCROLLING_TOUCH)
400 API::InternalDebugFeature::create("Legacy -webkit-overflow-scrolling property", "LegacyOverflowScrollingTouchEnabled", "Support the legacy -webkit-overflow-scrolling CSS property", true, false),
401#endif
402#if ENABLE(TOUCH_EVENTS)
403 API::InternalDebugFeature::create("Mouse events simulation", "MouseEventsSimulationEnabled", "Enable mouse events dispatch along with touch events on iOS", false, false),
404#endif
405 API::InternalDebugFeature::create("Filter HTTP Response for WebProcesses", "RestrictedHTTPResponseAccess", "Enable HTTP Response filtering for WebProcesses", true, false),
406 API::InternalDebugFeature::create("Selection across shadow DOM", "SelectionAcrossShadowBoundariesEnabled", "Allow user-initiated selection across shadow DOM boundaries", true, false),
407#if ENABLE(SERVICE_WORKER)
408 API::InternalDebugFeature::create("Service Workers", "ServiceWorkersEnabled", "Enable Service Workers", DEFAULT_SERVICE_WORKERS_ENABLED, false),
409#endif
410 API::InternalDebugFeature::create("UndoManager DOM API", "UndoManagerAPIEnabled", "Enable the UndoManager DOM API", false, false),
411 API::InternalDebugFeature::create("Web API Statistics", "WebAPIStatisticsEnabled", "Enable Web API Statistics", false, false),
412 API::InternalDebugFeature::create("ASTC Texture Support", "WebGLCompressedTextureASTCSupportEnabled", "Support for ASTC compressed texture formats in WebGL", false, false),
413 });
414
415 return features;
416}
417
418bool WebPreferences::isFeatureEnabled(const API::InternalDebugFeature& feature) const
419{
420 struct FeatureGetterMapping {
421 const char* name;
422 bool (WebPreferences::*function) () const;
423 };
424
425 static FeatureGetterMapping getters[] = {
426#if ENABLE(APPLE_PAY_REMOTE_UI)
427 { "ApplePayRemoteUIEnabled", &WebPreferences::applePayRemoteUIEnabled },
428#endif
429 { "AriaReflectionEnabled", &WebPreferences::ariaReflectionEnabled },
430 { "AsyncFrameScrollingEnabled", &WebPreferences::asyncFrameScrollingEnabled },
431 { "AsyncOverflowScrollingEnabled", &WebPreferences::asyncOverflowScrollingEnabled },
432 { "BlockingOfSmallPluginsEnabled", &WebPreferences::blockingOfSmallPluginsEnabled },
433 { "CSSLogicalEnabled", &WebPreferences::cssLogicalEnabled },
434 { "CSSOMViewScrollingAPIEnabled", &WebPreferences::cssOMViewScrollingAPIEnabled },
435#if ENABLE(MEDIA_STREAM)
436 { "CaptureAudioInUIProcessEnabled", &WebPreferences::captureAudioInUIProcessEnabled },
437#endif
438#if ENABLE(MEDIA_STREAM)
439 { "CaptureVideoInUIProcessEnabled", &WebPreferences::captureVideoInUIProcessEnabled },
440#endif
441 { "DOMPasteAccessRequestsEnabled", &WebPreferences::domPasteAccessRequestsEnabled },
442#if ENABLE(DATALIST_ELEMENT)
443 { "DataListElementEnabled", &WebPreferences::dataListElementEnabled },
444#endif
445 { "ExperimentalPlugInSandboxProfilesEnabled", &WebPreferences::experimentalPlugInSandboxProfilesEnabled },
446#if PLATFORM(IOS_FAMILY)
447 { "FastClicksEverywhere", &WebPreferences::fastClicksEverywhere },
448#endif
449#if PLATFORM(IOS_FAMILY)
450 { "FasterClicksEnabled", &WebPreferences::fasterClicksEnabled },
451#endif
452 { "FrameFlatteningEnabled", &WebPreferences::frameFlatteningEnabled },
453#if ENABLE(FULLSCREEN_API)
454 { "FullScreenEnabled", &WebPreferences::fullScreenEnabled },
455#endif
456#if ENABLE(INPUT_TYPE_COLOR)
457 { "InputTypeColorEnabled", &WebPreferences::inputTypeColorEnabled },
458#endif
459 { "IsITPDatabaseEnabled", &WebPreferences::isITPDatabaseEnabled },
460#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
461 { "LayoutFormattingContextEnabled", &WebPreferences::layoutFormattingContextEnabled },
462#endif
463#if ENABLE(OVERFLOW_SCROLLING_TOUCH)
464 { "LegacyOverflowScrollingTouchEnabled", &WebPreferences::legacyOverflowScrollingTouchEnabled },
465#endif
466#if ENABLE(TOUCH_EVENTS)
467 { "MouseEventsSimulationEnabled", &WebPreferences::mouseEventsSimulationEnabled },
468#endif
469 { "RestrictedHTTPResponseAccess", &WebPreferences::restrictedHTTPResponseAccess },
470 { "SelectionAcrossShadowBoundariesEnabled", &WebPreferences::selectionAcrossShadowBoundariesEnabled },
471#if ENABLE(SERVICE_WORKER)
472 { "ServiceWorkersEnabled", &WebPreferences::serviceWorkersEnabled },
473#endif
474 { "UndoManagerAPIEnabled", &WebPreferences::undoManagerAPIEnabled },
475 { "WebAPIStatisticsEnabled", &WebPreferences::webAPIStatisticsEnabled },
476 { "WebGLCompressedTextureASTCSupportEnabled", &WebPreferences::webGLCompressedTextureASTCSupportEnabled },
477 };
478
479 const String& key = feature.key();
480
481 for (auto& getter : getters) {
482 if (key == getter.name)
483 return (this->*getter.function)();
484 }
485
486 return false;
487}
488
489void WebPreferences::setFeatureEnabled(const API::InternalDebugFeature& feature, bool value)
490{
491 setInternalDebugFeatureEnabledForKey(feature.key(), value);
492}
493
494void WebPreferences::setInternalDebugFeatureEnabledForKey(const String& key, bool value)
495{
496 struct FeatureSetterMapping {
497 const char* name;
498 void (WebPreferences::*function) (const bool&);
499 };
500
501 static FeatureSetterMapping setters[] = {
502#if ENABLE(APPLE_PAY_REMOTE_UI)
503 { "ApplePayRemoteUIEnabled", &WebPreferences::setApplePayRemoteUIEnabled },
504#endif
505 { "AriaReflectionEnabled", &WebPreferences::setAriaReflectionEnabled },
506 { "AsyncFrameScrollingEnabled", &WebPreferences::setAsyncFrameScrollingEnabled },
507 { "AsyncOverflowScrollingEnabled", &WebPreferences::setAsyncOverflowScrollingEnabled },
508 { "BlockingOfSmallPluginsEnabled", &WebPreferences::setBlockingOfSmallPluginsEnabled },
509 { "CSSLogicalEnabled", &WebPreferences::setCSSLogicalEnabled },
510 { "CSSOMViewScrollingAPIEnabled", &WebPreferences::setCSSOMViewScrollingAPIEnabled },
511#if ENABLE(MEDIA_STREAM)
512 { "CaptureAudioInUIProcessEnabled", &WebPreferences::setCaptureAudioInUIProcessEnabled },
513#endif
514#if ENABLE(MEDIA_STREAM)
515 { "CaptureVideoInUIProcessEnabled", &WebPreferences::setCaptureVideoInUIProcessEnabled },
516#endif
517 { "DOMPasteAccessRequestsEnabled", &WebPreferences::setDOMPasteAccessRequestsEnabled },
518#if ENABLE(DATALIST_ELEMENT)
519 { "DataListElementEnabled", &WebPreferences::setDataListElementEnabled },
520#endif
521 { "ExperimentalPlugInSandboxProfilesEnabled", &WebPreferences::setExperimentalPlugInSandboxProfilesEnabled },
522#if PLATFORM(IOS_FAMILY)
523 { "FastClicksEverywhere", &WebPreferences::setFastClicksEverywhere },
524#endif
525#if PLATFORM(IOS_FAMILY)
526 { "FasterClicksEnabled", &WebPreferences::setFasterClicksEnabled },
527#endif
528 { "FrameFlatteningEnabled", &WebPreferences::setFrameFlatteningEnabled },
529#if ENABLE(FULLSCREEN_API)
530 { "FullScreenEnabled", &WebPreferences::setFullScreenEnabled },
531#endif
532#if ENABLE(INPUT_TYPE_COLOR)
533 { "InputTypeColorEnabled", &WebPreferences::setInputTypeColorEnabled },
534#endif
535 { "IsITPDatabaseEnabled", &WebPreferences::setIsITPDatabaseEnabled },
536#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
537 { "LayoutFormattingContextEnabled", &WebPreferences::setLayoutFormattingContextEnabled },
538#endif
539#if ENABLE(OVERFLOW_SCROLLING_TOUCH)
540 { "LegacyOverflowScrollingTouchEnabled", &WebPreferences::setLegacyOverflowScrollingTouchEnabled },
541#endif
542#if ENABLE(TOUCH_EVENTS)
543 { "MouseEventsSimulationEnabled", &WebPreferences::setMouseEventsSimulationEnabled },
544#endif
545 { "RestrictedHTTPResponseAccess", &WebPreferences::setRestrictedHTTPResponseAccess },
546 { "SelectionAcrossShadowBoundariesEnabled", &WebPreferences::setSelectionAcrossShadowBoundariesEnabled },
547#if ENABLE(SERVICE_WORKER)
548 { "ServiceWorkersEnabled", &WebPreferences::setServiceWorkersEnabled },
549#endif
550 { "UndoManagerAPIEnabled", &WebPreferences::setUndoManagerAPIEnabled },
551 { "WebAPIStatisticsEnabled", &WebPreferences::setWebAPIStatisticsEnabled },
552 { "WebGLCompressedTextureASTCSupportEnabled", &WebPreferences::setWebGLCompressedTextureASTCSupportEnabled },
553 };
554
555 for (auto& setter : setters) {
556 if (key == setter.name) {
557 (this->*setter.function)(value);
558 return;
559 }
560 }
561}
562
563void WebPreferences::resetAllInternalDebugFeatures()
564{
565#if ENABLE(APPLE_PAY_REMOTE_UI)
566 setApplePayRemoteUIEnabled(true);
567#endif
568 setAriaReflectionEnabled(true);
569 setAsyncFrameScrollingEnabled(DEFAULT_ASYNC_FRAME_SCROLLING_ENABLED);
570 setAsyncOverflowScrollingEnabled(DEFAULT_ASYNC_OVERFLOW_SCROLLING_ENABLED);
571 setBlockingOfSmallPluginsEnabled(true);
572 setCSSLogicalEnabled(false);
573 setCSSOMViewScrollingAPIEnabled(true);
574#if ENABLE(MEDIA_STREAM)
575 setCaptureAudioInUIProcessEnabled(DEFAULT_CAPTURE_AUDIO_IN_UIPROCESS);
576#endif
577#if ENABLE(MEDIA_STREAM)
578 setCaptureVideoInUIProcessEnabled(false);
579#endif
580 setDOMPasteAccessRequestsEnabled(DEFAULT_DOM_PASTE_ACCESS_REQUESTS_ENABLED);
581#if ENABLE(DATALIST_ELEMENT)
582 setDataListElementEnabled(DEFAULT_DATALIST_ELEMENT_ENABLED);
583#endif
584 setExperimentalPlugInSandboxProfilesEnabled(false);
585#if PLATFORM(IOS_FAMILY)
586 setFastClicksEverywhere(DEFAULT_FAST_CLICKS_EVERYWHERE);
587#endif
588#if PLATFORM(IOS_FAMILY)
589 setFasterClicksEnabled(true);
590#endif
591 setFrameFlatteningEnabled(DEFAULT_FRAME_FLATTENING);
592#if ENABLE(FULLSCREEN_API)
593 setFullScreenEnabled(false);
594#endif
595#if ENABLE(INPUT_TYPE_COLOR)
596 setInputTypeColorEnabled(DEFAULT_INPUT_TYPE_COLOR_ENABLED);
597#endif
598 setIsITPDatabaseEnabled(false);
599#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
600 setLayoutFormattingContextEnabled(false);
601#endif
602#if ENABLE(OVERFLOW_SCROLLING_TOUCH)
603 setLegacyOverflowScrollingTouchEnabled(true);
604#endif
605#if ENABLE(TOUCH_EVENTS)
606 setMouseEventsSimulationEnabled(false);
607#endif
608 setRestrictedHTTPResponseAccess(true);
609 setSelectionAcrossShadowBoundariesEnabled(true);
610#if ENABLE(SERVICE_WORKER)
611 setServiceWorkersEnabled(DEFAULT_SERVICE_WORKERS_ENABLED);
612#endif
613 setUndoManagerAPIEnabled(false);
614 setWebAPIStatisticsEnabled(false);
615 setWebGLCompressedTextureASTCSupportEnabled(false);
616}
617
618}
619