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 | #include <wtf/Optional.h> |
37 | |
38 | namespace WebCore { |
39 | |
40 | // A class that stores static enablers for all experimental features. Note that |
41 | // the method names must line up with the JavaScript method they enable for code |
42 | // generation to work properly. |
43 | |
44 | class RuntimeEnabledFeatures { |
45 | WTF_MAKE_NONCOPYABLE(RuntimeEnabledFeatures); |
46 | public: |
47 | void setBlankAnchorTargetImpliesNoOpenerEnabled(bool isEnabled) { m_blankAnchorTargetImpliesNoOpenerEnabled = isEnabled; } |
48 | bool blankAnchorTargetImpliesNoOpenerEnabled() const { return m_blankAnchorTargetImpliesNoOpenerEnabled; } |
49 | |
50 | void setDisplayContentsEnabled(bool isEnabled) { m_isDisplayContentsEnabled = isEnabled; } |
51 | bool displayContentsEnabled() const { return m_isDisplayContentsEnabled; } |
52 | |
53 | void setLinkPreloadEnabled(bool isEnabled) { m_isLinkPreloadEnabled = isEnabled; } |
54 | bool linkPreloadEnabled() const { return m_isLinkPreloadEnabled; } |
55 | |
56 | void setLinkPrefetchEnabled(bool isEnabled) { m_isLinkPrefetchEnabled = isEnabled; } |
57 | bool linkPrefetchEnabled() const { return m_isLinkPrefetchEnabled; } |
58 | |
59 | void setMediaPreloadingEnabled(bool isEnabled) { m_isMediaPreloadingEnabled = isEnabled; } |
60 | bool mediaPreloadingEnabled() const { return m_isMediaPreloadingEnabled; } |
61 | |
62 | void setResourceTimingEnabled(bool isEnabled) { m_isResourceTimingEnabled = isEnabled; } |
63 | bool resourceTimingEnabled() const { return m_isResourceTimingEnabled; } |
64 | |
65 | void setUserTimingEnabled(bool isEnabled) { m_isUserTimingEnabled = isEnabled; } |
66 | bool userTimingEnabled() const { return m_isUserTimingEnabled; } |
67 | |
68 | bool performanceTimelineEnabled() const { return resourceTimingEnabled() || userTimingEnabled(); } |
69 | |
70 | void setShadowDOMEnabled(bool isEnabled) { m_isShadowDOMEnabled = isEnabled; } |
71 | bool shadowDOMEnabled() const { return m_isShadowDOMEnabled; } |
72 | |
73 | void setInputEventsEnabled(bool isEnabled) { m_inputEventsEnabled = isEnabled; } |
74 | bool inputEventsEnabled() const { return m_inputEventsEnabled; } |
75 | |
76 | void setInteractiveFormValidationEnabled(bool isEnabled) { m_isInteractiveFormValidationEnabled = isEnabled; } |
77 | bool interactiveFormValidationEnabled() const { return m_isInteractiveFormValidationEnabled; } |
78 | |
79 | void setCustomElementsEnabled(bool areEnabled) { m_areCustomElementsEnabled = areEnabled; } |
80 | bool customElementsEnabled() const { return m_areCustomElementsEnabled; } |
81 | |
82 | void (bool isEnabled) { m_isMenuItemElementEnabled = isEnabled; } |
83 | bool () const { return m_isMenuItemElementEnabled; } |
84 | |
85 | void setDirectoryUploadEnabled(bool isEnabled) { m_isDirectoryUploadEnabled = isEnabled; } |
86 | bool directoryUploadEnabled() const { return m_isDirectoryUploadEnabled; } |
87 | |
88 | #if ENABLE(DARK_MODE_CSS) |
89 | void setDarkModeCSSEnabled(bool isEnabled) { m_isDarkModeCSSEnabled = isEnabled; } |
90 | bool darkModeCSSEnabled() const { return m_isDarkModeCSSEnabled; } |
91 | #endif |
92 | |
93 | void setDataTransferItemsEnabled(bool areEnabled) { m_areDataTransferItemsEnabled = areEnabled; } |
94 | bool dataTransferItemsEnabled() const { return m_areDataTransferItemsEnabled; } |
95 | |
96 | void setCustomPasteboardDataEnabled(bool isEnabled) { m_isCustomPasteboardDataEnabled = isEnabled; } |
97 | bool customPasteboardDataEnabled() const { return m_isCustomPasteboardDataEnabled; } |
98 | |
99 | void setWebShareEnabled(bool isEnabled) { m_isWebShareEnabled = isEnabled; } |
100 | bool webShareEnabled() const { return m_isWebShareEnabled; } |
101 | |
102 | void setModernMediaControlsEnabled(bool areEnabled) { m_areModernMediaControlsEnabled = areEnabled; } |
103 | bool modernMediaControlsEnabled() const { return m_areModernMediaControlsEnabled; } |
104 | |
105 | void setWebAuthenticationEnabled(bool isEnabled) { m_isWebAuthenticationEnabled = isEnabled; } |
106 | bool webAuthenticationEnabled() const { return m_isWebAuthenticationEnabled; } |
107 | |
108 | void setWebAuthenticationLocalAuthenticatorEnabled(bool isEnabled) { m_isWebAuthenticationLocalAuthenticatorEnabled = isEnabled; } |
109 | bool webAuthenticationLocalAuthenticatorEnabled() const { return m_isWebAuthenticationLocalAuthenticatorEnabled; } |
110 | |
111 | void setIsSecureContextAttributeEnabled(bool isEnabled) { m_isSecureContextAttributeEnabled = isEnabled; } |
112 | bool isSecureContextAttributeEnabled() const { return m_isSecureContextAttributeEnabled; } |
113 | |
114 | void setWebAnimationsEnabled(bool areEnabled) { m_areWebAnimationsEnabled = areEnabled; } |
115 | bool webAnimationsEnabled() const { return m_areWebAnimationsEnabled; } |
116 | |
117 | void setWebAnimationsCSSIntegrationEnabled(bool isEnabled) { m_isWebAnimationsCSSIntegrationEnabled = isEnabled; } |
118 | bool webAnimationsCSSIntegrationEnabled() const { return m_areWebAnimationsEnabled && m_isWebAnimationsCSSIntegrationEnabled; } |
119 | |
120 | void setImageBitmapOffscreenCanvasEnabled(bool isEnabled) { m_isImageBitmapOffscreenCanvasEnabled = isEnabled; } |
121 | bool imageBitmapOffscreenCanvasEnabled() const { return m_isImageBitmapOffscreenCanvasEnabled; } |
122 | |
123 | void setCacheAPIEnabled(bool isEnabled) { m_isCacheAPIEnabled = isEnabled; } |
124 | bool cacheAPIEnabled() const { return m_isCacheAPIEnabled; } |
125 | |
126 | void setFetchAPIEnabled(bool isEnabled) { m_isFetchAPIEnabled = isEnabled; } |
127 | bool fetchAPIEnabled() const { return m_isFetchAPIEnabled; } |
128 | |
129 | void setWebSocketEnabled(bool isEnabled) { m_isWebSocketEnabled = isEnabled; } |
130 | bool webSocketEnabled() const { return m_isWebSocketEnabled; } |
131 | |
132 | bool fetchAPIKeepAliveEnabled() const { return m_fetchAPIKeepAliveEnabled; } |
133 | void setFetchAPIKeepAliveEnabled(bool isEnabled) { m_fetchAPIKeepAliveEnabled = isEnabled; } |
134 | |
135 | bool spectreGadgetsEnabled() const; |
136 | |
137 | void setInspectorAdditionsEnabled(bool isEnabled) { m_inspectorAdditionsEnabled = isEnabled; } |
138 | bool inspectorAdditionsEnabled() const { return m_inspectorAdditionsEnabled; } |
139 | |
140 | void setWebVREnabled(bool isEnabled) { m_webVREnabled = isEnabled; } |
141 | bool webVREnabled() const { return m_webVREnabled; } |
142 | |
143 | void setAccessibilityObjectModelEnabled(bool isEnabled) { m_accessibilityObjectModelEnabled = isEnabled; } |
144 | bool accessibilityObjectModelEnabled() const { return m_accessibilityObjectModelEnabled; } |
145 | |
146 | void setAriaReflectionEnabled(bool isEnabled) { m_ariaReflectionEnabled = isEnabled; } |
147 | bool ariaReflectionEnabled() const { return m_ariaReflectionEnabled; } |
148 | |
149 | void setItpDebugModeEnabled(bool isEnabled) { m_itpDebugMode = isEnabled; } |
150 | bool itpDebugModeEnabled() const { return m_itpDebugMode; } |
151 | |
152 | void setIsITPDatabaseEnabled(bool isEnabled) { m_isITPDatabaseEnabled = isEnabled; } |
153 | bool isITPDatabaseEnabled() const { return m_isITPDatabaseEnabled; } |
154 | |
155 | void setIsITPFirstPartyWebsiteDataRemovalEnabled(bool isEnabled) { m_isITPFirstPartyWebsiteDataRemovalEnabled = isEnabled; } |
156 | bool isITPFirstPartyWebsiteDataRemovalEnabled() const { return m_isITPFirstPartyWebsiteDataRemovalEnabled; } |
157 | |
158 | void setRestrictedHTTPResponseAccess(bool isEnabled) { m_isRestrictedHTTPResponseAccess = isEnabled; } |
159 | bool restrictedHTTPResponseAccess() const { return m_isRestrictedHTTPResponseAccess; } |
160 | |
161 | void setCrossOriginResourcePolicyEnabled(bool isEnabled) { m_crossOriginResourcePolicyEnabled = isEnabled; } |
162 | bool crossOriginResourcePolicyEnabled() const { return m_crossOriginResourcePolicyEnabled; } |
163 | |
164 | void setWebGLCompressedTextureASTCSupportEnabled(bool isEnabled) { m_isWebGLCompressedTextureASTCSupportEnabled = isEnabled; } |
165 | bool webGLCompressedTextureASTCSupportEnabled() const { return m_isWebGLCompressedTextureASTCSupportEnabled; } |
166 | |
167 | void setServerTimingEnabled(bool isEnabled) { m_isServerTimingEnabled = isEnabled; } |
168 | bool serverTimingEnabled() const { return m_isServerTimingEnabled; } |
169 | |
170 | void setExperimentalPlugInSandboxProfilesEnabled(bool isEnabled) { m_experimentalPlugInSandboxProfilesEnabled = isEnabled; } |
171 | bool experimentalPlugInSandboxProfilesEnabled() const { return m_experimentalPlugInSandboxProfilesEnabled; } |
172 | |
173 | void setDisabledAdaptationsMetaTagEnabled(bool isEnabled) { m_disabledAdaptationsMetaTagEnabled = isEnabled; } |
174 | bool disabledAdaptationsMetaTagEnabled() const { return m_disabledAdaptationsMetaTagEnabled; } |
175 | |
176 | void setAttrStyleEnabled(bool isEnabled) { m_attrStyleEnabled = isEnabled; } |
177 | bool attrStyleEnabled() const { return m_attrStyleEnabled; } |
178 | |
179 | void setWebAPIStatisticsEnabled(bool isEnabled) { m_webAPIStatisticsEnabled = isEnabled; } |
180 | bool webAPIStatisticsEnabled() const { return m_webAPIStatisticsEnabled; } |
181 | |
182 | void setCSSCustomPropertiesAndValuesEnabled(bool isEnabled) { m_CSSCustomPropertiesAndValuesEnabled = isEnabled; } |
183 | bool cssCustomPropertiesAndValuesEnabled() const { return m_CSSCustomPropertiesAndValuesEnabled; } |
184 | |
185 | void setPointerEventsEnabled(bool isEnabled) { m_pointerEventsEnabled = isEnabled; } |
186 | bool pointerEventsEnabled() const { return m_pointerEventsEnabled; } |
187 | |
188 | void setSyntheticEditingCommandsEnabled(bool isEnabled) { m_syntheticEditingCommandsEnabled = isEnabled; } |
189 | bool syntheticEditingCommandsEnabled() const { return m_syntheticEditingCommandsEnabled; } |
190 | |
191 | #if ENABLE(LAYOUT_FORMATTING_CONTEXT) |
192 | void setLayoutFormattingContextEnabled(bool isEnabled) { m_layoutFormattingContextEnabled = isEnabled; } |
193 | bool layoutFormattingContextEnabled() const { return m_layoutFormattingContextEnabled; } |
194 | #endif |
195 | |
196 | #if ENABLE(CSS_PAINTING_API) |
197 | void setCSSPaintingAPIEnabled(bool isEnabled) { m_CSSPaintingAPIEnabled = isEnabled; } |
198 | bool cssPaintingAPIEnabled() const { return m_CSSPaintingAPIEnabled; } |
199 | #endif |
200 | |
201 | #if ENABLE(CSS_TYPED_OM) |
202 | void setCSSTypedOMEnabled(bool isEnabled) { m_CSSTypedOMEnabled = isEnabled; } |
203 | bool cssTypedOMEnabled() const { return m_CSSTypedOMEnabled; } |
204 | #endif |
205 | |
206 | void setWebSQLDisabled(bool isDisabled) { m_webSQLEnabled = !isDisabled; } |
207 | bool webSQLEnabled() const { return m_webSQLEnabled; } |
208 | |
209 | #if ENABLE(ATTACHMENT_ELEMENT) |
210 | void setAttachmentElementEnabled(bool areEnabled) { m_isAttachmentElementEnabled = areEnabled; } |
211 | bool attachmentElementEnabled() const { return m_isAttachmentElementEnabled; } |
212 | #endif |
213 | |
214 | #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
215 | void setIndexedDBWorkersEnabled(bool isEnabled) { m_isIndexedDBWorkersEnabled = isEnabled; } |
216 | bool indexedDBWorkersEnabled() const { return m_isIndexedDBWorkersEnabled; } |
217 | #endif |
218 | |
219 | #if ENABLE(MEDIA_STREAM) |
220 | bool mediaRecorderEnabled() const { return m_isMediaRecorderEnabled; } |
221 | void setMediaRecorderEnabled(bool isEnabled) { m_isMediaRecorderEnabled = isEnabled; } |
222 | bool mediaDevicesEnabled() const { return m_isMediaDevicesEnabled; } |
223 | void setMediaDevicesEnabled(bool isEnabled) { m_isMediaDevicesEnabled = isEnabled; } |
224 | bool mediaStreamEnabled() const { return m_isMediaStreamEnabled; } |
225 | void setMediaStreamEnabled(bool isEnabled) { m_isMediaStreamEnabled = isEnabled; } |
226 | bool screenCaptureEnabled() const { return m_isScreenCaptureEnabled; } |
227 | void setScreenCaptureEnabled(bool isEnabled) { m_isScreenCaptureEnabled = isEnabled; } |
228 | #endif |
229 | |
230 | #if ENABLE(WEB_RTC) |
231 | bool webRTCVP8CodecEnabled() const { return m_isWebRTCVP8CodecEnabled; } |
232 | void setWebRTCVP8CodecEnabled(bool isEnabled) { m_isWebRTCVP8CodecEnabled = isEnabled; } |
233 | bool webRTCUnifiedPlanEnabled() const { return m_isWebRTCUnifiedPlanEnabled; } |
234 | void setWebRTCUnifiedPlanEnabled(bool isEnabled) { m_isWebRTCUnifiedPlanEnabled = isEnabled; } |
235 | bool peerConnectionEnabled() const { return m_isPeerConnectionEnabled; } |
236 | void setPeerConnectionEnabled(bool isEnabled) { m_isPeerConnectionEnabled = isEnabled; } |
237 | bool webRTCMDNSICECandidatesEnabled() const { return m_isWebRTCMDNSICECandidatesEnabled; } |
238 | void setWebRTCMDNSICECandidatesEnabled(bool isEnabled) { m_isWebRTCMDNSICECandidatesEnabled = isEnabled; } |
239 | bool webRTCH264SimulcastEnabled() const { return m_isWebRTCH264SimulcastEnabled; } |
240 | void setWebRTCH264SimulcastEnabled(bool isEnabled) { m_isWebRTCH264SimulcastEnabled = isEnabled; } |
241 | #endif |
242 | |
243 | #if ENABLE(LEGACY_CSS_VENDOR_PREFIXES) |
244 | void setLegacyCSSVendorPrefixesEnabled(bool isEnabled) { m_isLegacyCSSVendorPrefixesEnabled = isEnabled; } |
245 | bool legacyCSSVendorPrefixesEnabled() const { return m_isLegacyCSSVendorPrefixesEnabled; } |
246 | #endif |
247 | |
248 | #if ENABLE(INPUT_TYPE_COLOR) |
249 | bool inputTypeColorEnabled() const { return m_isInputTypeColorEnabled; } |
250 | void setInputTypeColorEnabled(bool isEnabled) { m_isInputTypeColorEnabled = isEnabled; } |
251 | #endif |
252 | |
253 | #if ENABLE(DATALIST_ELEMENT) |
254 | bool dataListElementEnabled() const { return m_isDataListElementEnabled; } |
255 | void setDataListElementEnabled(bool isEnabled) { m_isDataListElementEnabled = isEnabled; } |
256 | #endif |
257 | |
258 | #if ENABLE(INPUT_TYPE_DATE) |
259 | bool inputTypeDateEnabled() const { return m_isInputTypeDateEnabled; } |
260 | void setInputTypeDateEnabled(bool isEnabled) { m_isInputTypeDateEnabled = isEnabled; } |
261 | #endif |
262 | |
263 | #if ENABLE(INPUT_TYPE_DATETIME_INCOMPLETE) |
264 | bool inputTypeDateTimeEnabled() const { return m_isInputTypeDateTimeEnabled; } |
265 | void setInputTypeDateTimeEnabled(bool isEnabled) { m_isInputTypeDateTimeEnabled = isEnabled; } |
266 | #endif |
267 | |
268 | #if ENABLE(INPUT_TYPE_DATETIMELOCAL) |
269 | bool inputTypeDateTimeLocalEnabled() const { return m_isInputTypeDateTimeLocalEnabled; } |
270 | void setInputTypeDateTimeLocalEnabled(bool isEnabled) { m_isInputTypeDateTimeLocalEnabled = isEnabled; } |
271 | #endif |
272 | |
273 | #if ENABLE(INPUT_TYPE_MONTH) |
274 | bool inputTypeMonthEnabled() const { return m_isInputTypeMonthEnabled; } |
275 | void setInputTypeMonthEnabled(bool isEnabled) { m_isInputTypeMonthEnabled = isEnabled; } |
276 | #endif |
277 | |
278 | #if ENABLE(INPUT_TYPE_TIME) |
279 | bool inputTypeTimeEnabled() const { return m_isInputTypeTimeEnabled; } |
280 | void setInputTypeTimeEnabled(bool isEnabled) { m_isInputTypeTimeEnabled = isEnabled; } |
281 | #endif |
282 | |
283 | #if ENABLE(INPUT_TYPE_WEEK) |
284 | bool inputTypeWeekEnabled() const { return m_isInputTypeWeekEnabled; } |
285 | void setInputTypeWeekEnabled(bool isEnabled) { m_isInputTypeWeekEnabled = isEnabled; } |
286 | #endif |
287 | |
288 | #if ENABLE(GAMEPAD) |
289 | void setGamepadsEnabled(bool areEnabled) { m_areGamepadsEnabled = areEnabled; } |
290 | bool gamepadsEnabled() const { return m_areGamepadsEnabled; } |
291 | #endif |
292 | |
293 | #if ENABLE(WEBGL2) |
294 | void setWebGL2Enabled(bool isEnabled) { m_isWebGL2Enabled = isEnabled; } |
295 | bool webGL2Enabled() const { return m_isWebGL2Enabled; } |
296 | #endif |
297 | |
298 | #if ENABLE(WEBGPU) |
299 | void setWebGPUEnabled(bool isEnabled) { m_isWebGPUEnabled = isEnabled; } |
300 | bool webGPUEnabled() const { return m_isWebGPUEnabled; } |
301 | #endif |
302 | |
303 | #if ENABLE(STREAMS_API) |
304 | void setReadableByteStreamAPIEnabled(bool isEnabled) { m_isReadableByteStreamAPIEnabled = isEnabled; } |
305 | bool readableByteStreamAPIEnabled() const { return m_isReadableByteStreamAPIEnabled; } |
306 | void setWritableStreamAPIEnabled(bool isEnabled) { m_isWritableStreamAPIEnabled = isEnabled; } |
307 | bool writableStreamAPIEnabled() const { return m_isWritableStreamAPIEnabled; } |
308 | #endif |
309 | |
310 | #if ENABLE(DOWNLOAD_ATTRIBUTE) |
311 | void setDownloadAttributeEnabled(bool isEnabled) { m_isDownloadAttributeEnabled = isEnabled; } |
312 | bool downloadAttributeEnabled() const { return m_isDownloadAttributeEnabled; } |
313 | #endif |
314 | |
315 | #if ENABLE(INTERSECTION_OBSERVER) |
316 | void setIntersectionObserverEnabled(bool isEnabled) { m_intersectionObserverEnabled = isEnabled; } |
317 | bool intersectionObserverEnabled() const { return m_intersectionObserverEnabled; } |
318 | #endif |
319 | |
320 | void setUndoManagerAPIEnabled(bool isEnabled) { m_undoManagerAPIEnabled = isEnabled; } |
321 | bool undoManagerAPIEnabled() const { return m_undoManagerAPIEnabled; } |
322 | |
323 | #if ENABLE(ENCRYPTED_MEDIA) |
324 | void setEncryptedMediaAPIEnabled(bool isEnabled) { m_encryptedMediaAPIEnabled = isEnabled; } |
325 | bool encryptedMediaAPIEnabled() const { return m_encryptedMediaAPIEnabled; } |
326 | #endif |
327 | |
328 | #if ENABLE(LEGACY_ENCRYPTED_MEDIA) |
329 | void setLegacyEncryptedMediaAPIEnabled(bool isEnabled) { m_legacyEncryptedMediaAPIEnabled = isEnabled; } |
330 | bool legacyEncryptedMediaAPIEnabled() const { return m_legacyEncryptedMediaAPIEnabled; } |
331 | #endif |
332 | |
333 | #if ENABLE(SERVICE_WORKER) |
334 | bool serviceWorkerEnabled() const { return m_serviceWorkerEnabled; } |
335 | void setServiceWorkerEnabled(bool isEnabled) { m_serviceWorkerEnabled = isEnabled; } |
336 | #endif |
337 | |
338 | #if USE(SYSTEM_PREVIEW) |
339 | void setSystemPreviewEnabled(bool isEnabled) { m_systemPreviewEnabled = isEnabled; } |
340 | bool systemPreviewEnabled() const { return m_systemPreviewEnabled; } |
341 | #endif |
342 | |
343 | void setCSSLogicalEnabled(bool isEnabled) { m_CSSLogicalEnabled = isEnabled; } |
344 | bool cssLogicalEnabled() const { return m_CSSLogicalEnabled; } |
345 | |
346 | bool adClickAttributionEnabled() const { return m_adClickAttributionEnabled; } |
347 | void setAdClickAttributionEnabled(bool isEnabled) { m_adClickAttributionEnabled = isEnabled; } |
348 | bool adClickAttributionDebugModeEnabled() const { return m_adClickAttributionDebugModeEnabled; } |
349 | void setAdClickAttributionDebugModeEnabled(bool isEnabled) { m_adClickAttributionDebugModeEnabled = isEnabled; } |
350 | |
351 | #if ENABLE(TOUCH_EVENTS) |
352 | bool mouseEventsSimulationEnabled() const { return m_mouseEventsSimulationEnabled; } |
353 | void setMouseEventsSimulationEnabled(bool isEnabled) { m_mouseEventsSimulationEnabled = isEnabled; } |
354 | bool touchEventsEnabled() const; |
355 | void setTouchEventsEnabled(bool isEnabled) { m_touchEventsEnabled = isEnabled; } |
356 | #endif |
357 | |
358 | bool referrerPolicyAttributeEnabled() const { return m_referrerPolicyAttributeEnabled; } |
359 | void setReferrerPolicyAttributeEnabled(bool isEnabled) { m_referrerPolicyAttributeEnabled = isEnabled; } |
360 | |
361 | bool pageAtRuleSupportEnabled() const { return m_pageAtRuleSupportEnabled; } |
362 | void setPageAtRuleSupportEnabled(bool isEnabled) { m_pageAtRuleSupportEnabled = isEnabled; } |
363 | |
364 | bool interruptAudioOnPageVisibilityChangeEnabled() const { return m_interruptAudioOnPageVisibilityChangeEnabled; } |
365 | void setInterruptAudioOnPageVisibilityChangeEnabled(bool enabled) { m_interruptAudioOnPageVisibilityChangeEnabled = enabled; } |
366 | |
367 | bool linkPreloadResponsiveImagesEnabled() const { return m_linkPreloadResponsiveImagesEnabled; } |
368 | void setLinkPreloadResponsiveImagesEnabled(bool isEnabled) { m_linkPreloadResponsiveImagesEnabled = isEnabled; } |
369 | |
370 | WEBCORE_EXPORT static RuntimeEnabledFeatures& sharedFeatures(); |
371 | |
372 | #if HAVE(NSURLSESSION_WEBSOCKET) |
373 | bool isNSURLSessionWebSocketEnabled() const { return m_isNSURLSessionWebSocketEnabled; } |
374 | void setIsNSURLSessionWebSocketEnabled(bool isEnabled) { m_isNSURLSessionWebSocketEnabled = isEnabled; } |
375 | #endif |
376 | |
377 | private: |
378 | // Never instantiate. |
379 | RuntimeEnabledFeatures(); |
380 | |
381 | bool m_blankAnchorTargetImpliesNoOpenerEnabled { true }; |
382 | bool m_areModernMediaControlsEnabled { false }; |
383 | bool m_isLinkPreloadEnabled { true }; |
384 | bool m_isLinkPrefetchEnabled { false }; |
385 | bool m_isMediaPreloadingEnabled { false }; |
386 | bool m_isResourceTimingEnabled { false }; |
387 | bool m_isUserTimingEnabled { false }; |
388 | bool m_isInteractiveFormValidationEnabled { false }; |
389 | bool m_isWebAuthenticationEnabled { false }; |
390 | bool m_isWebAuthenticationLocalAuthenticatorEnabled { false }; |
391 | bool m_isSecureContextAttributeEnabled { false }; |
392 | bool m_isDisplayContentsEnabled { true }; |
393 | bool m_isShadowDOMEnabled { true }; |
394 | bool m_areCustomElementsEnabled { true }; |
395 | bool { false }; |
396 | bool m_isDirectoryUploadEnabled { false }; |
397 | bool m_areDataTransferItemsEnabled { false }; |
398 | bool m_isCustomPasteboardDataEnabled { false }; |
399 | bool m_isWebShareEnabled { false }; |
400 | bool m_inputEventsEnabled { true }; |
401 | bool m_areWebAnimationsEnabled { false }; |
402 | bool m_isWebAnimationsCSSIntegrationEnabled { false }; |
403 | bool m_isImageBitmapOffscreenCanvasEnabled { true }; |
404 | bool m_isCacheAPIEnabled { false }; |
405 | bool m_isFetchAPIEnabled { true }; |
406 | bool m_isWebSocketEnabled { true }; |
407 | bool m_fetchAPIKeepAliveEnabled { false }; |
408 | bool m_inspectorAdditionsEnabled { false }; |
409 | bool m_webVREnabled { false }; |
410 | bool m_accessibilityObjectModelEnabled { false }; |
411 | bool m_ariaReflectionEnabled { true }; |
412 | bool m_itpDebugMode { false }; |
413 | bool m_isRestrictedHTTPResponseAccess { true }; |
414 | bool m_crossOriginResourcePolicyEnabled { true }; |
415 | bool m_isWebGLCompressedTextureASTCSupportEnabled { false }; |
416 | bool m_isServerTimingEnabled { false }; |
417 | bool m_experimentalPlugInSandboxProfilesEnabled { false }; |
418 | bool m_disabledAdaptationsMetaTagEnabled { false }; |
419 | bool m_attrStyleEnabled { false }; |
420 | bool m_webAPIStatisticsEnabled { false }; |
421 | bool m_CSSCustomPropertiesAndValuesEnabled { false }; |
422 | bool m_pointerEventsEnabled { true }; |
423 | bool m_syntheticEditingCommandsEnabled { true }; |
424 | bool m_webSQLEnabled { true }; |
425 | bool m_pageAtRuleSupportEnabled { false }; |
426 | |
427 | #if ENABLE(LAYOUT_FORMATTING_CONTEXT) |
428 | bool m_layoutFormattingContextEnabled { false }; |
429 | #endif |
430 | |
431 | #if ENABLE(CSS_PAINTING_API) |
432 | bool m_CSSPaintingAPIEnabled { false }; |
433 | #endif |
434 | |
435 | #if ENABLE(CSS_TYPED_OM) |
436 | bool m_CSSTypedOMEnabled { false }; |
437 | #endif |
438 | |
439 | #if ENABLE(ATTACHMENT_ELEMENT) |
440 | bool m_isAttachmentElementEnabled { false }; |
441 | #endif |
442 | |
443 | #if ENABLE(DARK_MODE_CSS) |
444 | bool m_isDarkModeCSSEnabled { true }; |
445 | #endif |
446 | |
447 | #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
448 | bool m_isIndexedDBWorkersEnabled { true }; |
449 | #endif |
450 | |
451 | #if ENABLE(MEDIA_STREAM) |
452 | bool m_isMediaRecorderEnabled { false }; |
453 | bool m_isMediaDevicesEnabled { false }; |
454 | bool m_isMediaStreamEnabled { true }; |
455 | bool m_isScreenCaptureEnabled { false }; |
456 | #endif |
457 | |
458 | #if ENABLE(WEB_RTC) |
459 | bool m_isWebRTCVP8CodecEnabled { true }; |
460 | bool m_isWebRTCUnifiedPlanEnabled { true }; |
461 | bool m_isPeerConnectionEnabled { true }; |
462 | bool m_isWebRTCMDNSICECandidatesEnabled { false }; |
463 | bool m_isWebRTCH264SimulcastEnabled { true }; |
464 | #endif |
465 | |
466 | #if ENABLE(LEGACY_CSS_VENDOR_PREFIXES) |
467 | bool m_isLegacyCSSVendorPrefixesEnabled { false }; |
468 | #endif |
469 | |
470 | #if ENABLE(INPUT_TYPE_COLOR) |
471 | bool m_isInputTypeColorEnabled { false }; |
472 | #endif |
473 | |
474 | #if ENABLE(DATALIST_ELEMENT) |
475 | bool m_isDataListElementEnabled { false }; |
476 | #endif |
477 | |
478 | #if ENABLE(INPUT_TYPE_DATE) |
479 | bool m_isInputTypeDateEnabled { true }; |
480 | #endif |
481 | |
482 | #if ENABLE(INPUT_TYPE_DATETIME_INCOMPLETE) |
483 | bool m_isInputTypeDateTimeEnabled { false }; |
484 | #endif |
485 | |
486 | #if ENABLE(INPUT_TYPE_DATETIMELOCAL) |
487 | bool m_isInputTypeDateTimeLocalEnabled { true }; |
488 | #endif |
489 | |
490 | #if ENABLE(INPUT_TYPE_MONTH) |
491 | bool m_isInputTypeMonthEnabled { true }; |
492 | #endif |
493 | |
494 | #if ENABLE(INPUT_TYPE_TIME) |
495 | bool m_isInputTypeTimeEnabled { true }; |
496 | #endif |
497 | |
498 | #if ENABLE(INPUT_TYPE_WEEK) |
499 | bool m_isInputTypeWeekEnabled { true }; |
500 | #endif |
501 | |
502 | #if ENABLE(GAMEPAD) |
503 | bool m_areGamepadsEnabled { false }; |
504 | #endif |
505 | |
506 | #if ENABLE(STREAMS_API) |
507 | bool m_isReadableByteStreamAPIEnabled { false }; |
508 | bool m_isWritableStreamAPIEnabled { false }; |
509 | #endif |
510 | |
511 | #if ENABLE(WEBGL2) |
512 | bool m_isWebGL2Enabled { false }; |
513 | #endif |
514 | |
515 | #if ENABLE(WEBGPU) |
516 | bool m_isWebGPUEnabled { false }; |
517 | #endif |
518 | |
519 | #if ENABLE(DOWNLOAD_ATTRIBUTE) |
520 | bool m_isDownloadAttributeEnabled { false }; |
521 | #endif |
522 | |
523 | #if ENABLE(ENCRYPTED_MEDIA) |
524 | bool m_encryptedMediaAPIEnabled { false }; |
525 | #endif |
526 | |
527 | #if ENABLE(LEGACY_ENCRYPTED_MEDIA) |
528 | bool m_legacyEncryptedMediaAPIEnabled { true }; |
529 | #endif |
530 | |
531 | #if ENABLE(INTERSECTION_OBSERVER) |
532 | bool m_intersectionObserverEnabled { false }; |
533 | #endif |
534 | |
535 | #if ENABLE(SERVICE_WORKER) |
536 | bool m_serviceWorkerEnabled { false }; |
537 | #endif |
538 | |
539 | #if USE(SYSTEM_PREVIEW) |
540 | bool m_systemPreviewEnabled { false }; |
541 | #endif |
542 | |
543 | bool m_undoManagerAPIEnabled { false }; |
544 | |
545 | bool m_CSSLogicalEnabled { false }; |
546 | |
547 | bool m_adClickAttributionEnabled { false }; |
548 | bool m_adClickAttributionDebugModeEnabled { false }; |
549 | |
550 | #if ENABLE(TOUCH_EVENTS) |
551 | bool m_mouseEventsSimulationEnabled { false }; |
552 | Optional<bool> m_touchEventsEnabled; |
553 | #endif |
554 | |
555 | bool m_isITPDatabaseEnabled { false }; |
556 | bool m_isITPFirstPartyWebsiteDataRemovalEnabled { false }; |
557 | |
558 | bool m_referrerPolicyAttributeEnabled { false }; |
559 | bool m_interruptAudioOnPageVisibilityChangeEnabled { false }; |
560 | |
561 | bool m_linkPreloadResponsiveImagesEnabled { false }; |
562 | |
563 | #if HAVE(NSURLSESSION_WEBSOCKET) |
564 | bool m_isNSURLSessionWebSocketEnabled { false }; |
565 | #endif |
566 | |
567 | friend class WTF::NeverDestroyed<RuntimeEnabledFeatures>; |
568 | }; |
569 | |
570 | } // namespace WebCore |
571 | |