blob: b068aecac5035142c1d9bda9109bf90917c078bb [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 Chenney8c442a582020-06-25 18:18:3921// Enable defer commits to avoid flash of unstyled content, for same origin
22// navigation only.
Stephen Chenney1bcaec832019-10-10 18:31:0123const base::Feature kPaintHolding{"PaintHolding",
24 base::FEATURE_ENABLED_BY_DEFAULT};
Stephen Chenneyde6e5c82019-01-21 01:56:0425
Stephen Chenney8c442a582020-06-25 18:18:3926// Enable defer commits to avoid flash of unstyled content, for all navigation.
27const base::Feature kPaintHoldingCrossOrigin{"PaintHoldingCrossOrigin",
28 base::FEATURE_DISABLED_BY_DEFAULT};
29
Matt Falkenhagenc25fea42018-07-17 07:13:5230// Enable eagerly setting up a CacheStorage interface pointer and
31// passing it to service workers on startup as an optimization.
Ben Kelly2c1cdd62020-05-04 22:05:0432// TODO(crbug/1077916): Re-enable once the issue with COOP/COEP is fixed.
Matt Falkenhagenc25fea42018-07-17 07:13:5233const base::Feature kEagerCacheStorageSetupForServiceWorkers{
34 "EagerCacheStorageSetupForServiceWorkers",
Ben Kelly2c1cdd62020-05-04 22:05:0435 base::FEATURE_DISABLED_BY_DEFAULT};
Matt Falkenhagenc25fea42018-07-17 07:13:5236
Peter Kvitek197eaf72018-12-04 19:14:5637// Controls script streaming.
38const base::Feature kScriptStreaming{"ScriptStreaming",
39 base::FEATURE_ENABLED_BY_DEFAULT};
40
Leszek Swirskif75c1912019-05-29 10:08:2541// Allow streaming small (<30kB) scripts.
42const base::Feature kSmallScriptStreaming{"SmallScriptStreaming",
43 base::FEATURE_DISABLED_BY_DEFAULT};
44
Keishi Hattori9e106922019-04-15 09:06:0345// Enables user level memory pressure signal generation on Android.
46const base::Feature kUserLevelMemoryPressureSignal{
47 "UserLevelMemoryPressureSignal", base::FEATURE_DISABLED_BY_DEFAULT};
48
Aditya Keerthi6a933902019-03-14 21:09:2749// Perform memory purges after freezing only if all pages are frozen.
50const base::Feature kFreezePurgeMemoryAllPagesFrozen{
51 "FreezePurgeMemoryAllPagesFrozen", base::FEATURE_DISABLED_BY_DEFAULT};
52
John Delaneyac24e572019-04-30 19:47:0253// Freezes the user-agent as part of https://github.com/WICG/ua-client-hints.
54const base::Feature kFreezeUserAgent{"FreezeUserAgent",
55 base::FEATURE_DISABLED_BY_DEFAULT};
56
Ulan Degenbaev13d709c2020-07-14 20:15:2457const base::Feature kMeasureMemoryExperiment{"MeasureMemoryExperiment",
58 base::FEATURE_DISABLED_BY_DEFAULT};
59
Vladimir Levin43758ecc2019-05-09 18:04:0360// Enable Display Locking JavaScript APIs.
61const base::Feature kDisplayLocking{"DisplayLocking",
62 base::FEATURE_DISABLED_BY_DEFAULT};
63
Sam Sebree2dd45c4f2019-12-13 05:51:4964const base::Feature kJSONModules{"JSONModules",
65 base::FEATURE_DISABLED_BY_DEFAULT};
66
Mason Freedd71a9642020-06-03 01:35:0767const base::Feature kForceSynchronousHTMLParsing{
68 "ForceSynchronousHTMLParsing", base::FEATURE_DISABLED_BY_DEFAULT};
69
Camillo Brunia19d7fc2020-03-17 07:53:3570// Enables top-level await in modules.
71const base::Feature kTopLevelAwait{"TopLevelAwait",
72 base::FEATURE_DISABLED_BY_DEFAULT};
73
Ian Kilpatricke68ef11a2018-07-04 03:52:1074// Enable LayoutNG.
Emil A Eklund69eeb562019-07-03 01:38:3075const base::Feature kLayoutNG{"LayoutNG", base::FEATURE_ENABLED_BY_DEFAULT};
Ian Kilpatricke68ef11a2018-07-04 03:52:1076
Kent Tamura4187dc92020-06-18 04:39:3577// Enable LayoutNGRuby by default. This feature is for a kill switch.
78const base::Feature kLayoutNGRuby{"LayoutNGRuby",
79 base::FEATURE_ENABLED_BY_DEFAULT};
80
Koji Ishii14c52bd2020-06-11 17:00:5981const base::Feature kFragmentItem{"FragmentItem",
82 base::FEATURE_DISABLED_BY_DEFAULT};
83
Makoto Shimazu172eec02018-11-29 06:21:4484const base::Feature kMixedContentAutoupgrade{"AutoupgradeMixedContent",
Carlos IL9970a942020-02-14 01:16:5085 base::FEATURE_ENABLED_BY_DEFAULT};
Makoto Shimazu172eec02018-11-29 06:21:4486
Tarun Bansal422f9012019-01-23 16:55:5887// Used to control the collection of anchor element metrics (crbug.com/856683).
88// If kNavigationPredictor is enabled, then metrics of anchor elements
89// in the first viewport after the page load and the metrics of the clicked
90// anchor element will be extracted and recorded. Additionally, navigation
91// predictor may preconnect/prefetch to resources/origins to make the
92// future navigations faster.
Sofiya Semenovae4e076152019-07-29 20:10:2793const base::Feature kNavigationPredictor {
94 "NavigationPredictor",
95#if defined(OS_ANDROID)
96 base::FEATURE_ENABLED_BY_DEFAULT
97#else
98 base::FEATURE_DISABLED_BY_DEFAULT
99#endif
100};
Tarun Bansal422f9012019-01-23 16:55:58101
Benoit Lize66684b22020-08-07 12:30:22102const base::Feature kParentNodeReplaceChildren{
103 "ParentNodeReplaceChildren", base::FEATURE_ENABLED_BY_DEFAULT};
Yu Hanae4c3b72020-07-08 21:48:58104
Hiroki Nakagawa61ee0042019-01-22 06:30:26105// Enable browser-initiated dedicated worker script loading
106// (PlzDedicatedWorker). https://crbug.com/906991
107const base::Feature kPlzDedicatedWorker{"PlzDedicatedWorker",
108 base::FEATURE_DISABLED_BY_DEFAULT};
109
Daniel Murphy95792ef2018-10-04 01:29:55110// Enable Portals. https://crbug.com/865123.
Jeremy Romanf369a9d62020-06-24 19:59:54111// For the current origin trial (https://crbug.com/1040212), this is enabled on
112// Android only.
113const base::Feature kPortals {
114 "Portals",
115#if defined(OS_ANDROID)
116 base::FEATURE_ENABLED_BY_DEFAULT
117#else
118 base::FEATURE_DISABLED_BY_DEFAULT
119#endif
120};
Daniel Murphy95792ef2018-10-04 01:29:55121
Jeremy Roman20366e42019-10-22 17:48:08122// When kPortals is enabled, allow portals to load content that is third-party
123// (cross-origin) to the hosting page. Otherwise has no effect.
124//
Jeremy Roman20366e42019-10-22 17:48:08125// https://crbug.com/1013389
126const base::Feature kPortalsCrossOrigin{"PortalsCrossOrigin",
Jeremy Romanf369a9d62020-06-24 19:59:54127 base::FEATURE_DISABLED_BY_DEFAULT};
Jeremy Roman20366e42019-10-22 17:48:08128
Tarun Bansal8df12b52019-02-15 05:46:30129// Enable limiting previews loading hints to specific resource types.
130const base::Feature kPreviewsResourceLoadingHintsSpecificResourceTypes{
131 "PreviewsResourceLoadingHintsSpecificResourceTypes",
132 base::FEATURE_DISABLED_BY_DEFAULT};
133
Aditya Keerthie84331b32019-03-20 15:25:52134// Perform a memory purge after a renderer is backgrounded. Formerly labelled as
135// the "PurgeAndSuspend" experiment.
136//
137// TODO(adityakeerthi): Disabled by default on Mac and Android for historical
138// reasons. Consider enabling by default if experiment results are positive.
139// https://crbug.com/926186
140const base::Feature kPurgeRendererMemoryWhenBackgrounded {
141 "PurgeRendererMemoryWhenBackgrounded",
Avi Drissman916c12f2020-07-29 16:59:13142#if defined(OS_MAC) || defined(OS_ANDROID)
Aditya Keerthie84331b32019-03-20 15:25:52143 base::FEATURE_DISABLED_BY_DEFAULT
144#else
145 base::FEATURE_ENABLED_BY_DEFAULT
146#endif
147};
148
David Bokan911bded2018-11-27 23:23:32149// Enable Implicit Root Scroller. https://crbug.com/903260.
David Bokan145b5472019-05-22 14:38:44150// TODO(bokan): Temporarily disabled on desktop platforms to address issues
151// with non-overlay scrollbars. https://crbug.com/948059.
152const base::Feature kImplicitRootScroller {
153 "ImplicitRootScroller",
154#if defined(OS_ANDROID)
155 base::FEATURE_ENABLED_BY_DEFAULT
156#else
157 base::FEATURE_DISABLED_BY_DEFAULT
158#endif
159};
David Bokan911bded2018-11-27 23:23:32160
Cathie Cheneac70602019-10-10 02:55:29161// Enable CSSOM View Scroll Coordinates. https://crbug.com/721759.
162const base::Feature kCSSOMViewScrollCoordinates{
163 "CSSOMViewScrollCoordinates", base::FEATURE_DISABLED_BY_DEFAULT};
164
Darwin Huangf588cc8e2019-12-13 22:24:56165// Enables Raw Clipboard. https://crbug.com/897289.
166const base::Feature kRawClipboard{"RawClipboard",
167 base::FEATURE_DISABLED_BY_DEFAULT};
168
Makoto Shimazu172eec02018-11-29 06:21:44169// Enables usage of getDisplayMedia() that allows capture of web content, see
170// https://crbug.com/865060.
171const base::Feature kRTCGetDisplayMedia{"RTCGetDisplayMedia",
172 base::FEATURE_ENABLED_BY_DEFAULT};
173
174// Changes the default RTCPeerConnection constructor behavior to use Unified
175// Plan as the SDP semantics. When the feature is enabled, Unified Plan is used
176// unless the default is overridden (by passing {sdpSemantics:'plan-b'} as the
177// argument).
178const base::Feature kRTCUnifiedPlanByDefault{"RTCUnifiedPlanByDefault",
Henrik Boström07021ec82019-01-17 22:23:56179 base::FEATURE_ENABLED_BY_DEFAULT};
Makoto Shimazu172eec02018-11-29 06:21:44180
Johannes Kronad5a4532019-01-09 11:17:46181// Determines if the SDP attrbute extmap-allow-mixed should be offered by
182// default or not. The default value can be overridden by passing
183// {offerExtmapAllowMixed:true} as an argument to the RTCPeerConnection
184// constructor.
185const base::Feature kRTCOfferExtmapAllowMixed{
186 "RTCOfferExtmapAllowMixed", base::FEATURE_DISABLED_BY_DEFAULT};
187
Ulan Degenbaev4b3bc29b2020-03-13 17:09:00188// Prevents workers from sending IsolateInBackgroundNotification to V8
189// and thus instructs V8 to favor performance over memory on workers.
190const base::Feature kV8OptimizeWorkersForPerformance{
Ulan Degenbaev7acd73ea2020-04-07 16:02:33191 "V8OptimizeWorkersForPerformance", base::FEATURE_ENABLED_BY_DEFAULT};
Ulan Degenbaev4b3bc29b2020-03-13 17:09:00192
Antonio Gomesb4718572019-09-11 02:55:48193// Enables negotiation of experimental multiplex codec in SDP.
194const base::Feature kWebRtcMultiplexCodec{"WebRTC-MultiplexCodec",
195 base::FEATURE_DISABLED_BY_DEFAULT};
196
197// Causes WebRTC to replace host ICE candidate IP addresses with generated
198// names ending in ".local" and resolve them using mDNS.
199// http://crbug.com/878465
200const base::Feature kWebRtcHideLocalIpsWithMdns{
201 "WebRtcHideLocalIpsWithMdns", base::FEATURE_ENABLED_BY_DEFAULT};
202
OlivierLi95a0f6a52020-06-18 15:40:08203// When enabled, wake ups from throttleable TaskQueues are limited to 1 per
204// minute in a page that has been backgrounded for 5 minutes.
205//
206// Intensive wake up throttling is enforced in addition to other throttling
207// mechanisms:
208// - 1 wake up per second in a background page or hidden cross-origin frame
209// - 1% CPU time in a page that has been backgrounded for 10 seconds
210//
211// Feature tracking bug: https://crbug.com/1075553
212//
213// Note that the base::Feature should not be read from;
214// rather the provided accessors should be used, which also take into account
215// the managed policy override of the feature.
216const base::Feature kIntensiveWakeUpThrottling{
217 "IntensiveWakeUpThrottling", base::FEATURE_DISABLED_BY_DEFAULT};
218
Olivier Li5f02c1a2020-07-31 16:13:44219// When enabled, timers with timeout=0 are not throttled.
220const base::Feature kOptOutZeroTimeoutTimersFromThrottling{
221 "OptOutZeroTimeoutTimersFromThrottling", base::FEATURE_DISABLED_BY_DEFAULT};
222
Francois Doray66c328cb2020-07-13 15:46:13223// When enabled, no throttling is applied to a page when it uses WebRTC.
224//
225// This allows a page to use a timer to do video processing on frames. An
226// event-driven mechanism should be provided to do video processing. When it is
227// available, this feature should be removed. https://crbug.com/1101806
228const base::Feature kOptOutWebRTCFromAllThrottling{
229 "OptOutWebRTCFromAllThrottling", base::FEATURE_DISABLED_BY_DEFAULT};
230
Francois Doray6cff4e02020-07-01 01:12:58231// Name of the parameter that controls the grace period during which there is no
232// intensive wake up throttling after a page is hidden. Defined here to allow
233// access from about_flags.cc. The FeatureParam is defined in
234// third_party/blink/renderer/platform/scheduler/common/features.cc.
235const char kIntensiveWakeUpThrottling_GracePeriodSeconds_Name[] =
236 "grace_period_seconds";
237
Antonio Gomesf3bcd512019-09-03 21:27:17238#if BUILDFLAG(RTC_USE_H264) && BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS)
239// Run-time feature for the |rtc_use_h264| encoder/decoder.
240const base::Feature kWebRtcH264WithOpenH264FFmpeg{
241 "WebRTC-H264WithOpenH264FFmpeg", base::FEATURE_ENABLED_BY_DEFAULT};
242#endif // BUILDFLAG(RTC_USE_H264) && BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS)
243
Makoto Shimazua8b3d742019-04-05 06:55:51244// Experiment of the delay from navigation to starting an update of a service
245// worker's script.
246const base::Feature kServiceWorkerUpdateDelay{
247 "ServiceWorkerUpdateDelay", base::FEATURE_DISABLED_BY_DEFAULT};
248
Scott Haseley8eefdcd2018-08-22 16:50:19249// Freeze scheduler task queues in background after allowed grace time.
250// "stop" is a legacy name.
251const base::Feature kStopInBackground {
252 "stop-in-background",
253#if defined(OS_ANDROID)
254 base::FEATURE_ENABLED_BY_DEFAULT
255#else
256 base::FEATURE_DISABLED_BY_DEFAULT
257#endif
258};
259
Takashi Sakamotoc19fc2b2019-04-10 06:30:52260// Freeze scheduler task queues in background on network idle.
261// This feature only works if stop-in-background is enabled.
262const base::Feature kFreezeBackgroundTabOnNetworkIdle{
263 "freeze-background-tab-on-network-idle", base::FEATURE_DISABLED_BY_DEFAULT};
264
Shubhie Panicker60bd4b02018-09-26 00:02:15265// Freeze non-timer task queues in background, after allowed grace time.
266// "stop" is a legacy name.
Dave Tapuska9140c552019-05-30 16:18:56267const base::Feature kStopNonTimersInBackground{
268 "stop-non-timers-in-background", base::FEATURE_ENABLED_BY_DEFAULT};
Scott Haseley7757f6c2018-08-03 14:33:23269
Brandon Maslenda12cf82019-08-23 20:54:18270// Enable the Storage Access API. https://crbug.com/989663.
271const base::Feature kStorageAccessAPI{"StorageAccessAPI",
272 base::FEATURE_DISABLED_BY_DEFAULT};
273
David Bokane9370c22019-02-14 15:19:58274// Enable text snippets in URL fragments. https://crbug.com/919204.
275const base::Feature kTextFragmentAnchor{"TextFragmentAnchor",
Nick Burris62f8d5f02020-01-16 22:54:51276 base::FEATURE_ENABLED_BY_DEFAULT};
David Bokane9370c22019-02-14 15:19:58277
Marijn Kruisselbrinkca4bb5e2019-04-22 18:19:42278// Writable files and native file system access. https://crbug.com/853326
279const base::Feature kNativeFileSystemAPI{"NativeFileSystemAPI",
Marijn Kruisselbrink4cc3ec22019-09-04 16:28:20280 base::FEATURE_ENABLED_BY_DEFAULT};
Makoto Shimazu172eec02018-11-29 06:21:44281
Jay Harris583f48922019-05-06 05:55:24282// File handling integration. https://crbug.com/829689
283const base::Feature kFileHandlingAPI{"FileHandlingAPI",
284 base::FEATURE_DISABLED_BY_DEFAULT};
285
kdillon66bf5b522019-01-02 22:08:30286// Allows for synchronous XHR requests during page dismissal
Katie Dillon8b357312019-09-19 13:23:23287const base::Feature kAllowSyncXHRInPageDismissal{
288 "AllowSyncXHRInPageDismissal", base::FEATURE_DISABLED_BY_DEFAULT};
kdillon66bf5b522019-01-02 22:08:30289
Olivier Yiptongb60d2c42020-01-10 22:47:15290// Font enumeration and table access. https://crbug.com/535764 and
291// https://crbug.com/982054.
292const base::Feature kFontAccess{"FontAccess",
293 base::FEATURE_DISABLED_BY_DEFAULT};
294
Mason Freed6f146312020-06-27 05:12:55295// Allows Web Components v0 to be re-enabled.
296const base::Feature kWebComponentsV0{"WebComponentsV0",
297 base::FEATURE_DISABLED_BY_DEFAULT};
298
Dominic Farolino780df942019-09-04 06:49:44299// Prefetch request properties are updated to be privacy-preserving. See
300// crbug.com/988956.
301const base::Feature kPrefetchPrivacyChanges{"PrefetchPrivacyChanges",
302 base::FEATURE_DISABLED_BY_DEFAULT};
Dominic Farolino693fd72d2019-08-05 11:09:44303
Carlos ILd3be52b2018-10-08 17:57:18304const char kMixedContentAutoupgradeModeParamName[] = "mode";
Carlos IL9970a942020-02-14 01:16:50305const char kMixedContentAutoupgradeModeAllPassive[] = "all-passive";
Carlos ILd3be52b2018-10-08 17:57:18306
Sasha McIntoshe889f9f2019-09-03 21:01:57307// Decodes jpeg 4:2:0 formatted images to YUV instead of RGBX and stores in this
308// format in the image decode cache. See crbug.com/919627 for details on the
309// feature.
Sasha McIntosh633b6312020-06-12 19:45:19310const base::Feature kDecodeJpeg420ImagesToYUV{
311 "DecodeJpeg420ImagesToYUV", base::FEATURE_DISABLED_BY_DEFAULT};
Sasha McIntoshe889f9f2019-09-03 21:01:57312
Madeleine Barowsky45be21a42018-12-07 18:39:30313// Decodes lossy WebP images to YUV instead of RGBX and stores in this format
314// in the image decode cache. See crbug.com/900264 for details on the feature.
315const base::Feature kDecodeLossyWebPImagesToYUV{
Sasha McIntoshf670a6b2020-01-09 18:27:09316 "DecodeLossyWebPImagesToYUV", base::FEATURE_ENABLED_BY_DEFAULT};
Madeleine Barowsky45be21a42018-12-07 18:39:30317
Takashi Toyoshimaa91506d2019-03-28 05:44:42318// Enables cache-aware WebFonts loading. See https://crbug.com/570205.
319// The feature is disabled on Android for WebView API issue discussed at
320// https://crbug.com/942440.
321const base::Feature kWebFontsCacheAwareTimeoutAdaption {
322 "WebFontsCacheAwareTimeoutAdaption",
323#if defined(OS_ANDROID)
324 base::FEATURE_DISABLED_BY_DEFAULT
325#else
326 base::FEATURE_ENABLED_BY_DEFAULT
327#endif
328};
329
Ehsan Karamadbe95d122019-05-10 17:59:06330// Enabled to block programmatic focus in subframes when not triggered by user
331// activation (see htpps://crbug.com/954349).
332const base::Feature kBlockingFocusWithoutUserActivation{
333 "BlockingFocusWithoutUserActivation", base::FEATURE_DISABLED_BY_DEFAULT};
334
Hongchan Choi370d3af2019-05-20 20:56:58335const base::Feature kAudioWorkletRealtimeThread{
336 "AudioWorkletRealtimeThread", base::FEATURE_DISABLED_BY_DEFAULT};
337
Ryan Sturm139c3ac2019-07-12 18:52:53338// A feature to reduce the set of resources fetched by No-State Prefetch.
Robert Ogden2bb6a2522020-06-05 00:28:10339const base::Feature kLightweightNoStatePrefetch {
Ryan Sturmf223cb02019-10-04 18:02:00340 "LightweightNoStatePrefetch",
341#if defined(OS_ANDROID)
342 base::FEATURE_ENABLED_BY_DEFAULT
343#else
344 base::FEATURE_DISABLED_BY_DEFAULT
345#endif
346};
Ryan Sturm139c3ac2019-07-12 18:52:53347
Aran Gilman5e9672bed2019-08-02 19:07:49348// Automatically convert light-themed pages to use a Blink-generated dark theme
349const base::Feature kForceWebContentsDarkMode{
350 "WebContentsForceDark", base::FEATURE_DISABLED_BY_DEFAULT};
351
Michael Crouseb7acd772020-02-20 02:56:26352// A feature to enable using the smallest image specified within image srcset
353// for users with Save Data enabled.
354const base::Feature kSaveDataImgSrcset{"SaveDataImgSrcset",
355 base::FEATURE_DISABLED_BY_DEFAULT};
356
Aran Gilman5e9672bed2019-08-02 19:07:49357// Which algorithm should be used for color inversion?
358const base::FeatureParam<ForceDarkInversionMethod>::Option
359 forcedark_inversion_method_options[] = {
360 {ForceDarkInversionMethod::kUseBlinkSettings,
361 "use_blink_settings_for_method"},
362 {ForceDarkInversionMethod::kHslBased, "hsl_based"},
Aran Gilman8b3ca41c2019-08-12 18:59:04363 {ForceDarkInversionMethod::kCielabBased, "cielab_based"},
364 {ForceDarkInversionMethod::kRgbBased, "rgb_based"}};
Aran Gilman5e9672bed2019-08-02 19:07:49365
366const base::FeatureParam<ForceDarkInversionMethod>
367 kForceDarkInversionMethodParam{&kForceWebContentsDarkMode,
368 "inversion_method",
369 ForceDarkInversionMethod::kUseBlinkSettings,
370 &forcedark_inversion_method_options};
371
372// Should images be inverted?
373const base::FeatureParam<ForceDarkImageBehavior>::Option
374 forcedark_image_behavior_options[] = {
375 {ForceDarkImageBehavior::kUseBlinkSettings,
376 "use_blink_settings_for_images"},
377 {ForceDarkImageBehavior::kInvertNone, "none"},
378 {ForceDarkImageBehavior::kInvertSelectively, "selective"}};
379
380const base::FeatureParam<ForceDarkImageBehavior> kForceDarkImageBehaviorParam{
381 &kForceWebContentsDarkMode, "image_behavior",
382 ForceDarkImageBehavior::kUseBlinkSettings,
383 &forcedark_image_behavior_options};
384
385// Do not invert text lighter than this.
386// Range: 0 (do not invert any text) to 256 (invert all text)
387// Can also set to -1 to let Blink's internal settings control the value
388const base::FeatureParam<int> kForceDarkTextLightnessThresholdParam{
389 &kForceWebContentsDarkMode, "text_lightness_threshold", -1};
390
391// Do not invert backgrounds darker than this.
392// Range: 0 (invert all backgrounds) to 256 (invert no backgrounds)
393// Can also set to -1 to let Blink's internal settings control the value
394const base::FeatureParam<int> kForceDarkBackgroundLightnessThresholdParam{
395 &kForceWebContentsDarkMode, "background_lightness_threshold", -1};
396
Sergey Silkinc33244f2020-01-31 17:21:30397// Instructs WebRTC to honor the Min/Max Video Encode Accelerator dimensions.
Miguel Casas-Sanchezb6128392020-02-18 15:45:39398const base::Feature kWebRtcUseMinMaxVEADimensions {
399 "WebRtcUseMinMaxVEADimensions",
400 // TODO(crbug.com/1008491): enable other platforms.
401#if defined(OS_CHROMEOS)
402 base::FEATURE_ENABLED_BY_DEFAULT
403#else
404 base::FEATURE_DISABLED_BY_DEFAULT
405#endif
406};
Sergey Silkinc33244f2020-01-31 17:21:30407
Michael Lippautze670df9f2019-07-09 11:39:49408// Blink garbage collection.
409// Enables compaction of backing stores on Blink's heap.
410const base::Feature kBlinkHeapCompaction{"BlinkHeapCompaction",
411 base::FEATURE_ENABLED_BY_DEFAULT};
412// Enables concurrently marking Blink's heap.
413const base::Feature kBlinkHeapConcurrentMarking{
Omer Katz1757893c2020-02-17 12:09:19414 "BlinkHeapConcurrentMarking", base::FEATURE_ENABLED_BY_DEFAULT};
Anton Bikineev9b7b3722019-07-09 13:48:39415// Enables concurrently sweeping Blink's heap.
416const base::Feature kBlinkHeapConcurrentSweeping{
Anton Bikineev204cc752019-08-07 00:26:37417 "BlinkHeapConcurrentSweeping", base::FEATURE_ENABLED_BY_DEFAULT};
Michael Lippautze670df9f2019-07-09 11:39:49418// Enables incrementally marking Blink's heap.
419const base::Feature kBlinkHeapIncrementalMarking{
420 "BlinkHeapIncrementalMarking", base::FEATURE_ENABLED_BY_DEFAULT};
421// Enables a marking stress mode that schedules more garbage collections and
422// also adds additional verification passes.
423const base::Feature kBlinkHeapIncrementalMarkingStress{
424 "BlinkHeapIncrementalMarkingStress", base::FEATURE_DISABLED_BY_DEFAULT};
Michael Lippautze670df9f2019-07-09 11:39:49425
Yoav Weissddfb8d2e2019-07-15 22:34:03426// Enables removing AppCache delays when triggering requests when the HTML was
427// not fetched from AppCache.
428const base::Feature kVerifyHTMLFetchedFromAppCacheBeforeDelay{
429 "VerifyHTMLFetchedFromAppCacheBeforeDelay",
430 base::FEATURE_DISABLED_BY_DEFAULT};
431
Michael Spang8d2303e2019-07-26 01:56:32432// Controls whether we use ThreadPriority::DISPLAY for renderer
433// compositor & IO threads.
434const base::Feature kBlinkCompositorUseDisplayThreadPriority {
435 "BlinkCompositorUseDisplayThreadPriority",
Sunny Sachanandani16944252019-12-04 03:40:49436#if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(OS_WIN)
Michael Spang8d2303e2019-07-26 01:56:32437 base::FEATURE_ENABLED_BY_DEFAULT
438#else
439 base::FEATURE_DISABLED_BY_DEFAULT
440#endif
441};
442
Yuki Shiinoa812f492019-08-23 06:47:46443// Ignores cross origin windows in the named property interceptor of Window.
444// https://crbug.com/538562
445const base::Feature kIgnoreCrossOriginWindowWhenNamedAccessOnWindow{
446 "IgnoreCrossOriginWindowWhenNamedAccessOnWindow",
447 base::FEATURE_DISABLED_BY_DEFAULT};
448
Tarun Bansal38792462019-09-04 16:08:11449// When enabled, loading priority of JavaScript requests is lowered when they
450// are force deferred by the intervention.
451const base::Feature kLowerJavaScriptPriorityWhenForceDeferred{
452 "LowerJavaScriptPriorityWhenForceDeferred",
Tarun Bansal755268fe2019-10-18 18:57:40453 base::FEATURE_DISABLED_BY_DEFAULT};
Tarun Bansal38792462019-09-04 16:08:11454
Tarun Bansalf32aaa22020-02-12 16:16:44455// When enabled, scripts in iframes are not force deferred by the DeferAllScript
456// intervention.
457const base::Feature kDisableForceDeferInChildFrames{
458 "DisableForceDeferInChildFrames", base::FEATURE_DISABLED_BY_DEFAULT};
459
rajendrantd5db55f2019-10-19 01:56:59460// Enables redirecting subresources in the page to better compressed and
461// optimized versions to provide data savings.
462const base::Feature kSubresourceRedirect{"SubresourceRedirect",
463 base::FEATURE_DISABLED_BY_DEFAULT};
464
Stefan Zagerfd18161c2019-10-22 20:44:31465// When 'enabled', all cross-origin iframes will get a compositing layer.
466const base::Feature kCompositeCrossOriginIframes{
467 "CompositeCrossOriginIframes", base::FEATURE_DISABLED_BY_DEFAULT};
Yutaka Hirano0b3c319b2019-10-25 17:19:15468
Chris Harrelson70be13d2020-06-03 21:06:52469// When enabled, enforces new interoperable semantics for 3D transforms.
470// See crbug.com/1008483.
471const base::Feature kTransformInterop{"TransformInterop",
472 base::FEATURE_DISABLED_BY_DEFAULT};
473
Yutaka Hirano0b3c319b2019-10-25 17:19:15474// When enabled, beacons (and friends) have ResourceLoadPriority::kLow,
475// not ResourceLoadPriority::kVeryLow.
476const base::Feature kSetLowPriorityForBeacon{"SetLowPriorityForBeacon",
477 base::FEATURE_DISABLED_BY_DEFAULT};
478
Ben Kelly776f59d2019-11-06 16:25:30479// When enabled allows the header name used in the blink
480// CacheStorageCodeCacheHint runtime feature to be modified. This runtime
481// feature disables generating full code cache for responses stored in
482// cache_storage during a service worker install event. The runtime feature
483// must be enabled via the blink runtime feature mechanism, however.
484const base::Feature kCacheStorageCodeCacheHintHeader{
485 "CacheStorageCodeCacheHintHeader", base::FEATURE_DISABLED_BY_DEFAULT};
486const base::FeatureParam<std::string> kCacheStorageCodeCacheHintHeaderName{
487 &kCacheStorageCodeCacheHintHeader, "name", "x-CacheStorageCodeCacheHint"};
488
Francois Doray563453432019-11-20 15:32:17489// When enabled, the beforeunload handler is dispatched when a frame is frozen.
490// This allows the browser to know whether discarding the frame could result in
491// lost user data, at the cost of extra CPU usage. The feature will be removed
492// once we have determine whether the CPU cost is acceptable.
493const base::Feature kDispatchBeforeUnloadOnFreeze{
494 "DispatchBeforeUnloadOnFreeze", base::FEATURE_ENABLED_BY_DEFAULT};
495
Sunny Sachanandani26463422019-12-05 21:35:40496// Enables the use of GpuMemoryBuffer images for low latency 2d canvas.
497// TODO(khushalsagar): Enable this if we're using SurfaceControl and GMBs allow
498// us to overlay these resources.
499const base::Feature kLowLatencyCanvas2dImageChromium {
500 "LowLatencyCanvas2dImageChromium",
501#if defined(OS_CHROMEOS)
502 base::FEATURE_ENABLED_BY_DEFAULT
503#else
504 base::FEATURE_DISABLED_BY_DEFAULT
505#endif // OS_CHROMEOS
506};
507
508// Enables the use of shared image swap chains for low latency 2d canvas.
509const base::Feature kLowLatencyCanvas2dSwapChain{
Sunny Sachanandanib954dc7c2019-12-12 02:50:51510 "LowLatencyCanvas2dSwapChain", base::FEATURE_ENABLED_BY_DEFAULT};
Sunny Sachanandani26463422019-12-05 21:35:40511
512// Enables the use of shared image swap chains for low latency webgl canvas.
Sunny Sachanandanib954dc7c2019-12-12 02:50:51513const base::Feature kLowLatencyWebGLSwapChain{"LowLatencyWebGLSwapChain",
514 base::FEATURE_ENABLED_BY_DEFAULT};
Sunny Sachanandani26463422019-12-05 21:35:40515
Stephen Whitee17b0232020-04-27 23:48:49516// Enables Dawn-accelerated 2D canvas.
517const base::Feature kDawn2dCanvas{"Dawn2dCanvas",
518 base::FEATURE_DISABLED_BY_DEFAULT};
519
Xiaocheng Hud5197fd2020-02-06 07:26:08520const base::Feature kCSSReducedFontLoadingInvalidations{
Xiaocheng Hu75bafe52020-06-22 22:54:27521 "CSSReducedFontLoadingInvalidations", base::FEATURE_ENABLED_BY_DEFAULT};
Xiaocheng Hue5ff8e12020-06-16 21:47:35522const base::Feature kCSSReducedFontLoadingLayoutInvalidations{
523 "CSSReducedFontLoadingLayoutInvalidations",
524 base::FEATURE_DISABLED_BY_DEFAULT};
Xiaocheng Hud5197fd2020-02-06 07:26:08525
Egor Pasko28ec46952020-02-07 15:17:57526// When enabled, frees up CachedMetadata after consumption by script resources
527// and modules. Needed for the experiment in http://crbug.com/1045052.
528const base::Feature kDiscardCodeCacheAfterFirstUse{
529 "DiscardCodeCacheAfterFirstUse", base::FEATURE_DISABLED_BY_DEFAULT};
530
Yutaka Hiranobf410a42020-02-18 08:08:45531// The kill-switch for the fix for https://crbug.com/1051439.
532// TODO(crbug.com/1053369): Remove this around M84.
533const base::Feature kSuppressContentTypeForBeaconMadeWithArrayBufferView{
534 "SuppressContentTypeForBeaconMadeWithArrayBufferView",
535 base::FEATURE_ENABLED_BY_DEFAULT};
536
Ian Kilpatrickef7f4382020-06-02 12:38:10537const base::Feature kBlockFlowHandlesWebkitLineClamp{
Ian Kilpatrickbdec8902020-06-02 12:46:09538 "BlockFlowHandlesWebkitLineClamp", base::FEATURE_ENABLED_BY_DEFAULT};
Ian Kilpatrickef7f4382020-06-02 12:38:10539
Rune Lillesveen61f49ee2020-03-02 07:53:49540const base::Feature kBlockHTMLParserOnStyleSheets{
541 "BlockHTMLParserOnStyleSheets", base::FEATURE_DISABLED_BY_DEFAULT};
542
Mason Freed0ebaa772020-06-03 16:11:08543// Kill switch for the new <link disabled> behavior.
544// TODO(crbug.com/1087043): Remove this once the feature has
545// landed and no compat issues are reported.
546const base::Feature kLinkDisabledNewSpecBehavior{
547 "LinkDisabledNewSpecBehavior", base::FEATURE_ENABLED_BY_DEFAULT};
548
Xiaocheng Hud2e807d2020-03-04 21:15:21549// Slightly delays rendering if there are fonts being preloaded, so that
550// they don't miss the first paint if they can be loaded fast enough (e.g.,
551// from the disk cache)
552const base::Feature kFontPreloadingDelaysRendering{
Xiaocheng Hue60457d2020-07-20 06:09:54553 "FontPreloadingDelaysRendering", base::FEATURE_ENABLED_BY_DEFAULT};
554// 50ms is the overall best performing value in our experiments.
Xiaocheng Hud2e807d2020-03-04 21:15:21555const base::FeatureParam<int> kFontPreloadingDelaysRenderingParam{
Xiaocheng Hue60457d2020-07-20 06:09:54556 &kFontPreloadingDelaysRendering, "delay-in-ms", 50};
Xiaocheng Hud2e807d2020-03-04 21:15:21557
David Grogan565f8bb2020-05-27 03:07:40558const base::Feature kFlexNG{"FlexNG", base::FEATURE_ENABLED_BY_DEFAULT};
David Grogan5b3cf162020-03-19 21:53:15559
Dominic Farolino0f55a082020-03-24 09:47:55560const base::Feature kKeepScriptResourceAlive{"KeepScriptResourceAlive",
561 base::FEATURE_DISABLED_BY_DEFAULT};
Dominic Farolino7d3d6f12020-06-10 21:59:46562const base::Feature kDelayAsyncScriptExecution{
563 "DelayAsyncScriptExecution", base::FEATURE_DISABLED_BY_DEFAULT};
564const base::FeatureParam<DelayAsyncScriptDelayType>::Option
565 delay_async_script_execution_delay_types[] = {
566 {DelayAsyncScriptDelayType::kFinishedParsing, "finished_parsing"},
567 {DelayAsyncScriptDelayType::kFirstPaintOrFinishedParsing,
Dominic Farolino53270852020-08-06 22:28:00568 "first_paint_or_finished_parsing"},
569 {DelayAsyncScriptDelayType::kUseOptimizationGuide,
570 "use_optimization_guide"}};
Dominic Farolino7d3d6f12020-06-10 21:59:46571const base::FeatureParam<DelayAsyncScriptDelayType>
572 kDelayAsyncScriptExecutionDelayParam{
573 &kDelayAsyncScriptExecution, "delay_type",
574 DelayAsyncScriptDelayType::kFinishedParsing,
575 &delay_async_script_execution_delay_types};
Dominic Farolino0f55a082020-03-24 09:47:55576
Adrienne Walkerb53b4372020-05-06 18:57:18577// The AppCache feature is a kill-switch for the entire AppCache feature,
578// both backend and API. If disabled, then it will turn off the backend and
Wezd223c2a72020-08-12 13:22:03579// api, regardless of the presence of valid origin trial tokens.
Adrienne Walkere6b51722020-04-01 17:56:38580const base::Feature kAppCache{"AppCache", base::FEATURE_ENABLED_BY_DEFAULT};
Adrienne Walkerb53b4372020-05-06 18:57:18581// If AppCacheRequireOriginTrial is enabled, then the AppCache backend in the
582// browser will require origin trial tokens in order to load or store manifests
583// and their contents.
584const base::Feature kAppCacheRequireOriginTrial{
Adrienne Walkerdd9442e02020-06-10 16:23:40585 "AppCacheRequireOriginTrial", base::FEATURE_ENABLED_BY_DEFAULT};
Adrienne Walkere6b51722020-04-01 17:56:38586
Wan-Teh Chang75fd5322020-04-08 01:32:18587// Enables the AV1 Image File Format (AVIF).
Wan-Teh Changb9d67a12020-06-26 01:19:13588const base::Feature kAVIF{"AVIF", base::FEATURE_ENABLED_BY_DEFAULT};
Wan-Teh Chang75fd5322020-04-08 01:32:18589
Xiaocheng Hu66795f02020-04-25 00:26:47590// Make all pending 'display: auto' web fonts enter the swap or failure period
Xiaocheng Hu9e2055c2020-04-09 20:35:28591// immediately before reaching the LCP time limit (~2500ms), so that web fonts
592// do not become a source of bad LCP.
593const base::Feature kAlignFontDisplayAutoTimeoutWithLCPGoal{
594 "AlignFontDisplayAutoTimeoutWithLCPGoal",
595 base::FEATURE_DISABLED_BY_DEFAULT};
596
Xiaocheng Hu66795f02020-04-25 00:26:47597// The amount of time allowed for 'display: auto' web fonts to load without
598// intervention, counted from navigation start.
599const base::FeatureParam<int>
600 kAlignFontDisplayAutoTimeoutWithLCPGoalTimeoutParam{
601 &kAlignFontDisplayAutoTimeoutWithLCPGoal, "lcp-limit-in-ms", 2000};
602
603const base::FeatureParam<AlignFontDisplayAutoTimeoutWithLCPGoalMode>::Option
604 align_font_display_auto_timeout_with_lcp_goal_modes[] = {
605 {AlignFontDisplayAutoTimeoutWithLCPGoalMode::kToFailurePeriod,
606 "failure"},
607 {AlignFontDisplayAutoTimeoutWithLCPGoalMode::kToSwapPeriod, "swap"}};
608const base::FeatureParam<AlignFontDisplayAutoTimeoutWithLCPGoalMode>
609 kAlignFontDisplayAutoTimeoutWithLCPGoalModeParam{
610 &kAlignFontDisplayAutoTimeoutWithLCPGoal, "intervention-mode",
611 AlignFontDisplayAutoTimeoutWithLCPGoalMode::kToFailurePeriod,
612 &align_font_display_auto_timeout_with_lcp_goal_modes};
Xiaocheng Hu9e2055c2020-04-09 20:35:28613
Ben Kellyd52869b2020-04-20 17:17:43614// Enable throttling of fetch() requests from service workers in the
615// installing state.
616const base::Feature kThrottleInstallingServiceWorker{
617 "ThrottleInstallingServiceWorker", base::FEATURE_DISABLED_BY_DEFAULT};
618const base::FeatureParam<int> kInstallingServiceWorkerOutstandingThrottledLimit{
619 &kThrottleInstallingServiceWorker, "limit", 5};
620
Dave Tapuska95b71c82020-06-08 16:56:11621const base::Feature kInputPredictorTypeChoice{
622 "InputPredictorTypeChoice", base::FEATURE_DISABLED_BY_DEFAULT};
623
624const base::Feature kResamplingInputEvents{"ResamplingInputEvents",
625 base::FEATURE_DISABLED_BY_DEFAULT};
626
Dave Tapuskafea88942020-05-05 18:50:32627const base::Feature kResamplingScrollEvents{"ResamplingScrollEvents",
628 base::FEATURE_ENABLED_BY_DEFAULT};
629
Yoav Weiss200214d52020-05-13 23:58:42630// Enables the device-memory, resource-width, viewport-width and DPR client
631// hints to be sent to third-party origins if the first-party has opted in to
632// receiving client hints, regardless of Feature Policy.
633#if defined(OS_ANDROID)
634const base::Feature kAllowClientHintsToThirdParty{
635 "AllowClientHintsToThirdParty", base::FEATURE_ENABLED_BY_DEFAULT};
636#else
637const base::Feature kAllowClientHintsToThirdParty{
638 "AllowClientHintsToThirdParty", base::FEATURE_DISABLED_BY_DEFAULT};
639#endif
640
Dave Tapuskafea88942020-05-05 18:50:32641const base::Feature kFilteringScrollPrediction{
642 "FilteringScrollPrediction", base::FEATURE_DISABLED_BY_DEFAULT};
643
Dave Tapuskafea88942020-05-05 18:50:32644const base::Feature kKalmanHeuristics{"KalmanHeuristics",
645 base::FEATURE_DISABLED_BY_DEFAULT};
646
647const base::Feature kKalmanDirectionCutOff{"KalmanDirectionCutOff",
648 base::FEATURE_DISABLED_BY_DEFAULT};
649
650const base::Feature kSkipTouchEventFilter{"SkipTouchEventFilter",
651 base::FEATURE_ENABLED_BY_DEFAULT};
652const char kSkipTouchEventFilterTypeParamName[] = "type";
653const char kSkipTouchEventFilterTypeParamValueDiscrete[] = "discrete";
654const char kSkipTouchEventFilterTypeParamValueAll[] = "all";
655const char kSkipTouchEventFilterFilteringProcessParamName[] =
656 "skip_filtering_process";
657const char kSkipTouchEventFilterFilteringProcessParamValueBrowser[] = "browser";
658const char kSkipTouchEventFilterFilteringProcessParamValueBrowserAndRenderer[] =
659 "browser_and_renderer";
660
Patrick To2afc1162020-06-03 18:19:30661// Improves support for WebXR on computers with multiple GPUs.
662const base::Feature kWebXrMultiGpu{"WebXRMultiGpu",
663 base::FEATURE_DISABLED_BY_DEFAULT};
664
Anders Hartvoll Ruud80f8818812020-06-09 08:07:31665// Enables dependency support in blink::MatchedPropertiesCache, which allows
666// caching of previously uncachable objects.
667const base::Feature kCSSMatchedPropertiesCacheDependencies{
668 "CSSMatchedPropertiesCacheDependencies", base::FEATURE_DISABLED_BY_DEFAULT};
669
Benoit Lize66684b22020-08-07 12:30:22670// Disabling this will cause parkable strings to never be compressed.
671// This is useful for headless mode + virtual time. Since virtual time advances
672// quickly, strings may be parked too eagerly in that mode.
673const base::Feature kCompressParkableStrings{"CompressParkableStrings",
674 base::FEATURE_ENABLED_BY_DEFAULT};
675
Benoit Lize04cbcd9d2020-06-18 09:44:27676// Whether ParkableStrings can be written out to disk.
Benoit Lize66684b22020-08-07 12:30:22677// Depends on compression above.
Benoit Lize04cbcd9d2020-06-18 09:44:27678const base::Feature kParkableStringsToDisk{"ParkableStringsToDisk",
679 base::FEATURE_DISABLED_BY_DEFAULT};
680
Benoit Lize66684b22020-08-07 12:30:22681bool IsParkableStringsToDiskEnabled() {
682 return base::FeatureList::IsEnabled(kParkableStringsToDisk) &&
683 base::FeatureList::IsEnabled(kCompressParkableStrings);
684}
685
Yue Li384bb092020-08-11 23:35:28686// Controls whether to auto select on contextual menu click in Chrome OS.
687const base::Feature kCrOSAutoSelect{"CrOSAutoSelect",
688 base::FEATURE_DISABLED_BY_DEFAULT};
689
Chris Harrelsonb4f3bd92020-08-13 00:57:30690const base::Feature kCompositingOptimizations{
691 "CompositingOptimizations", base::FEATURE_DISABLED_BY_DEFAULT};
692
Matt Falkenhagen5cc652792018-06-21 10:34:33693} // namespace features
694} // namespace blink