Runtime flags enable Blink developers the ability to control access Chromium users have to new features they implement. Features that are hidden behind a runtime flag are known as Runtime Enabled Features. It is a requirement of the Blink Launch Process to implement new web exposed features behind a runtime flag until an Intent To Ship has been approved.
Runtime Enabled Features are defined in RuntimeEnabledFeatures.json5 in alphabetical order. Add your feature's flag to this file and the rest will be generated for you automatically.
 content_shell will not enable experimental/test features by default, the --run-layout-test flag used as part of running LayoutTests enables this behaviour.
 Navigate to about:flags in the URL bar and turn on "Enable experimental web platform features" (formerly, "Enable experimental WebKit features")
or run Chromium with --enable-experimental-web-platform-features (formerly, --enable-experimental-webkit-features)
Works in all Chromium channels: canary, dev, beta, and stable.
 For features that are not web exposed features but require code in Blink to be triggered. Such feature can have a about:flags entry or be toggled
based on other signals. Such entries should be called out in a comment to differentiate them from stalled entries.
Runtime Enabled CSS Properties
If your feature is adding new CSS Properties you will need to use the runtime_flag argument in Source/core/css/CSSProperties.json5.
C++ Source Code
Add this include:
This will provide following static methods to check/set whether your feature is enabled:
Note: methodNames are in lowerCamelCase, while FeatureNames are in UpperCamelCase. This is handled automatically in code generators, and works even if the feature's flag name begins with an acronym such as "CSS", "IME", or "HTML".
For example "CSSMagicFeature" becomes
Use the Blink extended attribute
Note: FeatureNames are in UpperCamelCase; please use this case in IDL files.
You can guard the entire interface, as in this example:
Alternatively, you can guard individual definition members:
Note: You cannot guard individual arguments, as this is very confusing and error-prone. Instead, use overloading and guard the overloads.
For example, instead of:
Warning: You will not be able to change the enabled state of these at runtime as the V8 object templates definitions are created during start up and will not be updated during runtime.
Test whether a feature is enabled using:
This attribute is read only and cannot be changed.
When content_shell is run with --stable-release-mode flag, test-only features (ones listed in RuntimeEnabledFeatures.json5 with "test") are turned off.
Source/bindings/scripts/CodeGeneratorV8.pm uses the generated InternalRuntimeFlags.idl to generate:
After applying most other feature settings, the features requested feature settings (comma-separated) are changed. "disable" is applied later (and takes precedence), regardless of the order the switches appear on the command line. These switches only affects Blink's state. Some features may need to be switched on in Chromium as well; in this case, a specific flag is required.