blob: f4724ca121031da0bb8d36c01c6ed1c9657ee5a0 [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 Fortiner7c87736f2019-12-12 22:42:0052// When enabled, enter assumed-overlap mode in compositing overlap testing
53// anytime a fixed or sticky position element is encountered.
54const base::Feature kAssumeOverlapAfterFixedOrStickyPosition{
55 "AssumeOverlapAfterFixedOrStickyPosition",
56 base::FEATURE_DISABLED_BY_DEFAULT};
57
Vladimir Levin43758ecc2019-05-09 18:04:0358// Enable Display Locking JavaScript APIs.
59const base::Feature kDisplayLocking{"DisplayLocking",
60 base::FEATURE_DISABLED_BY_DEFAULT};
61
Sam Sebree2dd45c4f2019-12-13 05:51:4962const base::Feature kJSONModules{"JSONModules",
63 base::FEATURE_DISABLED_BY_DEFAULT};
64
Camillo Brunia19d7fc2020-03-17 07:53:3565// Enables top-level await in modules.
66const base::Feature kTopLevelAwait{"TopLevelAwait",
67 base::FEATURE_DISABLED_BY_DEFAULT};
68
Ian Kilpatricke68ef11a2018-07-04 03:52:1069// Enable LayoutNG.
Emil A Eklund69eeb562019-07-03 01:38:3070const base::Feature kLayoutNG{"LayoutNG", base::FEATURE_ENABLED_BY_DEFAULT};
Ian Kilpatricke68ef11a2018-07-04 03:52:1071
Makoto Shimazu172eec02018-11-29 06:21:4472const base::Feature kMixedContentAutoupgrade{"AutoupgradeMixedContent",
Carlos IL9970a942020-02-14 01:16:5073 base::FEATURE_ENABLED_BY_DEFAULT};
Makoto Shimazu172eec02018-11-29 06:21:4474
Tarun Bansal422f9012019-01-23 16:55:5875// Used to control the collection of anchor element metrics (crbug.com/856683).
76// If kNavigationPredictor is enabled, then metrics of anchor elements
77// in the first viewport after the page load and the metrics of the clicked
78// anchor element will be extracted and recorded. Additionally, navigation
79// predictor may preconnect/prefetch to resources/origins to make the
80// future navigations faster.
Sofiya Semenovae4e076152019-07-29 20:10:2781const base::Feature kNavigationPredictor {
82 "NavigationPredictor",
83#if defined(OS_ANDROID)
84 base::FEATURE_ENABLED_BY_DEFAULT
85#else
86 base::FEATURE_DISABLED_BY_DEFAULT
87#endif
88};
Tarun Bansal422f9012019-01-23 16:55:5889
Hiroki Nakagawa61ee0042019-01-22 06:30:2690// Enable browser-initiated dedicated worker script loading
91// (PlzDedicatedWorker). https://crbug.com/906991
92const base::Feature kPlzDedicatedWorker{"PlzDedicatedWorker",
93 base::FEATURE_DISABLED_BY_DEFAULT};
94
Daniel Murphy95792ef2018-10-04 01:29:5595// Enable Portals. https://crbug.com/865123.
96const base::Feature kPortals{"Portals", base::FEATURE_DISABLED_BY_DEFAULT};
97
Jeremy Roman20366e42019-10-22 17:48:0898// When kPortals is enabled, allow portals to load content that is third-party
99// (cross-origin) to the hosting page. Otherwise has no effect.
100//
101// This will be disabled by default by the time Portals is generally available,
102// either in origin trial or shipped.
103//
104// https://crbug.com/1013389
105const base::Feature kPortalsCrossOrigin{"PortalsCrossOrigin",
106 base::FEATURE_ENABLED_BY_DEFAULT};
107
Tarun Bansal8df12b52019-02-15 05:46:30108// Enable limiting previews loading hints to specific resource types.
109const base::Feature kPreviewsResourceLoadingHintsSpecificResourceTypes{
110 "PreviewsResourceLoadingHintsSpecificResourceTypes",
111 base::FEATURE_DISABLED_BY_DEFAULT};
112
Aditya Keerthie84331b32019-03-20 15:25:52113// Perform a memory purge after a renderer is backgrounded. Formerly labelled as
114// the "PurgeAndSuspend" experiment.
115//
116// TODO(adityakeerthi): Disabled by default on Mac and Android for historical
117// reasons. Consider enabling by default if experiment results are positive.
118// https://crbug.com/926186
119const base::Feature kPurgeRendererMemoryWhenBackgrounded {
120 "PurgeRendererMemoryWhenBackgrounded",
121#if defined(OS_MACOSX) || defined(OS_ANDROID)
122 base::FEATURE_DISABLED_BY_DEFAULT
123#else
124 base::FEATURE_ENABLED_BY_DEFAULT
125#endif
126};
127
David Bokan911bded2018-11-27 23:23:32128// Enable Implicit Root Scroller. https://crbug.com/903260.
David Bokan145b5472019-05-22 14:38:44129// TODO(bokan): Temporarily disabled on desktop platforms to address issues
130// with non-overlay scrollbars. https://crbug.com/948059.
131const base::Feature kImplicitRootScroller {
132 "ImplicitRootScroller",
133#if defined(OS_ANDROID)
134 base::FEATURE_ENABLED_BY_DEFAULT
135#else
136 base::FEATURE_DISABLED_BY_DEFAULT
137#endif
138};
David Bokan911bded2018-11-27 23:23:32139
Cathie Cheneac70602019-10-10 02:55:29140// Enable CSSOM View Scroll Coordinates. https://crbug.com/721759.
141const base::Feature kCSSOMViewScrollCoordinates{
142 "CSSOMViewScrollCoordinates", base::FEATURE_DISABLED_BY_DEFAULT};
143
Darwin Huangf588cc8e2019-12-13 22:24:56144// Enables Raw Clipboard. https://crbug.com/897289.
145const base::Feature kRawClipboard{"RawClipboard",
146 base::FEATURE_DISABLED_BY_DEFAULT};
147
Makoto Shimazu172eec02018-11-29 06:21:44148// Enables usage of getDisplayMedia() that allows capture of web content, see
149// https://crbug.com/865060.
150const base::Feature kRTCGetDisplayMedia{"RTCGetDisplayMedia",
151 base::FEATURE_ENABLED_BY_DEFAULT};
152
153// Changes the default RTCPeerConnection constructor behavior to use Unified
154// Plan as the SDP semantics. When the feature is enabled, Unified Plan is used
155// unless the default is overridden (by passing {sdpSemantics:'plan-b'} as the
156// argument).
157const base::Feature kRTCUnifiedPlanByDefault{"RTCUnifiedPlanByDefault",
Henrik Boström07021ec82019-01-17 22:23:56158 base::FEATURE_ENABLED_BY_DEFAULT};
Makoto Shimazu172eec02018-11-29 06:21:44159
Johannes Kronad5a4532019-01-09 11:17:46160// Determines if the SDP attrbute extmap-allow-mixed should be offered by
161// default or not. The default value can be overridden by passing
162// {offerExtmapAllowMixed:true} as an argument to the RTCPeerConnection
163// constructor.
164const base::Feature kRTCOfferExtmapAllowMixed{
165 "RTCOfferExtmapAllowMixed", base::FEATURE_DISABLED_BY_DEFAULT};
166
Ulan Degenbaev4b3bc29b2020-03-13 17:09:00167// Prevents workers from sending IsolateInBackgroundNotification to V8
168// and thus instructs V8 to favor performance over memory on workers.
169const base::Feature kV8OptimizeWorkersForPerformance{
Ulan Degenbaev7acd73ea2020-04-07 16:02:33170 "V8OptimizeWorkersForPerformance", base::FEATURE_ENABLED_BY_DEFAULT};
Ulan Degenbaev4b3bc29b2020-03-13 17:09:00171
Antonio Gomesb4718572019-09-11 02:55:48172// Enables negotiation of experimental multiplex codec in SDP.
173const base::Feature kWebRtcMultiplexCodec{"WebRTC-MultiplexCodec",
174 base::FEATURE_DISABLED_BY_DEFAULT};
175
176// Causes WebRTC to replace host ICE candidate IP addresses with generated
177// names ending in ".local" and resolve them using mDNS.
178// http://crbug.com/878465
179const base::Feature kWebRtcHideLocalIpsWithMdns{
180 "WebRtcHideLocalIpsWithMdns", base::FEATURE_ENABLED_BY_DEFAULT};
181
Antonio Gomesf3bcd512019-09-03 21:27:17182#if BUILDFLAG(RTC_USE_H264) && BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS)
183// Run-time feature for the |rtc_use_h264| encoder/decoder.
184const base::Feature kWebRtcH264WithOpenH264FFmpeg{
185 "WebRTC-H264WithOpenH264FFmpeg", base::FEATURE_ENABLED_BY_DEFAULT};
186#endif // BUILDFLAG(RTC_USE_H264) && BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS)
187
Makoto Shimazua8b3d742019-04-05 06:55:51188// Experiment of the delay from navigation to starting an update of a service
189// worker's script.
190const base::Feature kServiceWorkerUpdateDelay{
191 "ServiceWorkerUpdateDelay", base::FEATURE_DISABLED_BY_DEFAULT};
192
Scott Haseley8eefdcd2018-08-22 16:50:19193// Freeze scheduler task queues in background after allowed grace time.
194// "stop" is a legacy name.
195const base::Feature kStopInBackground {
196 "stop-in-background",
197#if defined(OS_ANDROID)
198 base::FEATURE_ENABLED_BY_DEFAULT
199#else
200 base::FEATURE_DISABLED_BY_DEFAULT
201#endif
202};
203
Takashi Sakamotoc19fc2b2019-04-10 06:30:52204// Freeze scheduler task queues in background on network idle.
205// This feature only works if stop-in-background is enabled.
206const base::Feature kFreezeBackgroundTabOnNetworkIdle{
207 "freeze-background-tab-on-network-idle", base::FEATURE_DISABLED_BY_DEFAULT};
208
Shubhie Panicker60bd4b02018-09-26 00:02:15209// Freeze non-timer task queues in background, after allowed grace time.
210// "stop" is a legacy name.
Dave Tapuska9140c552019-05-30 16:18:56211const base::Feature kStopNonTimersInBackground{
212 "stop-non-timers-in-background", base::FEATURE_ENABLED_BY_DEFAULT};
Scott Haseley7757f6c2018-08-03 14:33:23213
Brandon Maslenda12cf82019-08-23 20:54:18214// Enable the Storage Access API. https://crbug.com/989663.
215const base::Feature kStorageAccessAPI{"StorageAccessAPI",
216 base::FEATURE_DISABLED_BY_DEFAULT};
217
David Bokane9370c22019-02-14 15:19:58218// Enable text snippets in URL fragments. https://crbug.com/919204.
219const base::Feature kTextFragmentAnchor{"TextFragmentAnchor",
Nick Burris62f8d5f02020-01-16 22:54:51220 base::FEATURE_ENABLED_BY_DEFAULT};
David Bokane9370c22019-02-14 15:19:58221
Marijn Kruisselbrinkca4bb5e2019-04-22 18:19:42222// Writable files and native file system access. https://crbug.com/853326
223const base::Feature kNativeFileSystemAPI{"NativeFileSystemAPI",
Marijn Kruisselbrink4cc3ec22019-09-04 16:28:20224 base::FEATURE_ENABLED_BY_DEFAULT};
Makoto Shimazu172eec02018-11-29 06:21:44225
Jay Harris583f48922019-05-06 05:55:24226// File handling integration. https://crbug.com/829689
227const base::Feature kFileHandlingAPI{"FileHandlingAPI",
228 base::FEATURE_DISABLED_BY_DEFAULT};
229
kdillon66bf5b522019-01-02 22:08:30230// Allows for synchronous XHR requests during page dismissal
Katie Dillon8b357312019-09-19 13:23:23231const base::Feature kAllowSyncXHRInPageDismissal{
232 "AllowSyncXHRInPageDismissal", base::FEATURE_DISABLED_BY_DEFAULT};
kdillon66bf5b522019-01-02 22:08:30233
Olivier Yiptongb60d2c42020-01-10 22:47:15234// Font enumeration and table access. https://crbug.com/535764 and
235// https://crbug.com/982054.
236const base::Feature kFontAccess{"FontAccess",
237 base::FEATURE_DISABLED_BY_DEFAULT};
238
Mason Freed490f2a22019-11-05 21:41:29239// Allows Web Components v0 to be re-enabled.
240const base::Feature kWebComponentsV0Enabled{"WebComponentsV0Enabled",
241 base::FEATURE_DISABLED_BY_DEFAULT};
242
Dominic Farolino780df942019-09-04 06:49:44243// Prefetch request properties are updated to be privacy-preserving. See
244// crbug.com/988956.
245const base::Feature kPrefetchPrivacyChanges{"PrefetchPrivacyChanges",
246 base::FEATURE_DISABLED_BY_DEFAULT};
Dominic Farolino693fd72d2019-08-05 11:09:44247
Carlos ILd3be52b2018-10-08 17:57:18248const char kMixedContentAutoupgradeModeParamName[] = "mode";
Carlos IL9970a942020-02-14 01:16:50249const char kMixedContentAutoupgradeModeAllPassive[] = "all-passive";
Carlos ILd3be52b2018-10-08 17:57:18250
Sasha McIntoshe889f9f2019-09-03 21:01:57251// Decodes jpeg 4:2:0 formatted images to YUV instead of RGBX and stores in this
252// format in the image decode cache. See crbug.com/919627 for details on the
253// feature.
254const base::Feature kDecodeJpeg420ImagesToYUV{
255 "DecodeJpeg420ImagesToYUV", base::FEATURE_DISABLED_BY_DEFAULT};
256
Madeleine Barowsky45be21a42018-12-07 18:39:30257// Decodes lossy WebP images to YUV instead of RGBX and stores in this format
258// in the image decode cache. See crbug.com/900264 for details on the feature.
259const base::Feature kDecodeLossyWebPImagesToYUV{
Sasha McIntoshf670a6b2020-01-09 18:27:09260 "DecodeLossyWebPImagesToYUV", base::FEATURE_ENABLED_BY_DEFAULT};
Madeleine Barowsky45be21a42018-12-07 18:39:30261
Takashi Toyoshimaa91506d2019-03-28 05:44:42262// Enables cache-aware WebFonts loading. See https://crbug.com/570205.
263// The feature is disabled on Android for WebView API issue discussed at
264// https://crbug.com/942440.
265const base::Feature kWebFontsCacheAwareTimeoutAdaption {
266 "WebFontsCacheAwareTimeoutAdaption",
267#if defined(OS_ANDROID)
268 base::FEATURE_DISABLED_BY_DEFAULT
269#else
270 base::FEATURE_ENABLED_BY_DEFAULT
271#endif
272};
273
Ehsan Karamadbe95d122019-05-10 17:59:06274// Enabled to block programmatic focus in subframes when not triggered by user
275// activation (see htpps://crbug.com/954349).
276const base::Feature kBlockingFocusWithoutUserActivation{
277 "BlockingFocusWithoutUserActivation", base::FEATURE_DISABLED_BY_DEFAULT};
278
Hongchan Choi370d3af2019-05-20 20:56:58279const base::Feature kAudioWorkletRealtimeThread{
280 "AudioWorkletRealtimeThread", base::FEATURE_DISABLED_BY_DEFAULT};
281
Ryan Sturm139c3ac2019-07-12 18:52:53282// A feature to reduce the set of resources fetched by No-State Prefetch.
283const base::Feature kLightweightNoStatePrefetch{
Ryan Sturmf223cb02019-10-04 18:02:00284 "LightweightNoStatePrefetch",
285#if defined(OS_ANDROID)
286 base::FEATURE_ENABLED_BY_DEFAULT
287#else
288 base::FEATURE_DISABLED_BY_DEFAULT
289#endif
290};
Ryan Sturm139c3ac2019-07-12 18:52:53291
Robert Ogden8dddf562019-11-21 18:20:36292// A feature to enable web fonts to be fetched by No-State Prefetch.
293const base::Feature kLightweightNoStatePrefetch_FetchFonts{
294 "LightweightNoStatePrefetch_FetchFonts", base::FEATURE_DISABLED_BY_DEFAULT};
295
Aran Gilman5e9672bed2019-08-02 19:07:49296// Automatically convert light-themed pages to use a Blink-generated dark theme
297const base::Feature kForceWebContentsDarkMode{
298 "WebContentsForceDark", base::FEATURE_DISABLED_BY_DEFAULT};
299
Michael Crouseb7acd772020-02-20 02:56:26300// A feature to enable using the smallest image specified within image srcset
301// for users with Save Data enabled.
302const base::Feature kSaveDataImgSrcset{"SaveDataImgSrcset",
303 base::FEATURE_DISABLED_BY_DEFAULT};
304
Aran Gilman5e9672bed2019-08-02 19:07:49305// Which algorithm should be used for color inversion?
306const base::FeatureParam<ForceDarkInversionMethod>::Option
307 forcedark_inversion_method_options[] = {
308 {ForceDarkInversionMethod::kUseBlinkSettings,
309 "use_blink_settings_for_method"},
310 {ForceDarkInversionMethod::kHslBased, "hsl_based"},
Aran Gilman8b3ca41c2019-08-12 18:59:04311 {ForceDarkInversionMethod::kCielabBased, "cielab_based"},
312 {ForceDarkInversionMethod::kRgbBased, "rgb_based"}};
Aran Gilman5e9672bed2019-08-02 19:07:49313
314const base::FeatureParam<ForceDarkInversionMethod>
315 kForceDarkInversionMethodParam{&kForceWebContentsDarkMode,
316 "inversion_method",
317 ForceDarkInversionMethod::kUseBlinkSettings,
318 &forcedark_inversion_method_options};
319
320// Should images be inverted?
321const base::FeatureParam<ForceDarkImageBehavior>::Option
322 forcedark_image_behavior_options[] = {
323 {ForceDarkImageBehavior::kUseBlinkSettings,
324 "use_blink_settings_for_images"},
325 {ForceDarkImageBehavior::kInvertNone, "none"},
326 {ForceDarkImageBehavior::kInvertSelectively, "selective"}};
327
328const base::FeatureParam<ForceDarkImageBehavior> kForceDarkImageBehaviorParam{
329 &kForceWebContentsDarkMode, "image_behavior",
330 ForceDarkImageBehavior::kUseBlinkSettings,
331 &forcedark_image_behavior_options};
332
333// Do not invert text lighter than this.
334// Range: 0 (do not invert any text) to 256 (invert all text)
335// Can also set to -1 to let Blink's internal settings control the value
336const base::FeatureParam<int> kForceDarkTextLightnessThresholdParam{
337 &kForceWebContentsDarkMode, "text_lightness_threshold", -1};
338
339// Do not invert backgrounds darker than this.
340// Range: 0 (invert all backgrounds) to 256 (invert no backgrounds)
341// Can also set to -1 to let Blink's internal settings control the value
342const base::FeatureParam<int> kForceDarkBackgroundLightnessThresholdParam{
343 &kForceWebContentsDarkMode, "background_lightness_threshold", -1};
344
Sergey Silkinc33244f2020-01-31 17:21:30345// Instructs WebRTC to honor the Min/Max Video Encode Accelerator dimensions.
Miguel Casas-Sanchezb6128392020-02-18 15:45:39346const base::Feature kWebRtcUseMinMaxVEADimensions {
347 "WebRtcUseMinMaxVEADimensions",
348 // TODO(crbug.com/1008491): enable other platforms.
349#if defined(OS_CHROMEOS)
350 base::FEATURE_ENABLED_BY_DEFAULT
351#else
352 base::FEATURE_DISABLED_BY_DEFAULT
353#endif
354};
Sergey Silkinc33244f2020-01-31 17:21:30355
Michael Lippautze670df9f2019-07-09 11:39:49356// Blink garbage collection.
357// Enables compaction of backing stores on Blink's heap.
358const base::Feature kBlinkHeapCompaction{"BlinkHeapCompaction",
359 base::FEATURE_ENABLED_BY_DEFAULT};
360// Enables concurrently marking Blink's heap.
361const base::Feature kBlinkHeapConcurrentMarking{
Omer Katz1757893c2020-02-17 12:09:19362 "BlinkHeapConcurrentMarking", base::FEATURE_ENABLED_BY_DEFAULT};
Anton Bikineev9b7b3722019-07-09 13:48:39363// Enables concurrently sweeping Blink's heap.
364const base::Feature kBlinkHeapConcurrentSweeping{
Anton Bikineev204cc752019-08-07 00:26:37365 "BlinkHeapConcurrentSweeping", base::FEATURE_ENABLED_BY_DEFAULT};
Michael Lippautze670df9f2019-07-09 11:39:49366// Enables incrementally marking Blink's heap.
367const base::Feature kBlinkHeapIncrementalMarking{
368 "BlinkHeapIncrementalMarking", base::FEATURE_ENABLED_BY_DEFAULT};
369// Enables a marking stress mode that schedules more garbage collections and
370// also adds additional verification passes.
371const base::Feature kBlinkHeapIncrementalMarkingStress{
372 "BlinkHeapIncrementalMarkingStress", base::FEATURE_DISABLED_BY_DEFAULT};
Michael Lippautze670df9f2019-07-09 11:39:49373
Yoav Weissddfb8d2e2019-07-15 22:34:03374// Enables removing AppCache delays when triggering requests when the HTML was
375// not fetched from AppCache.
376const base::Feature kVerifyHTMLFetchedFromAppCacheBeforeDelay{
377 "VerifyHTMLFetchedFromAppCacheBeforeDelay",
378 base::FEATURE_DISABLED_BY_DEFAULT};
379
Michael Spang8d2303e2019-07-26 01:56:32380// Controls whether we use ThreadPriority::DISPLAY for renderer
381// compositor & IO threads.
382const base::Feature kBlinkCompositorUseDisplayThreadPriority {
383 "BlinkCompositorUseDisplayThreadPriority",
Sunny Sachanandani16944252019-12-04 03:40:49384#if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(OS_WIN)
Michael Spang8d2303e2019-07-26 01:56:32385 base::FEATURE_ENABLED_BY_DEFAULT
386#else
387 base::FEATURE_DISABLED_BY_DEFAULT
388#endif
389};
390
Yuki Shiinoa812f492019-08-23 06:47:46391// Ignores cross origin windows in the named property interceptor of Window.
392// https://crbug.com/538562
393const base::Feature kIgnoreCrossOriginWindowWhenNamedAccessOnWindow{
394 "IgnoreCrossOriginWindowWhenNamedAccessOnWindow",
395 base::FEATURE_DISABLED_BY_DEFAULT};
396
Tarun Bansal38792462019-09-04 16:08:11397// When enabled, loading priority of JavaScript requests is lowered when they
398// are force deferred by the intervention.
399const base::Feature kLowerJavaScriptPriorityWhenForceDeferred{
400 "LowerJavaScriptPriorityWhenForceDeferred",
Tarun Bansal755268fe2019-10-18 18:57:40401 base::FEATURE_DISABLED_BY_DEFAULT};
Tarun Bansal38792462019-09-04 16:08:11402
Tarun Bansalf32aaa22020-02-12 16:16:44403// When enabled, scripts in iframes are not force deferred by the DeferAllScript
404// intervention.
405const base::Feature kDisableForceDeferInChildFrames{
406 "DisableForceDeferInChildFrames", base::FEATURE_DISABLED_BY_DEFAULT};
407
rajendrantd5db55f2019-10-19 01:56:59408// Enables redirecting subresources in the page to better compressed and
409// optimized versions to provide data savings.
410const base::Feature kSubresourceRedirect{"SubresourceRedirect",
411 base::FEATURE_DISABLED_BY_DEFAULT};
412
Stefan Zagerfd18161c2019-10-22 20:44:31413// When 'enabled', all cross-origin iframes will get a compositing layer.
414const base::Feature kCompositeCrossOriginIframes{
415 "CompositeCrossOriginIframes", base::FEATURE_DISABLED_BY_DEFAULT};
Yutaka Hirano0b3c319b2019-10-25 17:19:15416
417// When enabled, beacons (and friends) have ResourceLoadPriority::kLow,
418// not ResourceLoadPriority::kVeryLow.
419const base::Feature kSetLowPriorityForBeacon{"SetLowPriorityForBeacon",
420 base::FEATURE_DISABLED_BY_DEFAULT};
421
Ben Kelly776f59d2019-11-06 16:25:30422// When enabled allows the header name used in the blink
423// CacheStorageCodeCacheHint runtime feature to be modified. This runtime
424// feature disables generating full code cache for responses stored in
425// cache_storage during a service worker install event. The runtime feature
426// must be enabled via the blink runtime feature mechanism, however.
427const base::Feature kCacheStorageCodeCacheHintHeader{
428 "CacheStorageCodeCacheHintHeader", base::FEATURE_DISABLED_BY_DEFAULT};
429const base::FeatureParam<std::string> kCacheStorageCodeCacheHintHeaderName{
430 &kCacheStorageCodeCacheHintHeader, "name", "x-CacheStorageCodeCacheHint"};
431
Francois Doray563453432019-11-20 15:32:17432// When enabled, the beforeunload handler is dispatched when a frame is frozen.
433// This allows the browser to know whether discarding the frame could result in
434// lost user data, at the cost of extra CPU usage. The feature will be removed
435// once we have determine whether the CPU cost is acceptable.
436const base::Feature kDispatchBeforeUnloadOnFreeze{
437 "DispatchBeforeUnloadOnFreeze", base::FEATURE_ENABLED_BY_DEFAULT};
438
Sunny Sachanandani26463422019-12-05 21:35:40439// Enables the use of GpuMemoryBuffer images for low latency 2d canvas.
440// TODO(khushalsagar): Enable this if we're using SurfaceControl and GMBs allow
441// us to overlay these resources.
442const base::Feature kLowLatencyCanvas2dImageChromium {
443 "LowLatencyCanvas2dImageChromium",
444#if defined(OS_CHROMEOS)
445 base::FEATURE_ENABLED_BY_DEFAULT
446#else
447 base::FEATURE_DISABLED_BY_DEFAULT
448#endif // OS_CHROMEOS
449};
450
451// Enables the use of shared image swap chains for low latency 2d canvas.
452const base::Feature kLowLatencyCanvas2dSwapChain{
Sunny Sachanandanib954dc7c2019-12-12 02:50:51453 "LowLatencyCanvas2dSwapChain", base::FEATURE_ENABLED_BY_DEFAULT};
Sunny Sachanandani26463422019-12-05 21:35:40454
455// Enables the use of shared image swap chains for low latency webgl canvas.
Sunny Sachanandanib954dc7c2019-12-12 02:50:51456const base::Feature kLowLatencyWebGLSwapChain{"LowLatencyWebGLSwapChain",
457 base::FEATURE_ENABLED_BY_DEFAULT};
Sunny Sachanandani26463422019-12-05 21:35:40458
Stephen Whitee17b0232020-04-27 23:48:49459// Enables Dawn-accelerated 2D canvas.
460const base::Feature kDawn2dCanvas{"Dawn2dCanvas",
461 base::FEATURE_DISABLED_BY_DEFAULT};
462
Yao Xiaoc646d0b2020-01-31 22:30:59463// Enables forcing additional rendering of subframes for the purpose of sticky
464// frame tracking.
465const base::Feature kForceExtraRenderingToTrackStickyFrame{
466 "ForceExtraRenderingToTrackStickyFrame", base::FEATURE_DISABLED_BY_DEFAULT};
467
Xiaocheng Hud5197fd2020-02-06 07:26:08468const base::Feature kCSSReducedFontLoadingInvalidations{
469 "CSSReducedFontLoadingInvalidations", base::FEATURE_DISABLED_BY_DEFAULT};
470
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
Rune Lillesveen61f49ee2020-03-02 07:53:49482const base::Feature kBlockHTMLParserOnStyleSheets{
483 "BlockHTMLParserOnStyleSheets", base::FEATURE_DISABLED_BY_DEFAULT};
484
Xiaocheng Hud2e807d2020-03-04 21:15:21485// Slightly delays rendering if there are fonts being preloaded, so that
486// they don't miss the first paint if they can be loaded fast enough (e.g.,
487// from the disk cache)
488const base::Feature kFontPreloadingDelaysRendering{
489 "FontPreloadingDelaysRendering", base::FEATURE_DISABLED_BY_DEFAULT};
490
491// Set to be over 90th-percentile of HttpCache.AccessToDone.Used on all
492// platforms, and also to allow some time for IPC and scheduling.
493// TODO(xiaochengh): Tune it for the best performance.
494const base::FeatureParam<int> kFontPreloadingDelaysRenderingParam{
495 &kFontPreloadingDelaysRendering, "delay-in-ms", 100};
496
David Grogan5b3cf162020-03-19 21:53:15497const base::Feature kFlexNG{"FlexNG", base::FEATURE_DISABLED_BY_DEFAULT};
498
Dominic Farolino0f55a082020-03-24 09:47:55499const base::Feature kKeepScriptResourceAlive{"KeepScriptResourceAlive",
500 base::FEATURE_DISABLED_BY_DEFAULT};
501
Adrienne Walkere6b51722020-04-01 17:56:38502const base::Feature kAppCache{"AppCache", base::FEATURE_ENABLED_BY_DEFAULT};
503
Wan-Teh Chang75fd5322020-04-08 01:32:18504// Enables the AV1 Image File Format (AVIF).
505const base::Feature kAVIF{"AVIF", base::FEATURE_DISABLED_BY_DEFAULT};
506
Xiaocheng Hu66795f02020-04-25 00:26:47507// Make all pending 'display: auto' web fonts enter the swap or failure period
Xiaocheng Hu9e2055c2020-04-09 20:35:28508// immediately before reaching the LCP time limit (~2500ms), so that web fonts
509// do not become a source of bad LCP.
510const base::Feature kAlignFontDisplayAutoTimeoutWithLCPGoal{
511 "AlignFontDisplayAutoTimeoutWithLCPGoal",
512 base::FEATURE_DISABLED_BY_DEFAULT};
513
Xiaocheng Hu66795f02020-04-25 00:26:47514// The amount of time allowed for 'display: auto' web fonts to load without
515// intervention, counted from navigation start.
516const base::FeatureParam<int>
517 kAlignFontDisplayAutoTimeoutWithLCPGoalTimeoutParam{
518 &kAlignFontDisplayAutoTimeoutWithLCPGoal, "lcp-limit-in-ms", 2000};
519
520const base::FeatureParam<AlignFontDisplayAutoTimeoutWithLCPGoalMode>::Option
521 align_font_display_auto_timeout_with_lcp_goal_modes[] = {
522 {AlignFontDisplayAutoTimeoutWithLCPGoalMode::kToFailurePeriod,
523 "failure"},
524 {AlignFontDisplayAutoTimeoutWithLCPGoalMode::kToSwapPeriod, "swap"}};
525const base::FeatureParam<AlignFontDisplayAutoTimeoutWithLCPGoalMode>
526 kAlignFontDisplayAutoTimeoutWithLCPGoalModeParam{
527 &kAlignFontDisplayAutoTimeoutWithLCPGoal, "intervention-mode",
528 AlignFontDisplayAutoTimeoutWithLCPGoalMode::kToFailurePeriod,
529 &align_font_display_auto_timeout_with_lcp_goal_modes};
Xiaocheng Hu9e2055c2020-04-09 20:35:28530
Ben Kellyd52869b2020-04-20 17:17:43531// Enable throttling of fetch() requests from service workers in the
532// installing state.
533const base::Feature kThrottleInstallingServiceWorker{
534 "ThrottleInstallingServiceWorker", base::FEATURE_DISABLED_BY_DEFAULT};
535const base::FeatureParam<int> kInstallingServiceWorkerOutstandingThrottledLimit{
536 &kThrottleInstallingServiceWorker, "limit", 5};
537
Dave Tapuskafea88942020-05-05 18:50:32538const base::Feature kResamplingScrollEvents{"ResamplingScrollEvents",
539 base::FEATURE_ENABLED_BY_DEFAULT};
540
541const char kScrollPredictorNameLsq[] = "lsq";
542const char kScrollPredictorNameKalman[] = "kalman";
543const char kScrollPredictorNameLinearFirst[] = "linear_first";
544const char kScrollPredictorNameLinearSecond[] = "linear_second";
545const char kScrollPredictorNameLinearResampling[] = "linear_resampling";
546const char kScrollPredictorNameEmpty[] = "empty";
547
548const base::Feature kFilteringScrollPrediction{
549 "FilteringScrollPrediction", base::FEATURE_DISABLED_BY_DEFAULT};
550
551const char kFilterNameEmpty[] = "empty_filter";
552const char kFilterNameOneEuro[] = "one_euro_filter";
553
554const base::Feature kKalmanHeuristics{"KalmanHeuristics",
555 base::FEATURE_DISABLED_BY_DEFAULT};
556
557const base::Feature kKalmanDirectionCutOff{"KalmanDirectionCutOff",
558 base::FEATURE_DISABLED_BY_DEFAULT};
559
560const base::Feature kSkipTouchEventFilter{"SkipTouchEventFilter",
561 base::FEATURE_ENABLED_BY_DEFAULT};
562const char kSkipTouchEventFilterTypeParamName[] = "type";
563const char kSkipTouchEventFilterTypeParamValueDiscrete[] = "discrete";
564const char kSkipTouchEventFilterTypeParamValueAll[] = "all";
565const char kSkipTouchEventFilterFilteringProcessParamName[] =
566 "skip_filtering_process";
567const char kSkipTouchEventFilterFilteringProcessParamValueBrowser[] = "browser";
568const char kSkipTouchEventFilterFilteringProcessParamValueBrowserAndRenderer[] =
569 "browser_and_renderer";
570
Matt Falkenhagen5cc652792018-06-21 10:34:33571} // namespace features
572} // namespace blink