blob: 645c606375ea14f7ce0d9668e0f3b43d7216ca89 [file] [log] [blame]
Matt Falkenhagen5cc652792018-06-21 10:34:331// Copyright 2018 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "third_party/blink/public/common/features.h"
6
Aran Gilman5e9672bed2019-08-02 19:07:497#include "base/feature_list.h"
Scott Haseley8eefdcd2018-08-22 16:50:198#include "build/build_config.h"
Hiroki Nakagawa893ee502019-02-04 06:49:539#include "services/network/public/cpp/features.h"
Aran Gilman5e9672bed2019-08-02 19:07:4910#include "third_party/blink/public/common/forcedark/forcedark_switches.h"
Scott Haseley8eefdcd2018-08-22 16:50:1911
Matt Falkenhagen5cc652792018-06-21 10:34:3312namespace blink {
13namespace features {
14
Yao Xiao2c1171a2019-04-01 23:44:3215// Enable intervention for download that was initiated from or occurred in an ad
16// frame without user activation.
17const base::Feature kBlockingDownloadsInAdFrameWithoutUserActivation{
18 "BlockingDownloadsInAdFrameWithoutUserActivation",
Yao Xiao3f9e4272019-05-23 15:22:4619 base::FEATURE_ENABLED_BY_DEFAULT};
Yao Xiao2c1171a2019-04-01 23:44:3220
Stephen Chenney1bcaec832019-10-10 18:31:0121// Enable defer commits to avoid flash of unstyled content.
22const base::Feature kPaintHolding{"PaintHolding",
23 base::FEATURE_ENABLED_BY_DEFAULT};
Stephen Chenneyde6e5c82019-01-21 01:56:0424
Matt Falkenhagenc25fea42018-07-17 07:13:5225// Enable eagerly setting up a CacheStorage interface pointer and
26// passing it to service workers on startup as an optimization.
Ben Kelly2c1cdd62020-05-04 22:05:0427// TODO(crbug/1077916): Re-enable once the issue with COOP/COEP is fixed.
Matt Falkenhagenc25fea42018-07-17 07:13:5228const base::Feature kEagerCacheStorageSetupForServiceWorkers{
29 "EagerCacheStorageSetupForServiceWorkers",
Ben Kelly2c1cdd62020-05-04 22:05:0430 base::FEATURE_DISABLED_BY_DEFAULT};
Matt Falkenhagenc25fea42018-07-17 07:13:5231
Peter Kvitek197eaf72018-12-04 19:14:5632// Controls script streaming.
33const base::Feature kScriptStreaming{"ScriptStreaming",
34 base::FEATURE_ENABLED_BY_DEFAULT};
35
Leszek Swirskif75c1912019-05-29 10:08:2536// Allow streaming small (<30kB) scripts.
37const base::Feature kSmallScriptStreaming{"SmallScriptStreaming",
38 base::FEATURE_DISABLED_BY_DEFAULT};
39
Keishi Hattori9e106922019-04-15 09:06:0340// Enables user level memory pressure signal generation on Android.
41const base::Feature kUserLevelMemoryPressureSignal{
42 "UserLevelMemoryPressureSignal", base::FEATURE_DISABLED_BY_DEFAULT};
43
Aditya Keerthi6a933902019-03-14 21:09:2744// Perform memory purges after freezing only if all pages are frozen.
45const base::Feature kFreezePurgeMemoryAllPagesFrozen{
46 "FreezePurgeMemoryAllPagesFrozen", base::FEATURE_DISABLED_BY_DEFAULT};
47
John Delaneyac24e572019-04-30 19:47:0248// Freezes the user-agent as part of https://github.com/WICG/ua-client-hints.
49const base::Feature kFreezeUserAgent{"FreezeUserAgent",
50 base::FEATURE_DISABLED_BY_DEFAULT};
51
Sam Fortiner3f07c632020-05-07 22:40:1852// When enabled, use the maximum possible bounds in compositing overlap testing
53// for fixed position elements.
54const base::Feature kMaxOverlapBoundsForFixed{
55 "MaxOverlapBoundsForFixed", base::FEATURE_DISABLED_BY_DEFAULT};
56
Vladimir Levin43758ecc2019-05-09 18:04:0357// Enable Display Locking JavaScript APIs.
58const base::Feature kDisplayLocking{"DisplayLocking",
59 base::FEATURE_DISABLED_BY_DEFAULT};
60
Sam Sebree2dd45c4f2019-12-13 05:51:4961const base::Feature kJSONModules{"JSONModules",
62 base::FEATURE_DISABLED_BY_DEFAULT};
63
Mason Freedd71a9642020-06-03 01:35:0764const base::Feature kForceSynchronousHTMLParsing{
65 "ForceSynchronousHTMLParsing", base::FEATURE_DISABLED_BY_DEFAULT};
66
Camillo Brunia19d7fc2020-03-17 07:53:3567// Enables top-level await in modules.
68const base::Feature kTopLevelAwait{"TopLevelAwait",
69 base::FEATURE_DISABLED_BY_DEFAULT};
70
Ian Kilpatricke68ef11a2018-07-04 03:52:1071// Enable LayoutNG.
Emil A Eklund69eeb562019-07-03 01:38:3072const base::Feature kLayoutNG{"LayoutNG", base::FEATURE_ENABLED_BY_DEFAULT};
Ian Kilpatricke68ef11a2018-07-04 03:52:1073
Koji Ishii14c52bd2020-06-11 17:00:5974const base::Feature kFragmentItem{"FragmentItem",
75 base::FEATURE_DISABLED_BY_DEFAULT};
76
Makoto Shimazu172eec02018-11-29 06:21:4477const base::Feature kMixedContentAutoupgrade{"AutoupgradeMixedContent",
Carlos IL9970a942020-02-14 01:16:5078 base::FEATURE_ENABLED_BY_DEFAULT};
Makoto Shimazu172eec02018-11-29 06:21:4479
Tarun Bansal422f9012019-01-23 16:55:5880// Used to control the collection of anchor element metrics (crbug.com/856683).
81// If kNavigationPredictor is enabled, then metrics of anchor elements
82// in the first viewport after the page load and the metrics of the clicked
83// anchor element will be extracted and recorded. Additionally, navigation
84// predictor may preconnect/prefetch to resources/origins to make the
85// future navigations faster.
Sofiya Semenovae4e076152019-07-29 20:10:2786const base::Feature kNavigationPredictor {
87 "NavigationPredictor",
88#if defined(OS_ANDROID)
89 base::FEATURE_ENABLED_BY_DEFAULT
90#else
91 base::FEATURE_DISABLED_BY_DEFAULT
92#endif
93};
Tarun Bansal422f9012019-01-23 16:55:5894
Hiroki Nakagawa61ee0042019-01-22 06:30:2695// Enable browser-initiated dedicated worker script loading
96// (PlzDedicatedWorker). https://crbug.com/906991
97const base::Feature kPlzDedicatedWorker{"PlzDedicatedWorker",
98 base::FEATURE_DISABLED_BY_DEFAULT};
99
Daniel Murphy95792ef2018-10-04 01:29:55100// Enable Portals. https://crbug.com/865123.
101const base::Feature kPortals{"Portals", base::FEATURE_DISABLED_BY_DEFAULT};
102
Jeremy Roman20366e42019-10-22 17:48:08103// When kPortals is enabled, allow portals to load content that is third-party
104// (cross-origin) to the hosting page. Otherwise has no effect.
105//
106// This will be disabled by default by the time Portals is generally available,
107// either in origin trial or shipped.
108//
109// https://crbug.com/1013389
110const base::Feature kPortalsCrossOrigin{"PortalsCrossOrigin",
111 base::FEATURE_ENABLED_BY_DEFAULT};
112
Tarun Bansal8df12b52019-02-15 05:46:30113// Enable limiting previews loading hints to specific resource types.
114const base::Feature kPreviewsResourceLoadingHintsSpecificResourceTypes{
115 "PreviewsResourceLoadingHintsSpecificResourceTypes",
116 base::FEATURE_DISABLED_BY_DEFAULT};
117
Aditya Keerthie84331b32019-03-20 15:25:52118// Perform a memory purge after a renderer is backgrounded. Formerly labelled as
119// the "PurgeAndSuspend" experiment.
120//
121// TODO(adityakeerthi): Disabled by default on Mac and Android for historical
122// reasons. Consider enabling by default if experiment results are positive.
123// https://crbug.com/926186
124const base::Feature kPurgeRendererMemoryWhenBackgrounded {
125 "PurgeRendererMemoryWhenBackgrounded",
126#if defined(OS_MACOSX) || defined(OS_ANDROID)
127 base::FEATURE_DISABLED_BY_DEFAULT
128#else
129 base::FEATURE_ENABLED_BY_DEFAULT
130#endif
131};
132
David Bokan911bded2018-11-27 23:23:32133// Enable Implicit Root Scroller. https://crbug.com/903260.
David Bokan145b5472019-05-22 14:38:44134// TODO(bokan): Temporarily disabled on desktop platforms to address issues
135// with non-overlay scrollbars. https://crbug.com/948059.
136const base::Feature kImplicitRootScroller {
137 "ImplicitRootScroller",
138#if defined(OS_ANDROID)
139 base::FEATURE_ENABLED_BY_DEFAULT
140#else
141 base::FEATURE_DISABLED_BY_DEFAULT
142#endif
143};
David Bokan911bded2018-11-27 23:23:32144
Cathie Cheneac70602019-10-10 02:55:29145// Enable CSSOM View Scroll Coordinates. https://crbug.com/721759.
146const base::Feature kCSSOMViewScrollCoordinates{
147 "CSSOMViewScrollCoordinates", base::FEATURE_DISABLED_BY_DEFAULT};
148
Darwin Huangf588cc8e2019-12-13 22:24:56149// Enables Raw Clipboard. https://crbug.com/897289.
150const base::Feature kRawClipboard{"RawClipboard",
151 base::FEATURE_DISABLED_BY_DEFAULT};
152
Makoto Shimazu172eec02018-11-29 06:21:44153// Enables usage of getDisplayMedia() that allows capture of web content, see
154// https://crbug.com/865060.
155const base::Feature kRTCGetDisplayMedia{"RTCGetDisplayMedia",
156 base::FEATURE_ENABLED_BY_DEFAULT};
157
158// Changes the default RTCPeerConnection constructor behavior to use Unified
159// Plan as the SDP semantics. When the feature is enabled, Unified Plan is used
160// unless the default is overridden (by passing {sdpSemantics:'plan-b'} as the
161// argument).
162const base::Feature kRTCUnifiedPlanByDefault{"RTCUnifiedPlanByDefault",
Henrik Boström07021ec82019-01-17 22:23:56163 base::FEATURE_ENABLED_BY_DEFAULT};
Makoto Shimazu172eec02018-11-29 06:21:44164
Johannes Kronad5a4532019-01-09 11:17:46165// Determines if the SDP attrbute extmap-allow-mixed should be offered by
166// default or not. The default value can be overridden by passing
167// {offerExtmapAllowMixed:true} as an argument to the RTCPeerConnection
168// constructor.
169const base::Feature kRTCOfferExtmapAllowMixed{
170 "RTCOfferExtmapAllowMixed", base::FEATURE_DISABLED_BY_DEFAULT};
171
Ulan Degenbaev4b3bc29b2020-03-13 17:09:00172// Prevents workers from sending IsolateInBackgroundNotification to V8
173// and thus instructs V8 to favor performance over memory on workers.
174const base::Feature kV8OptimizeWorkersForPerformance{
Ulan Degenbaev7acd73ea2020-04-07 16:02:33175 "V8OptimizeWorkersForPerformance", base::FEATURE_ENABLED_BY_DEFAULT};
Ulan Degenbaev4b3bc29b2020-03-13 17:09:00176
Antonio Gomesb4718572019-09-11 02:55:48177// Enables negotiation of experimental multiplex codec in SDP.
178const base::Feature kWebRtcMultiplexCodec{"WebRTC-MultiplexCodec",
179 base::FEATURE_DISABLED_BY_DEFAULT};
180
181// Causes WebRTC to replace host ICE candidate IP addresses with generated
182// names ending in ".local" and resolve them using mDNS.
183// http://crbug.com/878465
184const base::Feature kWebRtcHideLocalIpsWithMdns{
185 "WebRtcHideLocalIpsWithMdns", base::FEATURE_ENABLED_BY_DEFAULT};
186
Antonio Gomesf3bcd512019-09-03 21:27:17187#if BUILDFLAG(RTC_USE_H264) && BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS)
188// Run-time feature for the |rtc_use_h264| encoder/decoder.
189const base::Feature kWebRtcH264WithOpenH264FFmpeg{
190 "WebRTC-H264WithOpenH264FFmpeg", base::FEATURE_ENABLED_BY_DEFAULT};
191#endif // BUILDFLAG(RTC_USE_H264) && BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS)
192
Makoto Shimazua8b3d742019-04-05 06:55:51193// Experiment of the delay from navigation to starting an update of a service
194// worker's script.
195const base::Feature kServiceWorkerUpdateDelay{
196 "ServiceWorkerUpdateDelay", base::FEATURE_DISABLED_BY_DEFAULT};
197
Scott Haseley8eefdcd2018-08-22 16:50:19198// Freeze scheduler task queues in background after allowed grace time.
199// "stop" is a legacy name.
200const base::Feature kStopInBackground {
201 "stop-in-background",
202#if defined(OS_ANDROID)
203 base::FEATURE_ENABLED_BY_DEFAULT
204#else
205 base::FEATURE_DISABLED_BY_DEFAULT
206#endif
207};
208
Takashi Sakamotoc19fc2b2019-04-10 06:30:52209// Freeze scheduler task queues in background on network idle.
210// This feature only works if stop-in-background is enabled.
211const base::Feature kFreezeBackgroundTabOnNetworkIdle{
212 "freeze-background-tab-on-network-idle", base::FEATURE_DISABLED_BY_DEFAULT};
213
Shubhie Panicker60bd4b02018-09-26 00:02:15214// Freeze non-timer task queues in background, after allowed grace time.
215// "stop" is a legacy name.
Dave Tapuska9140c552019-05-30 16:18:56216const base::Feature kStopNonTimersInBackground{
217 "stop-non-timers-in-background", base::FEATURE_ENABLED_BY_DEFAULT};
Scott Haseley7757f6c2018-08-03 14:33:23218
Brandon Maslenda12cf82019-08-23 20:54:18219// Enable the Storage Access API. https://crbug.com/989663.
220const base::Feature kStorageAccessAPI{"StorageAccessAPI",
221 base::FEATURE_DISABLED_BY_DEFAULT};
222
David Bokane9370c22019-02-14 15:19:58223// Enable text snippets in URL fragments. https://crbug.com/919204.
224const base::Feature kTextFragmentAnchor{"TextFragmentAnchor",
Nick Burris62f8d5f02020-01-16 22:54:51225 base::FEATURE_ENABLED_BY_DEFAULT};
David Bokane9370c22019-02-14 15:19:58226
Marijn Kruisselbrinkca4bb5e2019-04-22 18:19:42227// Writable files and native file system access. https://crbug.com/853326
228const base::Feature kNativeFileSystemAPI{"NativeFileSystemAPI",
Marijn Kruisselbrink4cc3ec22019-09-04 16:28:20229 base::FEATURE_ENABLED_BY_DEFAULT};
Makoto Shimazu172eec02018-11-29 06:21:44230
Jay Harris583f48922019-05-06 05:55:24231// File handling integration. https://crbug.com/829689
232const base::Feature kFileHandlingAPI{"FileHandlingAPI",
233 base::FEATURE_DISABLED_BY_DEFAULT};
234
kdillon66bf5b522019-01-02 22:08:30235// Allows for synchronous XHR requests during page dismissal
Katie Dillon8b357312019-09-19 13:23:23236const base::Feature kAllowSyncXHRInPageDismissal{
237 "AllowSyncXHRInPageDismissal", base::FEATURE_DISABLED_BY_DEFAULT};
kdillon66bf5b522019-01-02 22:08:30238
Olivier Yiptongb60d2c42020-01-10 22:47:15239// Font enumeration and table access. https://crbug.com/535764 and
240// https://crbug.com/982054.
241const base::Feature kFontAccess{"FontAccess",
242 base::FEATURE_DISABLED_BY_DEFAULT};
243
Dominic Farolino780df942019-09-04 06:49:44244// Prefetch request properties are updated to be privacy-preserving. See
245// crbug.com/988956.
246const base::Feature kPrefetchPrivacyChanges{"PrefetchPrivacyChanges",
247 base::FEATURE_DISABLED_BY_DEFAULT};
Dominic Farolino693fd72d2019-08-05 11:09:44248
Carlos ILd3be52b2018-10-08 17:57:18249const char kMixedContentAutoupgradeModeParamName[] = "mode";
Carlos IL9970a942020-02-14 01:16:50250const char kMixedContentAutoupgradeModeAllPassive[] = "all-passive";
Carlos ILd3be52b2018-10-08 17:57:18251
Sasha McIntoshe889f9f2019-09-03 21:01:57252// Decodes jpeg 4:2:0 formatted images to YUV instead of RGBX and stores in this
253// format in the image decode cache. See crbug.com/919627 for details on the
254// feature.
Sasha McIntosh08ad21a2020-05-28 16:06:00255const base::Feature kDecodeJpeg420ImagesToYUV{"DecodeJpeg420ImagesToYUV",
256 base::FEATURE_ENABLED_BY_DEFAULT};
Sasha McIntoshe889f9f2019-09-03 21:01:57257
Madeleine Barowsky45be21a42018-12-07 18:39:30258// Decodes lossy WebP images to YUV instead of RGBX and stores in this format
259// in the image decode cache. See crbug.com/900264 for details on the feature.
260const base::Feature kDecodeLossyWebPImagesToYUV{
Sasha McIntoshf670a6b2020-01-09 18:27:09261 "DecodeLossyWebPImagesToYUV", base::FEATURE_ENABLED_BY_DEFAULT};
Madeleine Barowsky45be21a42018-12-07 18:39:30262
Takashi Toyoshimaa91506d2019-03-28 05:44:42263// Enables cache-aware WebFonts loading. See https://crbug.com/570205.
264// The feature is disabled on Android for WebView API issue discussed at
265// https://crbug.com/942440.
266const base::Feature kWebFontsCacheAwareTimeoutAdaption {
267 "WebFontsCacheAwareTimeoutAdaption",
268#if defined(OS_ANDROID)
269 base::FEATURE_DISABLED_BY_DEFAULT
270#else
271 base::FEATURE_ENABLED_BY_DEFAULT
272#endif
273};
274
Ehsan Karamadbe95d122019-05-10 17:59:06275// Enabled to block programmatic focus in subframes when not triggered by user
276// activation (see htpps://crbug.com/954349).
277const base::Feature kBlockingFocusWithoutUserActivation{
278 "BlockingFocusWithoutUserActivation", base::FEATURE_DISABLED_BY_DEFAULT};
279
Hongchan Choi370d3af2019-05-20 20:56:58280const base::Feature kAudioWorkletRealtimeThread{
281 "AudioWorkletRealtimeThread", base::FEATURE_DISABLED_BY_DEFAULT};
282
Ryan Sturm139c3ac2019-07-12 18:52:53283// A feature to reduce the set of resources fetched by No-State Prefetch.
Robert Ogden2bb6a2522020-06-05 00:28:10284const base::Feature kLightweightNoStatePrefetch {
Ryan Sturmf223cb02019-10-04 18:02:00285 "LightweightNoStatePrefetch",
286#if defined(OS_ANDROID)
287 base::FEATURE_ENABLED_BY_DEFAULT
288#else
289 base::FEATURE_DISABLED_BY_DEFAULT
290#endif
291};
Ryan Sturm139c3ac2019-07-12 18:52:53292
Aran Gilman5e9672bed2019-08-02 19:07:49293// Automatically convert light-themed pages to use a Blink-generated dark theme
294const base::Feature kForceWebContentsDarkMode{
295 "WebContentsForceDark", base::FEATURE_DISABLED_BY_DEFAULT};
296
Michael Crouseb7acd772020-02-20 02:56:26297// A feature to enable using the smallest image specified within image srcset
298// for users with Save Data enabled.
299const base::Feature kSaveDataImgSrcset{"SaveDataImgSrcset",
300 base::FEATURE_DISABLED_BY_DEFAULT};
301
Aran Gilman5e9672bed2019-08-02 19:07:49302// Which algorithm should be used for color inversion?
303const base::FeatureParam<ForceDarkInversionMethod>::Option
304 forcedark_inversion_method_options[] = {
305 {ForceDarkInversionMethod::kUseBlinkSettings,
306 "use_blink_settings_for_method"},
307 {ForceDarkInversionMethod::kHslBased, "hsl_based"},
Aran Gilman8b3ca41c2019-08-12 18:59:04308 {ForceDarkInversionMethod::kCielabBased, "cielab_based"},
309 {ForceDarkInversionMethod::kRgbBased, "rgb_based"}};
Aran Gilman5e9672bed2019-08-02 19:07:49310
311const base::FeatureParam<ForceDarkInversionMethod>
312 kForceDarkInversionMethodParam{&kForceWebContentsDarkMode,
313 "inversion_method",
314 ForceDarkInversionMethod::kUseBlinkSettings,
315 &forcedark_inversion_method_options};
316
317// Should images be inverted?
318const base::FeatureParam<ForceDarkImageBehavior>::Option
319 forcedark_image_behavior_options[] = {
320 {ForceDarkImageBehavior::kUseBlinkSettings,
321 "use_blink_settings_for_images"},
322 {ForceDarkImageBehavior::kInvertNone, "none"},
323 {ForceDarkImageBehavior::kInvertSelectively, "selective"}};
324
325const base::FeatureParam<ForceDarkImageBehavior> kForceDarkImageBehaviorParam{
326 &kForceWebContentsDarkMode, "image_behavior",
327 ForceDarkImageBehavior::kUseBlinkSettings,
328 &forcedark_image_behavior_options};
329
330// Do not invert text lighter than this.
331// Range: 0 (do not invert any text) to 256 (invert all text)
332// Can also set to -1 to let Blink's internal settings control the value
333const base::FeatureParam<int> kForceDarkTextLightnessThresholdParam{
334 &kForceWebContentsDarkMode, "text_lightness_threshold", -1};
335
336// Do not invert backgrounds darker than this.
337// Range: 0 (invert all backgrounds) to 256 (invert no backgrounds)
338// Can also set to -1 to let Blink's internal settings control the value
339const base::FeatureParam<int> kForceDarkBackgroundLightnessThresholdParam{
340 &kForceWebContentsDarkMode, "background_lightness_threshold", -1};
341
Sergey Silkinc33244f2020-01-31 17:21:30342// Instructs WebRTC to honor the Min/Max Video Encode Accelerator dimensions.
Miguel Casas-Sanchezb6128392020-02-18 15:45:39343const base::Feature kWebRtcUseMinMaxVEADimensions {
344 "WebRtcUseMinMaxVEADimensions",
345 // TODO(crbug.com/1008491): enable other platforms.
346#if defined(OS_CHROMEOS)
347 base::FEATURE_ENABLED_BY_DEFAULT
348#else
349 base::FEATURE_DISABLED_BY_DEFAULT
350#endif
351};
Sergey Silkinc33244f2020-01-31 17:21:30352
Michael Lippautze670df9f2019-07-09 11:39:49353// Blink garbage collection.
354// Enables compaction of backing stores on Blink's heap.
355const base::Feature kBlinkHeapCompaction{"BlinkHeapCompaction",
356 base::FEATURE_ENABLED_BY_DEFAULT};
357// Enables concurrently marking Blink's heap.
358const base::Feature kBlinkHeapConcurrentMarking{
Omer Katz1757893c2020-02-17 12:09:19359 "BlinkHeapConcurrentMarking", base::FEATURE_ENABLED_BY_DEFAULT};
Anton Bikineev9b7b3722019-07-09 13:48:39360// Enables concurrently sweeping Blink's heap.
361const base::Feature kBlinkHeapConcurrentSweeping{
Anton Bikineev204cc752019-08-07 00:26:37362 "BlinkHeapConcurrentSweeping", base::FEATURE_ENABLED_BY_DEFAULT};
Michael Lippautze670df9f2019-07-09 11:39:49363// Enables incrementally marking Blink's heap.
364const base::Feature kBlinkHeapIncrementalMarking{
365 "BlinkHeapIncrementalMarking", base::FEATURE_ENABLED_BY_DEFAULT};
366// Enables a marking stress mode that schedules more garbage collections and
367// also adds additional verification passes.
368const base::Feature kBlinkHeapIncrementalMarkingStress{
369 "BlinkHeapIncrementalMarkingStress", base::FEATURE_DISABLED_BY_DEFAULT};
Michael Lippautze670df9f2019-07-09 11:39:49370
Yoav Weissddfb8d2e2019-07-15 22:34:03371// Enables removing AppCache delays when triggering requests when the HTML was
372// not fetched from AppCache.
373const base::Feature kVerifyHTMLFetchedFromAppCacheBeforeDelay{
374 "VerifyHTMLFetchedFromAppCacheBeforeDelay",
375 base::FEATURE_DISABLED_BY_DEFAULT};
376
Michael Spang8d2303e2019-07-26 01:56:32377// Controls whether we use ThreadPriority::DISPLAY for renderer
378// compositor & IO threads.
379const base::Feature kBlinkCompositorUseDisplayThreadPriority {
380 "BlinkCompositorUseDisplayThreadPriority",
Sunny Sachanandani16944252019-12-04 03:40:49381#if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(OS_WIN)
Michael Spang8d2303e2019-07-26 01:56:32382 base::FEATURE_ENABLED_BY_DEFAULT
383#else
384 base::FEATURE_DISABLED_BY_DEFAULT
385#endif
386};
387
Yuki Shiinoa812f492019-08-23 06:47:46388// Ignores cross origin windows in the named property interceptor of Window.
389// https://crbug.com/538562
390const base::Feature kIgnoreCrossOriginWindowWhenNamedAccessOnWindow{
391 "IgnoreCrossOriginWindowWhenNamedAccessOnWindow",
392 base::FEATURE_DISABLED_BY_DEFAULT};
393
Tarun Bansal38792462019-09-04 16:08:11394// When enabled, loading priority of JavaScript requests is lowered when they
395// are force deferred by the intervention.
396const base::Feature kLowerJavaScriptPriorityWhenForceDeferred{
397 "LowerJavaScriptPriorityWhenForceDeferred",
Tarun Bansal755268fe2019-10-18 18:57:40398 base::FEATURE_DISABLED_BY_DEFAULT};
Tarun Bansal38792462019-09-04 16:08:11399
Tarun Bansalf32aaa22020-02-12 16:16:44400// When enabled, scripts in iframes are not force deferred by the DeferAllScript
401// intervention.
402const base::Feature kDisableForceDeferInChildFrames{
403 "DisableForceDeferInChildFrames", base::FEATURE_DISABLED_BY_DEFAULT};
404
rajendrantd5db55f2019-10-19 01:56:59405// Enables redirecting subresources in the page to better compressed and
406// optimized versions to provide data savings.
407const base::Feature kSubresourceRedirect{"SubresourceRedirect",
408 base::FEATURE_DISABLED_BY_DEFAULT};
409
Stefan Zagerfd18161c2019-10-22 20:44:31410// When 'enabled', all cross-origin iframes will get a compositing layer.
411const base::Feature kCompositeCrossOriginIframes{
412 "CompositeCrossOriginIframes", base::FEATURE_DISABLED_BY_DEFAULT};
Yutaka Hirano0b3c319b2019-10-25 17:19:15413
Chris Harrelson70be13d2020-06-03 21:06:52414// When enabled, enforces new interoperable semantics for 3D transforms.
415// See crbug.com/1008483.
416const base::Feature kTransformInterop{"TransformInterop",
417 base::FEATURE_DISABLED_BY_DEFAULT};
418
Yutaka Hirano0b3c319b2019-10-25 17:19:15419// When enabled, beacons (and friends) have ResourceLoadPriority::kLow,
420// not ResourceLoadPriority::kVeryLow.
421const base::Feature kSetLowPriorityForBeacon{"SetLowPriorityForBeacon",
422 base::FEATURE_DISABLED_BY_DEFAULT};
423
Ben Kelly776f59d2019-11-06 16:25:30424// When enabled allows the header name used in the blink
425// CacheStorageCodeCacheHint runtime feature to be modified. This runtime
426// feature disables generating full code cache for responses stored in
427// cache_storage during a service worker install event. The runtime feature
428// must be enabled via the blink runtime feature mechanism, however.
429const base::Feature kCacheStorageCodeCacheHintHeader{
430 "CacheStorageCodeCacheHintHeader", base::FEATURE_DISABLED_BY_DEFAULT};
431const base::FeatureParam<std::string> kCacheStorageCodeCacheHintHeaderName{
432 &kCacheStorageCodeCacheHintHeader, "name", "x-CacheStorageCodeCacheHint"};
433
Francois Doray563453432019-11-20 15:32:17434// When enabled, the beforeunload handler is dispatched when a frame is frozen.
435// This allows the browser to know whether discarding the frame could result in
436// lost user data, at the cost of extra CPU usage. The feature will be removed
437// once we have determine whether the CPU cost is acceptable.
438const base::Feature kDispatchBeforeUnloadOnFreeze{
439 "DispatchBeforeUnloadOnFreeze", base::FEATURE_ENABLED_BY_DEFAULT};
440
Sunny Sachanandani26463422019-12-05 21:35:40441// Enables the use of GpuMemoryBuffer images for low latency 2d canvas.
442// TODO(khushalsagar): Enable this if we're using SurfaceControl and GMBs allow
443// us to overlay these resources.
444const base::Feature kLowLatencyCanvas2dImageChromium {
445 "LowLatencyCanvas2dImageChromium",
446#if defined(OS_CHROMEOS)
447 base::FEATURE_ENABLED_BY_DEFAULT
448#else
449 base::FEATURE_DISABLED_BY_DEFAULT
450#endif // OS_CHROMEOS
451};
452
453// Enables the use of shared image swap chains for low latency 2d canvas.
454const base::Feature kLowLatencyCanvas2dSwapChain{
Sunny Sachanandanib954dc7c2019-12-12 02:50:51455 "LowLatencyCanvas2dSwapChain", base::FEATURE_ENABLED_BY_DEFAULT};
Sunny Sachanandani26463422019-12-05 21:35:40456
457// Enables the use of shared image swap chains for low latency webgl canvas.
Sunny Sachanandanib954dc7c2019-12-12 02:50:51458const base::Feature kLowLatencyWebGLSwapChain{"LowLatencyWebGLSwapChain",
459 base::FEATURE_ENABLED_BY_DEFAULT};
Sunny Sachanandani26463422019-12-05 21:35:40460
Stephen Whitee17b0232020-04-27 23:48:49461// Enables Dawn-accelerated 2D canvas.
462const base::Feature kDawn2dCanvas{"Dawn2dCanvas",
463 base::FEATURE_DISABLED_BY_DEFAULT};
464
Xiaocheng Hud5197fd2020-02-06 07:26:08465const base::Feature kCSSReducedFontLoadingInvalidations{
466 "CSSReducedFontLoadingInvalidations", base::FEATURE_DISABLED_BY_DEFAULT};
Xiaocheng Hu5aba5002020-06-06 04:16:27467const base::Feature kCSSReducedFontLoadingLayoutInvalidations{
468 "CSSReducedFontLoadingLayoutInvalidations",
469 base::FEATURE_DISABLED_BY_DEFAULT};
Xiaocheng Hud5197fd2020-02-06 07:26:08470
Egor Pasko28ec46952020-02-07 15:17:57471// When enabled, frees up CachedMetadata after consumption by script resources
472// and modules. Needed for the experiment in http://crbug.com/1045052.
473const base::Feature kDiscardCodeCacheAfterFirstUse{
474 "DiscardCodeCacheAfterFirstUse", base::FEATURE_DISABLED_BY_DEFAULT};
475
Yutaka Hiranobf410a42020-02-18 08:08:45476// The kill-switch for the fix for https://crbug.com/1051439.
477// TODO(crbug.com/1053369): Remove this around M84.
478const base::Feature kSuppressContentTypeForBeaconMadeWithArrayBufferView{
479 "SuppressContentTypeForBeaconMadeWithArrayBufferView",
480 base::FEATURE_ENABLED_BY_DEFAULT};
481
Ian Kilpatrickef7f4382020-06-02 12:38:10482const base::Feature kBlockFlowHandlesWebkitLineClamp{
Ian Kilpatrickbdec8902020-06-02 12:46:09483 "BlockFlowHandlesWebkitLineClamp", base::FEATURE_ENABLED_BY_DEFAULT};
Ian Kilpatrickef7f4382020-06-02 12:38:10484
Rune Lillesveen61f49ee2020-03-02 07:53:49485const base::Feature kBlockHTMLParserOnStyleSheets{
486 "BlockHTMLParserOnStyleSheets", base::FEATURE_DISABLED_BY_DEFAULT};
487
Mason Freed0ebaa772020-06-03 16:11:08488// Kill switch for the new <link disabled> behavior.
489// TODO(crbug.com/1087043): Remove this once the feature has
490// landed and no compat issues are reported.
491const base::Feature kLinkDisabledNewSpecBehavior{
492 "LinkDisabledNewSpecBehavior", base::FEATURE_ENABLED_BY_DEFAULT};
493
Xiaocheng Hud2e807d2020-03-04 21:15:21494// Slightly delays rendering if there are fonts being preloaded, so that
495// they don't miss the first paint if they can be loaded fast enough (e.g.,
496// from the disk cache)
497const base::Feature kFontPreloadingDelaysRendering{
498 "FontPreloadingDelaysRendering", base::FEATURE_DISABLED_BY_DEFAULT};
499
500// Set to be over 90th-percentile of HttpCache.AccessToDone.Used on all
501// platforms, and also to allow some time for IPC and scheduling.
502// TODO(xiaochengh): Tune it for the best performance.
503const base::FeatureParam<int> kFontPreloadingDelaysRenderingParam{
504 &kFontPreloadingDelaysRendering, "delay-in-ms", 100};
505
David Grogan17b34f4f2020-05-11 19:35:19506const base::Feature kFlexGaps{"FlexGaps", base::FEATURE_DISABLED_BY_DEFAULT};
David Grogan565f8bb2020-05-27 03:07:40507const base::Feature kFlexNG{"FlexNG", base::FEATURE_ENABLED_BY_DEFAULT};
David Grogan5b3cf162020-03-19 21:53:15508
Dominic Farolino0f55a082020-03-24 09:47:55509const base::Feature kKeepScriptResourceAlive{"KeepScriptResourceAlive",
510 base::FEATURE_DISABLED_BY_DEFAULT};
Dominic Farolino7d3d6f12020-06-10 21:59:46511const base::Feature kDelayAsyncScriptExecution{
512 "DelayAsyncScriptExecution", base::FEATURE_DISABLED_BY_DEFAULT};
513const base::FeatureParam<DelayAsyncScriptDelayType>::Option
514 delay_async_script_execution_delay_types[] = {
515 {DelayAsyncScriptDelayType::kFinishedParsing, "finished_parsing"},
516 {DelayAsyncScriptDelayType::kFirstPaintOrFinishedParsing,
517 "first_paint_or_finished_parsing"}};
518const base::FeatureParam<DelayAsyncScriptDelayType>
519 kDelayAsyncScriptExecutionDelayParam{
520 &kDelayAsyncScriptExecution, "delay_type",
521 DelayAsyncScriptDelayType::kFinishedParsing,
522 &delay_async_script_execution_delay_types};
Dominic Farolino0f55a082020-03-24 09:47:55523
Adrienne Walkerb53b4372020-05-06 18:57:18524// The AppCache feature is a kill-switch for the entire AppCache feature,
525// both backend and API. If disabled, then it will turn off the backend and
526// api, regardless of the presence of valid origin trial tokens.
Adrienne Walkere6b51722020-04-01 17:56:38527const base::Feature kAppCache{"AppCache", base::FEATURE_ENABLED_BY_DEFAULT};
Adrienne Walkerb53b4372020-05-06 18:57:18528// If AppCacheRequireOriginTrial is enabled, then the AppCache backend in the
529// browser will require origin trial tokens in order to load or store manifests
530// and their contents.
531const base::Feature kAppCacheRequireOriginTrial{
Adrienne Walkerdd9442e02020-06-10 16:23:40532 "AppCacheRequireOriginTrial", base::FEATURE_ENABLED_BY_DEFAULT};
Adrienne Walkere6b51722020-04-01 17:56:38533
Wan-Teh Chang75fd5322020-04-08 01:32:18534// Enables the AV1 Image File Format (AVIF).
535const base::Feature kAVIF{"AVIF", base::FEATURE_DISABLED_BY_DEFAULT};
536
Xiaocheng Hu66795f02020-04-25 00:26:47537// Make all pending 'display: auto' web fonts enter the swap or failure period
Xiaocheng Hu9e2055c2020-04-09 20:35:28538// immediately before reaching the LCP time limit (~2500ms), so that web fonts
539// do not become a source of bad LCP.
540const base::Feature kAlignFontDisplayAutoTimeoutWithLCPGoal{
541 "AlignFontDisplayAutoTimeoutWithLCPGoal",
542 base::FEATURE_DISABLED_BY_DEFAULT};
543
Xiaocheng Hu66795f02020-04-25 00:26:47544// The amount of time allowed for 'display: auto' web fonts to load without
545// intervention, counted from navigation start.
546const base::FeatureParam<int>
547 kAlignFontDisplayAutoTimeoutWithLCPGoalTimeoutParam{
548 &kAlignFontDisplayAutoTimeoutWithLCPGoal, "lcp-limit-in-ms", 2000};
549
550const base::FeatureParam<AlignFontDisplayAutoTimeoutWithLCPGoalMode>::Option
551 align_font_display_auto_timeout_with_lcp_goal_modes[] = {
552 {AlignFontDisplayAutoTimeoutWithLCPGoalMode::kToFailurePeriod,
553 "failure"},
554 {AlignFontDisplayAutoTimeoutWithLCPGoalMode::kToSwapPeriod, "swap"}};
555const base::FeatureParam<AlignFontDisplayAutoTimeoutWithLCPGoalMode>
556 kAlignFontDisplayAutoTimeoutWithLCPGoalModeParam{
557 &kAlignFontDisplayAutoTimeoutWithLCPGoal, "intervention-mode",
558 AlignFontDisplayAutoTimeoutWithLCPGoalMode::kToFailurePeriod,
559 &align_font_display_auto_timeout_with_lcp_goal_modes};
Xiaocheng Hu9e2055c2020-04-09 20:35:28560
Ben Kellyd52869b2020-04-20 17:17:43561// Enable throttling of fetch() requests from service workers in the
562// installing state.
563const base::Feature kThrottleInstallingServiceWorker{
564 "ThrottleInstallingServiceWorker", base::FEATURE_DISABLED_BY_DEFAULT};
565const base::FeatureParam<int> kInstallingServiceWorkerOutstandingThrottledLimit{
566 &kThrottleInstallingServiceWorker, "limit", 5};
567
Dave Tapuska95b71c82020-06-08 16:56:11568const base::Feature kInputPredictorTypeChoice{
569 "InputPredictorTypeChoice", base::FEATURE_DISABLED_BY_DEFAULT};
570
571const base::Feature kResamplingInputEvents{"ResamplingInputEvents",
572 base::FEATURE_DISABLED_BY_DEFAULT};
573
Dave Tapuskafea88942020-05-05 18:50:32574const base::Feature kResamplingScrollEvents{"ResamplingScrollEvents",
575 base::FEATURE_ENABLED_BY_DEFAULT};
576
Yoav Weiss200214d52020-05-13 23:58:42577// Enables the device-memory, resource-width, viewport-width and DPR client
578// hints to be sent to third-party origins if the first-party has opted in to
579// receiving client hints, regardless of Feature Policy.
580#if defined(OS_ANDROID)
581const base::Feature kAllowClientHintsToThirdParty{
582 "AllowClientHintsToThirdParty", base::FEATURE_ENABLED_BY_DEFAULT};
583#else
584const base::Feature kAllowClientHintsToThirdParty{
585 "AllowClientHintsToThirdParty", base::FEATURE_DISABLED_BY_DEFAULT};
586#endif
587
Dave Tapuskafea88942020-05-05 18:50:32588const char kScrollPredictorNameLsq[] = "lsq";
589const char kScrollPredictorNameKalman[] = "kalman";
590const char kScrollPredictorNameLinearFirst[] = "linear_first";
591const char kScrollPredictorNameLinearSecond[] = "linear_second";
592const char kScrollPredictorNameLinearResampling[] = "linear_resampling";
593const char kScrollPredictorNameEmpty[] = "empty";
594
595const base::Feature kFilteringScrollPrediction{
596 "FilteringScrollPrediction", base::FEATURE_DISABLED_BY_DEFAULT};
597
598const char kFilterNameEmpty[] = "empty_filter";
599const char kFilterNameOneEuro[] = "one_euro_filter";
600
601const base::Feature kKalmanHeuristics{"KalmanHeuristics",
602 base::FEATURE_DISABLED_BY_DEFAULT};
603
604const base::Feature kKalmanDirectionCutOff{"KalmanDirectionCutOff",
605 base::FEATURE_DISABLED_BY_DEFAULT};
606
607const base::Feature kSkipTouchEventFilter{"SkipTouchEventFilter",
608 base::FEATURE_ENABLED_BY_DEFAULT};
609const char kSkipTouchEventFilterTypeParamName[] = "type";
610const char kSkipTouchEventFilterTypeParamValueDiscrete[] = "discrete";
611const char kSkipTouchEventFilterTypeParamValueAll[] = "all";
612const char kSkipTouchEventFilterFilteringProcessParamName[] =
613 "skip_filtering_process";
614const char kSkipTouchEventFilterFilteringProcessParamValueBrowser[] = "browser";
615const char kSkipTouchEventFilterFilteringProcessParamValueBrowserAndRenderer[] =
616 "browser_and_renderer";
617
Patrick To2afc1162020-06-03 18:19:30618// Improves support for WebXR on computers with multiple GPUs.
619const base::Feature kWebXrMultiGpu{"WebXRMultiGpu",
620 base::FEATURE_DISABLED_BY_DEFAULT};
621
Anders Hartvoll Ruud80f8818812020-06-09 08:07:31622// Enables dependency support in blink::MatchedPropertiesCache, which allows
623// caching of previously uncachable objects.
624const base::Feature kCSSMatchedPropertiesCacheDependencies{
625 "CSSMatchedPropertiesCacheDependencies", base::FEATURE_DISABLED_BY_DEFAULT};
626
Matt Falkenhagen5cc652792018-06-21 10:34:33627} // namespace features
628} // namespace blink