1 | /* |
2 | * Copyright (C) 2009 Google Inc. All rights reserved. |
3 | * Copyright (C) 2013-2017 Apple Inc. All rights reserved. |
4 | * |
5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are |
7 | * met: |
8 | * |
9 | * * Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. |
11 | * * Redistributions in binary form must reproduce the above |
12 | * copyright notice, this list of conditions and the following disclaimer |
13 | * in the documentation and/or other materials provided with the |
14 | * distribution. |
15 | * * Neither the name of Google Inc. nor the names of its |
16 | * contributors may be used to endorse or promote products derived from |
17 | * this software without specific prior written permission. |
18 | * |
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
23 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 | */ |
31 | |
32 | #pragma once |
33 | |
34 | #include <wtf/Forward.h> |
35 | #include <wtf/Noncopyable.h> |
36 | |
37 | namespace WebCore { |
38 | |
39 | // A class that stores static enablers for all experimental features. Note that |
40 | // the method names must line up with the JavaScript method they enable for code |
41 | // generation to work properly. |
42 | |
43 | class RuntimeEnabledFeatures { |
44 | WTF_MAKE_NONCOPYABLE(RuntimeEnabledFeatures); |
45 | public: |
46 | void setBlankAnchorTargetImpliesNoOpenerEnabled(bool isEnabled) { m_blankAnchorTargetImpliesNoOpenerEnabled = isEnabled; } |
47 | bool blankAnchorTargetImpliesNoOpenerEnabled() const { return m_blankAnchorTargetImpliesNoOpenerEnabled; } |
48 | |
49 | void setDisplayContentsEnabled(bool isEnabled) { m_isDisplayContentsEnabled = isEnabled; } |
50 | bool displayContentsEnabled() const { return m_isDisplayContentsEnabled; } |
51 | |
52 | void setLinkPreloadEnabled(bool isEnabled) { m_isLinkPreloadEnabled = isEnabled; } |
53 | bool linkPreloadEnabled() const { return m_isLinkPreloadEnabled; } |
54 | |
55 | void setLinkPrefetchEnabled(bool isEnabled) { m_isLinkPrefetchEnabled = isEnabled; } |
56 | bool linkPrefetchEnabled() const { return m_isLinkPrefetchEnabled; } |
57 | |
58 | void setMediaPreloadingEnabled(bool isEnabled) { m_isMediaPreloadingEnabled = isEnabled; } |
59 | bool mediaPreloadingEnabled() const { return m_isMediaPreloadingEnabled; } |
60 | |
61 | void setResourceTimingEnabled(bool isEnabled) { m_isResourceTimingEnabled = isEnabled; } |
62 | bool resourceTimingEnabled() const { return m_isResourceTimingEnabled; } |
63 | |
64 | void setUserTimingEnabled(bool isEnabled) { m_isUserTimingEnabled = isEnabled; } |
65 | bool userTimingEnabled() const { return m_isUserTimingEnabled; } |
66 | |
67 | bool performanceTimelineEnabled() const { return resourceTimingEnabled() || userTimingEnabled(); } |
68 | |
69 | void setShadowDOMEnabled(bool isEnabled) { m_isShadowDOMEnabled = isEnabled; } |
70 | bool shadowDOMEnabled() const { return m_isShadowDOMEnabled; } |
71 | |
72 | void setInputEventsEnabled(bool isEnabled) { m_inputEventsEnabled = isEnabled; } |
73 | bool inputEventsEnabled() const { return m_inputEventsEnabled; } |
74 | |
75 | void setInteractiveFormValidationEnabled(bool isEnabled) { m_isInteractiveFormValidationEnabled = isEnabled; } |
76 | bool interactiveFormValidationEnabled() const { return m_isInteractiveFormValidationEnabled; } |
77 | |
78 | void setCustomElementsEnabled(bool areEnabled) { m_areCustomElementsEnabled = areEnabled; } |
79 | bool customElementsEnabled() const { return m_areCustomElementsEnabled; } |
80 | |
81 | void (bool isEnabled) { m_isMenuItemElementEnabled = isEnabled; } |
82 | bool () const { return m_isMenuItemElementEnabled; } |
83 | |
84 | void setDirectoryUploadEnabled(bool isEnabled) { m_isDirectoryUploadEnabled = isEnabled; } |
85 | bool directoryUploadEnabled() const { return m_isDirectoryUploadEnabled; } |
86 | |
87 | #if ENABLE(DARK_MODE_CSS) |
88 | void setDarkModeCSSEnabled(bool isEnabled) { m_isDarkModeCSSEnabled = isEnabled; } |
89 | bool darkModeCSSEnabled() const { return m_isDarkModeCSSEnabled; } |
90 | #endif |
91 | |
92 | void setDataTransferItemsEnabled(bool areEnabled) { m_areDataTransferItemsEnabled = areEnabled; } |
93 | bool dataTransferItemsEnabled() const { return m_areDataTransferItemsEnabled; } |
94 | |
95 | void setCustomPasteboardDataEnabled(bool isEnabled) { m_isCustomPasteboardDataEnabled = isEnabled; } |
96 | bool customPasteboardDataEnabled() const { return m_isCustomPasteboardDataEnabled; } |
97 | |
98 | void setWebShareEnabled(bool isEnabled) { m_isWebShareEnabled = isEnabled; } |
99 | bool webShareEnabled() const { return m_isWebShareEnabled; } |
100 | |
101 | void setModernMediaControlsEnabled(bool areEnabled) { m_areModernMediaControlsEnabled = areEnabled; } |
102 | bool modernMediaControlsEnabled() const { return m_areModernMediaControlsEnabled; } |
103 | |
104 | void setWebAuthenticationEnabled(bool isEnabled) { m_isWebAuthenticationEnabled = isEnabled; } |
105 | bool webAuthenticationEnabled() const { return m_isWebAuthenticationEnabled; } |
106 | |
107 | void setWebAuthenticationLocalAuthenticatorEnabled(bool isEnabled) { m_isWebAuthenticationLocalAuthenticatorEnabled = isEnabled; } |
108 | bool webAuthenticationLocalAuthenticatorEnabled() const { return m_isWebAuthenticationLocalAuthenticatorEnabled; } |
109 | |
110 | void setIsSecureContextAttributeEnabled(bool isEnabled) { m_isSecureContextAttributeEnabled = isEnabled; } |
111 | bool isSecureContextAttributeEnabled() const { return m_isSecureContextAttributeEnabled; } |
112 | |
113 | void setWebAnimationsEnabled(bool areEnabled) { m_areWebAnimationsEnabled = areEnabled; } |
114 | bool webAnimationsEnabled() const { return m_areWebAnimationsEnabled; } |
115 | |
116 | void setWebAnimationsCSSIntegrationEnabled(bool isEnabled) { m_isWebAnimationsCSSIntegrationEnabled = isEnabled; } |
117 | bool webAnimationsCSSIntegrationEnabled() const { return m_areWebAnimationsEnabled && m_isWebAnimationsCSSIntegrationEnabled; } |
118 | |
119 | void setImageBitmapOffscreenCanvasEnabled(bool isEnabled) { m_isImageBitmapOffscreenCanvasEnabled = isEnabled; } |
120 | bool imageBitmapOffscreenCanvasEnabled() const { return m_isImageBitmapOffscreenCanvasEnabled; } |
121 | |
122 | void setCacheAPIEnabled(bool isEnabled) { m_isCacheAPIEnabled = isEnabled; } |
123 | bool cacheAPIEnabled() const { return m_isCacheAPIEnabled; } |
124 | |
125 | void setFetchAPIEnabled(bool isEnabled) { m_isFetchAPIEnabled = isEnabled; } |
126 | bool fetchAPIEnabled() const { return m_isFetchAPIEnabled; } |
127 | |
128 | void setWebSocketEnabled(bool isEnabled) { m_isWebSocketEnabled = isEnabled; } |
129 | bool webSocketEnabled() const { return m_isWebSocketEnabled; } |
130 | |
131 | bool fetchAPIKeepAliveEnabled() const { return m_fetchAPIKeepAliveEnabled; } |
132 | void setFetchAPIKeepAliveEnabled(bool isEnabled) { m_fetchAPIKeepAliveEnabled = isEnabled; } |
133 | |
134 | bool spectreGadgetsEnabled() const; |
135 | |
136 | void setInspectorAdditionsEnabled(bool isEnabled) { m_inspectorAdditionsEnabled = isEnabled; } |
137 | bool inspectorAdditionsEnabled() const { return m_inspectorAdditionsEnabled; } |
138 | |
139 | void setWebVREnabled(bool isEnabled) { m_webVREnabled = isEnabled; } |
140 | bool webVREnabled() const { return m_webVREnabled; } |
141 | |
142 | void setAccessibilityObjectModelEnabled(bool isEnabled) { m_accessibilityObjectModelEnabled = isEnabled; } |
143 | bool accessibilityObjectModelEnabled() const { return m_accessibilityObjectModelEnabled; } |
144 | |
145 | void setAriaReflectionEnabled(bool isEnabled) { m_ariaReflectionEnabled = isEnabled; } |
146 | bool ariaReflectionEnabled() const { return m_ariaReflectionEnabled; } |
147 | |
148 | void setItpDebugModeEnabled(bool isEnabled) { m_itpDebugMode = isEnabled; } |
149 | bool itpDebugModeEnabled() const { return m_itpDebugMode; } |
150 | |
151 | void setIsITPDatabaseEnabled(bool isEnabled) { m_isITPDatabaseEnabled = isEnabled; } |
152 | bool isITPDatabaseEnabled() const { return m_isITPDatabaseEnabled; } |
153 | |
154 | void setIsITPFirstPartyWebsiteDataRemovalEnabled(bool isEnabled) { m_isITPFirstPartyWebsiteDataRemovalEnabled = isEnabled; } |
155 | bool isITPFirstPartyWebsiteDataRemovalEnabled() const { return m_isITPFirstPartyWebsiteDataRemovalEnabled; } |
156 | |
157 | void setRestrictedHTTPResponseAccess(bool isEnabled) { m_isRestrictedHTTPResponseAccess = isEnabled; } |
158 | bool restrictedHTTPResponseAccess() const { return m_isRestrictedHTTPResponseAccess; } |
159 | |
160 | void setCrossOriginResourcePolicyEnabled(bool isEnabled) { m_crossOriginResourcePolicyEnabled = isEnabled; } |
161 | bool crossOriginResourcePolicyEnabled() const { return m_crossOriginResourcePolicyEnabled; } |
162 | |
163 | void setWebGLCompressedTextureASTCSupportEnabled(bool isEnabled) { m_isWebGLCompressedTextureASTCSupportEnabled = isEnabled; } |
164 | bool webGLCompressedTextureASTCSupportEnabled() const { return m_isWebGLCompressedTextureASTCSupportEnabled; } |
165 | |
166 | void setServerTimingEnabled(bool isEnabled) { m_isServerTimingEnabled = isEnabled; } |
167 | bool serverTimingEnabled() const { return m_isServerTimingEnabled; } |
168 | |
169 | void setExperimentalPlugInSandboxProfilesEnabled(bool isEnabled) { m_experimentalPlugInSandboxProfilesEnabled = isEnabled; } |
170 | bool experimentalPlugInSandboxProfilesEnabled() const { return m_experimentalPlugInSandboxProfilesEnabled; } |
171 | |
172 | void setDisabledAdaptationsMetaTagEnabled(bool isEnabled) { m_disabledAdaptationsMetaTagEnabled = isEnabled; } |
173 | bool disabledAdaptationsMetaTagEnabled() const { return m_disabledAdaptationsMetaTagEnabled; } |
174 | |
175 | void setAttrStyleEnabled(bool isEnabled) { m_attrStyleEnabled = isEnabled; } |
176 | bool attrStyleEnabled() const { return m_attrStyleEnabled; } |
177 | |
178 | void setWebAPIStatisticsEnabled(bool isEnabled) { m_webAPIStatisticsEnabled = isEnabled; } |
179 | bool webAPIStatisticsEnabled() const { return m_webAPIStatisticsEnabled; } |
180 | |
181 | void setCSSCustomPropertiesAndValuesEnabled(bool isEnabled) { m_CSSCustomPropertiesAndValuesEnabled = isEnabled; } |
182 | bool cssCustomPropertiesAndValuesEnabled() const { return m_CSSCustomPropertiesAndValuesEnabled; } |
183 | |
184 | void setPointerEventsEnabled(bool isEnabled) { m_pointerEventsEnabled = isEnabled; } |
185 | bool pointerEventsEnabled() const { return m_pointerEventsEnabled; } |
186 | |
187 | #if ENABLE(LAYOUT_FORMATTING_CONTEXT) |
188 | void setLayoutFormattingContextEnabled(bool isEnabled) { m_layoutFormattingContextEnabled = isEnabled; } |
189 | bool layoutFormattingContextEnabled() const { return m_layoutFormattingContextEnabled; } |
190 | #endif |
191 | |
192 | #if ENABLE(CSS_PAINTING_API) |
193 | void setCSSPaintingAPIEnabled(bool isEnabled) { m_CSSPaintingAPIEnabled = isEnabled; } |
194 | bool cssPaintingAPIEnabled() const { return m_CSSPaintingAPIEnabled; } |
195 | #endif |
196 | |
197 | #if ENABLE(CSS_TYPED_OM) |
198 | void setCSSTypedOMEnabled(bool isEnabled) { m_CSSTypedOMEnabled = isEnabled; } |
199 | bool cssTypedOMEnabled() const { return m_CSSTypedOMEnabled; } |
200 | #endif |
201 | |
202 | void setWebSQLDisabled(bool isDisabled) { m_webSQLEnabled = !isDisabled; } |
203 | bool webSQLEnabled() const { return m_webSQLEnabled; } |
204 | |
205 | #if ENABLE(ATTACHMENT_ELEMENT) |
206 | void setAttachmentElementEnabled(bool areEnabled) { m_isAttachmentElementEnabled = areEnabled; } |
207 | bool attachmentElementEnabled() const { return m_isAttachmentElementEnabled; } |
208 | #endif |
209 | |
210 | #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
211 | void setIndexedDBWorkersEnabled(bool isEnabled) { m_isIndexedDBWorkersEnabled = isEnabled; } |
212 | bool indexedDBWorkersEnabled() const { return m_isIndexedDBWorkersEnabled; } |
213 | #endif |
214 | |
215 | #if ENABLE(MEDIA_STREAM) |
216 | bool mediaRecorderEnabled() const { return m_isMediaRecorderEnabled; } |
217 | void setMediaRecorderEnabled(bool isEnabled) { m_isMediaRecorderEnabled = isEnabled; } |
218 | bool mediaDevicesEnabled() const { return m_isMediaDevicesEnabled; } |
219 | void setMediaDevicesEnabled(bool isEnabled) { m_isMediaDevicesEnabled = isEnabled; } |
220 | bool mediaStreamEnabled() const { return m_isMediaStreamEnabled; } |
221 | void setMediaStreamEnabled(bool isEnabled) { m_isMediaStreamEnabled = isEnabled; } |
222 | bool screenCaptureEnabled() const { return m_isScreenCaptureEnabled; } |
223 | void setScreenCaptureEnabled(bool isEnabled) { m_isScreenCaptureEnabled = isEnabled; } |
224 | #endif |
225 | |
226 | #if ENABLE(WEB_RTC) |
227 | bool webRTCVP8CodecEnabled() const { return m_isWebRTCVP8CodecEnabled; } |
228 | void setWebRTCVP8CodecEnabled(bool isEnabled) { m_isWebRTCVP8CodecEnabled = isEnabled; } |
229 | bool webRTCUnifiedPlanEnabled() const { return m_isWebRTCUnifiedPlanEnabled; } |
230 | void setWebRTCUnifiedPlanEnabled(bool isEnabled) { m_isWebRTCUnifiedPlanEnabled = isEnabled; } |
231 | bool peerConnectionEnabled() const { return m_isPeerConnectionEnabled; } |
232 | void setPeerConnectionEnabled(bool isEnabled) { m_isPeerConnectionEnabled = isEnabled; } |
233 | bool webRTCMDNSICECandidatesEnabled() const { return m_isWebRTCMDNSICECandidatesEnabled; } |
234 | void setWebRTCMDNSICECandidatesEnabled(bool isEnabled) { m_isWebRTCMDNSICECandidatesEnabled = isEnabled; } |
235 | bool webRTCH264SimulcastEnabled() const { return m_isWebRTCH264SimulcastEnabled; } |
236 | void setWebRTCH264SimulcastEnabled(bool isEnabled) { m_isWebRTCH264SimulcastEnabled = isEnabled; } |
237 | #endif |
238 | |
239 | #if ENABLE(LEGACY_CSS_VENDOR_PREFIXES) |
240 | void setLegacyCSSVendorPrefixesEnabled(bool isEnabled) { m_isLegacyCSSVendorPrefixesEnabled = isEnabled; } |
241 | bool legacyCSSVendorPrefixesEnabled() const { return m_isLegacyCSSVendorPrefixesEnabled; } |
242 | #endif |
243 | |
244 | #if ENABLE(INPUT_TYPE_COLOR) |
245 | bool inputTypeColorEnabled() const { return m_isInputTypeColorEnabled; } |
246 | void setInputTypeColorEnabled(bool isEnabled) { m_isInputTypeColorEnabled = isEnabled; } |
247 | #endif |
248 | |
249 | #if ENABLE(DATALIST_ELEMENT) |
250 | bool dataListElementEnabled() const { return m_isDataListElementEnabled; } |
251 | void setDataListElementEnabled(bool isEnabled) { m_isDataListElementEnabled = isEnabled; } |
252 | #endif |
253 | |
254 | #if ENABLE(INPUT_TYPE_DATE) |
255 | bool inputTypeDateEnabled() const { return m_isInputTypeDateEnabled; } |
256 | void setInputTypeDateEnabled(bool isEnabled) { m_isInputTypeDateEnabled = isEnabled; } |
257 | #endif |
258 | |
259 | #if ENABLE(INPUT_TYPE_DATETIME_INCOMPLETE) |
260 | bool inputTypeDateTimeEnabled() const { return m_isInputTypeDateTimeEnabled; } |
261 | void setInputTypeDateTimeEnabled(bool isEnabled) { m_isInputTypeDateTimeEnabled = isEnabled; } |
262 | #endif |
263 | |
264 | #if ENABLE(INPUT_TYPE_DATETIMELOCAL) |
265 | bool inputTypeDateTimeLocalEnabled() const { return m_isInputTypeDateTimeLocalEnabled; } |
266 | void setInputTypeDateTimeLocalEnabled(bool isEnabled) { m_isInputTypeDateTimeLocalEnabled = isEnabled; } |
267 | #endif |
268 | |
269 | #if ENABLE(INPUT_TYPE_MONTH) |
270 | bool inputTypeMonthEnabled() const { return m_isInputTypeMonthEnabled; } |
271 | void setInputTypeMonthEnabled(bool isEnabled) { m_isInputTypeMonthEnabled = isEnabled; } |
272 | #endif |
273 | |
274 | #if ENABLE(INPUT_TYPE_TIME) |
275 | bool inputTypeTimeEnabled() const { return m_isInputTypeTimeEnabled; } |
276 | void setInputTypeTimeEnabled(bool isEnabled) { m_isInputTypeTimeEnabled = isEnabled; } |
277 | #endif |
278 | |
279 | #if ENABLE(INPUT_TYPE_WEEK) |
280 | bool inputTypeWeekEnabled() const { return m_isInputTypeWeekEnabled; } |
281 | void setInputTypeWeekEnabled(bool isEnabled) { m_isInputTypeWeekEnabled = isEnabled; } |
282 | #endif |
283 | |
284 | #if ENABLE(GAMEPAD) |
285 | void setGamepadsEnabled(bool areEnabled) { m_areGamepadsEnabled = areEnabled; } |
286 | bool gamepadsEnabled() const { return m_areGamepadsEnabled; } |
287 | #endif |
288 | |
289 | #if ENABLE(WEBGL2) |
290 | void setWebGL2Enabled(bool isEnabled) { m_isWebGL2Enabled = isEnabled; } |
291 | bool webGL2Enabled() const { return m_isWebGL2Enabled; } |
292 | #endif |
293 | |
294 | #if ENABLE(WEBGPU) |
295 | void setWebGPUEnabled(bool isEnabled) { m_isWebGPUEnabled = isEnabled; } |
296 | bool webGPUEnabled() const { return m_isWebGPUEnabled; } |
297 | #endif |
298 | |
299 | #if ENABLE(STREAMS_API) |
300 | void setReadableByteStreamAPIEnabled(bool isEnabled) { m_isReadableByteStreamAPIEnabled = isEnabled; } |
301 | bool readableByteStreamAPIEnabled() const { return m_isReadableByteStreamAPIEnabled; } |
302 | void setWritableStreamAPIEnabled(bool isEnabled) { m_isWritableStreamAPIEnabled = isEnabled; } |
303 | bool writableStreamAPIEnabled() const { return m_isWritableStreamAPIEnabled; } |
304 | #endif |
305 | |
306 | #if ENABLE(DOWNLOAD_ATTRIBUTE) |
307 | void setDownloadAttributeEnabled(bool isEnabled) { m_isDownloadAttributeEnabled = isEnabled; } |
308 | bool downloadAttributeEnabled() const { return m_isDownloadAttributeEnabled; } |
309 | #endif |
310 | |
311 | #if ENABLE(INTERSECTION_OBSERVER) |
312 | void setIntersectionObserverEnabled(bool isEnabled) { m_intersectionObserverEnabled = isEnabled; } |
313 | bool intersectionObserverEnabled() const { return m_intersectionObserverEnabled; } |
314 | #endif |
315 | |
316 | void setUndoManagerAPIEnabled(bool isEnabled) { m_undoManagerAPIEnabled = isEnabled; } |
317 | bool undoManagerAPIEnabled() const { return m_undoManagerAPIEnabled; } |
318 | |
319 | #if ENABLE(ENCRYPTED_MEDIA) |
320 | void setEncryptedMediaAPIEnabled(bool isEnabled) { m_encryptedMediaAPIEnabled = isEnabled; } |
321 | bool encryptedMediaAPIEnabled() const { return m_encryptedMediaAPIEnabled; } |
322 | #endif |
323 | |
324 | #if ENABLE(LEGACY_ENCRYPTED_MEDIA) |
325 | void setLegacyEncryptedMediaAPIEnabled(bool isEnabled) { m_legacyEncryptedMediaAPIEnabled = isEnabled; } |
326 | bool legacyEncryptedMediaAPIEnabled() const { return m_legacyEncryptedMediaAPIEnabled; } |
327 | #endif |
328 | |
329 | #if ENABLE(SERVICE_WORKER) |
330 | bool serviceWorkerEnabled() const { return m_serviceWorkerEnabled; } |
331 | void setServiceWorkerEnabled(bool isEnabled) { m_serviceWorkerEnabled = isEnabled; } |
332 | #endif |
333 | |
334 | #if USE(SYSTEM_PREVIEW) |
335 | void setSystemPreviewEnabled(bool isEnabled) { m_systemPreviewEnabled = isEnabled; } |
336 | bool systemPreviewEnabled() const { return m_systemPreviewEnabled; } |
337 | #endif |
338 | |
339 | void setCSSLogicalEnabled(bool isEnabled) { m_CSSLogicalEnabled = isEnabled; } |
340 | bool cssLogicalEnabled() const { return m_CSSLogicalEnabled; } |
341 | |
342 | bool adClickAttributionEnabled() const { return m_adClickAttributionEnabled; } |
343 | void setAdClickAttributionEnabled(bool isEnabled) { m_adClickAttributionEnabled = isEnabled; } |
344 | bool adClickAttributionDebugModeEnabled() const { return m_adClickAttributionDebugModeEnabled; } |
345 | void setAdClickAttributionDebugModeEnabled(bool isEnabled) { m_adClickAttributionDebugModeEnabled = isEnabled; } |
346 | |
347 | #if ENABLE(TOUCH_EVENTS) |
348 | bool mouseEventsSimulationEnabled() const { return m_mouseEventsSimulationEnabled; } |
349 | void setMouseEventsSimulationEnabled(bool isEnabled) { m_mouseEventsSimulationEnabled = isEnabled; } |
350 | #endif |
351 | |
352 | bool referrerPolicyAttributeEnabled() const { return m_referrerPolicyAttributeEnabled; } |
353 | void setReferrerPolicyAttributeEnabled(bool isEnabled) { m_referrerPolicyAttributeEnabled = isEnabled; } |
354 | |
355 | bool pageAtRuleSupportEnabled() const { return m_pageAtRuleSupportEnabled; } |
356 | void setPageAtRuleSupportEnabled(bool isEnabled) { m_pageAtRuleSupportEnabled = isEnabled; } |
357 | |
358 | WEBCORE_EXPORT static RuntimeEnabledFeatures& sharedFeatures(); |
359 | |
360 | private: |
361 | // Never instantiate. |
362 | RuntimeEnabledFeatures(); |
363 | |
364 | bool m_blankAnchorTargetImpliesNoOpenerEnabled { true }; |
365 | bool m_areModernMediaControlsEnabled { false }; |
366 | bool m_isLinkPreloadEnabled { true }; |
367 | bool m_isLinkPrefetchEnabled { false }; |
368 | bool m_isMediaPreloadingEnabled { false }; |
369 | bool m_isResourceTimingEnabled { false }; |
370 | bool m_isUserTimingEnabled { false }; |
371 | bool m_isInteractiveFormValidationEnabled { false }; |
372 | bool m_isWebAuthenticationEnabled { false }; |
373 | bool m_isWebAuthenticationLocalAuthenticatorEnabled { false }; |
374 | bool m_isSecureContextAttributeEnabled { false }; |
375 | bool m_isDisplayContentsEnabled { true }; |
376 | bool m_isShadowDOMEnabled { true }; |
377 | bool m_areCustomElementsEnabled { true }; |
378 | bool { false }; |
379 | bool m_isDirectoryUploadEnabled { false }; |
380 | bool m_areDataTransferItemsEnabled { false }; |
381 | bool m_isCustomPasteboardDataEnabled { false }; |
382 | bool m_isWebShareEnabled { false }; |
383 | bool m_inputEventsEnabled { true }; |
384 | bool m_areWebAnimationsEnabled { false }; |
385 | bool m_isWebAnimationsCSSIntegrationEnabled { false }; |
386 | bool m_isImageBitmapOffscreenCanvasEnabled { true }; |
387 | bool m_isCacheAPIEnabled { false }; |
388 | bool m_isFetchAPIEnabled { true }; |
389 | bool m_isWebSocketEnabled { true }; |
390 | bool m_fetchAPIKeepAliveEnabled { false }; |
391 | bool m_inspectorAdditionsEnabled { false }; |
392 | bool m_webVREnabled { false }; |
393 | bool m_accessibilityObjectModelEnabled { false }; |
394 | bool m_ariaReflectionEnabled { true }; |
395 | bool m_itpDebugMode { false }; |
396 | bool m_isRestrictedHTTPResponseAccess { true }; |
397 | bool m_crossOriginResourcePolicyEnabled { true }; |
398 | bool m_isWebGLCompressedTextureASTCSupportEnabled { false }; |
399 | bool m_isServerTimingEnabled { false }; |
400 | bool m_experimentalPlugInSandboxProfilesEnabled { false }; |
401 | bool m_disabledAdaptationsMetaTagEnabled { false }; |
402 | bool m_attrStyleEnabled { false }; |
403 | bool m_webAPIStatisticsEnabled { false }; |
404 | bool m_CSSCustomPropertiesAndValuesEnabled { false }; |
405 | bool m_pointerEventsEnabled { true }; |
406 | bool m_webSQLEnabled { true }; |
407 | bool m_pageAtRuleSupportEnabled { false }; |
408 | |
409 | #if ENABLE(LAYOUT_FORMATTING_CONTEXT) |
410 | bool m_layoutFormattingContextEnabled { false }; |
411 | #endif |
412 | |
413 | #if ENABLE(CSS_PAINTING_API) |
414 | bool m_CSSPaintingAPIEnabled { false }; |
415 | #endif |
416 | |
417 | #if ENABLE(CSS_TYPED_OM) |
418 | bool m_CSSTypedOMEnabled { false }; |
419 | #endif |
420 | |
421 | #if ENABLE(ATTACHMENT_ELEMENT) |
422 | bool m_isAttachmentElementEnabled { false }; |
423 | #endif |
424 | |
425 | #if ENABLE(DARK_MODE_CSS) |
426 | bool m_isDarkModeCSSEnabled { true }; |
427 | #endif |
428 | |
429 | #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
430 | bool m_isIndexedDBWorkersEnabled { true }; |
431 | #endif |
432 | |
433 | #if ENABLE(MEDIA_STREAM) |
434 | bool m_isMediaRecorderEnabled { false }; |
435 | bool m_isMediaDevicesEnabled { false }; |
436 | bool m_isMediaStreamEnabled { true }; |
437 | bool m_isScreenCaptureEnabled { false }; |
438 | #endif |
439 | |
440 | #if ENABLE(WEB_RTC) |
441 | bool m_isWebRTCVP8CodecEnabled { true }; |
442 | bool m_isWebRTCUnifiedPlanEnabled { true }; |
443 | bool m_isPeerConnectionEnabled { true }; |
444 | bool m_isWebRTCMDNSICECandidatesEnabled { false }; |
445 | bool m_isWebRTCH264SimulcastEnabled { true }; |
446 | #endif |
447 | |
448 | #if ENABLE(LEGACY_CSS_VENDOR_PREFIXES) |
449 | bool m_isLegacyCSSVendorPrefixesEnabled { false }; |
450 | #endif |
451 | |
452 | #if ENABLE(INPUT_TYPE_COLOR) |
453 | bool m_isInputTypeColorEnabled { false }; |
454 | #endif |
455 | |
456 | #if ENABLE(DATALIST_ELEMENT) |
457 | bool m_isDataListElementEnabled { false }; |
458 | #endif |
459 | |
460 | #if ENABLE(INPUT_TYPE_DATE) |
461 | bool m_isInputTypeDateEnabled { true }; |
462 | #endif |
463 | |
464 | #if ENABLE(INPUT_TYPE_DATETIME_INCOMPLETE) |
465 | bool m_isInputTypeDateTimeEnabled { false }; |
466 | #endif |
467 | |
468 | #if ENABLE(INPUT_TYPE_DATETIMELOCAL) |
469 | bool m_isInputTypeDateTimeLocalEnabled { true }; |
470 | #endif |
471 | |
472 | #if ENABLE(INPUT_TYPE_MONTH) |
473 | bool m_isInputTypeMonthEnabled { true }; |
474 | #endif |
475 | |
476 | #if ENABLE(INPUT_TYPE_TIME) |
477 | bool m_isInputTypeTimeEnabled { true }; |
478 | #endif |
479 | |
480 | #if ENABLE(INPUT_TYPE_WEEK) |
481 | bool m_isInputTypeWeekEnabled { true }; |
482 | #endif |
483 | |
484 | #if ENABLE(GAMEPAD) |
485 | bool m_areGamepadsEnabled { false }; |
486 | #endif |
487 | |
488 | #if ENABLE(STREAMS_API) |
489 | bool m_isReadableByteStreamAPIEnabled { false }; |
490 | bool m_isWritableStreamAPIEnabled { false }; |
491 | #endif |
492 | |
493 | #if ENABLE(WEBGL2) |
494 | bool m_isWebGL2Enabled { false }; |
495 | #endif |
496 | |
497 | #if ENABLE(WEBGPU) |
498 | bool m_isWebGPUEnabled { false }; |
499 | #endif |
500 | |
501 | #if ENABLE(DOWNLOAD_ATTRIBUTE) |
502 | bool m_isDownloadAttributeEnabled { false }; |
503 | #endif |
504 | |
505 | #if ENABLE(ENCRYPTED_MEDIA) |
506 | bool m_encryptedMediaAPIEnabled { false }; |
507 | #endif |
508 | |
509 | #if ENABLE(LEGACY_ENCRYPTED_MEDIA) |
510 | bool m_legacyEncryptedMediaAPIEnabled { true }; |
511 | #endif |
512 | |
513 | #if ENABLE(INTERSECTION_OBSERVER) |
514 | bool m_intersectionObserverEnabled { false }; |
515 | #endif |
516 | |
517 | #if ENABLE(SERVICE_WORKER) |
518 | bool m_serviceWorkerEnabled { false }; |
519 | #endif |
520 | |
521 | #if USE(SYSTEM_PREVIEW) |
522 | bool m_systemPreviewEnabled { false }; |
523 | #endif |
524 | |
525 | bool m_undoManagerAPIEnabled { false }; |
526 | |
527 | bool m_CSSLogicalEnabled { false }; |
528 | |
529 | bool m_adClickAttributionEnabled { false }; |
530 | bool m_adClickAttributionDebugModeEnabled { false }; |
531 | |
532 | #if ENABLE(TOUCH_EVENTS) |
533 | bool m_mouseEventsSimulationEnabled { false }; |
534 | #endif |
535 | |
536 | bool m_isITPDatabaseEnabled { false }; |
537 | bool m_isITPFirstPartyWebsiteDataRemovalEnabled { false }; |
538 | |
539 | bool m_referrerPolicyAttributeEnabled { false }; |
540 | |
541 | friend class WTF::NeverDestroyed<RuntimeEnabledFeatures>; |
542 | }; |
543 | |
544 | } // namespace WebCore |
545 | |