// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module blink.mojom;
// ============ Definition for WebDXFeature used for UseCounter ===========
//
// Do not change assigned numbers of existing items: add new features
// to the end of the list.
//
// If you want to mark an item as no-longer-used, simply rename it, prefixing
// "kOBSOLETE_" before the existing name.
// E.g. kFrobulate becomes kOBSOLETE_Frobulate.
//
// A WebDXFeature counter represents actual usage of a high level feature (as
// defined in https://github.com/web-platform-dx/web-features). A WebDXFeature
// can be a JS API, an HTML element, CSS, etc. Generally, we want these counters
// to count usage of a feature by a web developer on a page. I.e. aim to count
// along the following principles:
//
// * JS invocable API: Call on invocation of central entry points
// (i.e. constructor, main API method implementations, or other central
// code paths not likely to be triggered by feature detection or
// fingerprinting on a web page), or triggered by internal usage in the
// renderer.
//
// * HTML: Count when an element is observed, either by being parsed or
// constructed by script.
//
// * CSS: Count when a feature is actually used by the page when reasonable,
// not just present in a loaded CSS file.
//
// The names of features in this enum should map to the identifiers (i.e. .yml
// file names) used by the WebDX community group at the W3C
// (https://github.com/web-platform-dx/web-features/tree/main/features).
// Those identifiers are all lower case alphanumeric identifiers, with dashes
// (-) as word separators. To translate those identifier names to enum names
// here, start with a lower case 'k', then camelcase the name and remove the
// dashes. I.e. "view-transitions" becomes kViewTransitions. More discussion
// about WebDX feature identifier naming can be found at
// https://github.com/web-platform-dx/web-features/tree/main/docs#identifiers
//
// In the event that you're adding a use counter for a feature that is yet to be
// defined by the WebDX community group, file an issue at
// https://github.com/web-platform-dx/web-features/issues/new?assignees=&labels=feature+definition&projects=&template=new-feature.yml,
// pick a name that you feel is likely to become the name that is used as the
// identifier once agreed upon by the WebDX community group, and prefix the name
// with DRAFT_. I.e. if the likely identifier name is sprocket, name your use
// counter kDRAFT_Sprocket. Once the community group has agreed on the
// identifier name, remove DRAFT_ from the use counter name here, and update the
// name itself if necessary.
//
// LINT.IfChange(WebDXFeature)
enum WebDXFeature {
kPageVisits = 0,
kCompressionStreams = 1,
kViewTransitions = 2,
kPopover = 3,
kSubgrid = 4,
kCascadeLayers = 5,
kAccentColor = 6,
kAnimationComposition = 7,
kAppearance = 8,
kAspectRatio = 9,
kAvif = 10,
kBackdropFilter = 11,
kBlockingRender = 12,
kBorderImage = 13,
kBroadcastChannel = 14,
kCanvasContextLost = 15,
kColorScheme = 16,
kComputePressure = 17,
kConstructedStylesheets = 18,
kContainerQueries = 19,
kContainerStyleQueries = 20,
kContainIntrinsicSize = 21,
kCounterStyle = 22,
kCssModules = 23,
kDeclarativeShadowDom = 24,
kDialog = 25,
kDocumentPictureInPicture = 26,
kFlexboxGap = 27,
kFlexbox = 28,
kFocusVisible = 29,
kFontOpticalSizing = 30,
kFontPaletteAnimation = 31,
kFontPalette = 32,
kFontSynthesisSmallCaps = 33,
kFontSynthesisStyle = 34,
kFontSynthesisWeight = 35,
kFontSynthesis = 36,
kFontVariantAlternates = 37,
kGrid = 38,
kHas = 39,
kHyphens = 40,
kIdleDetection = 41,
kImportMaps = 42,
kIndividualTransforms = 43,
kIntersectionObserverV2 = 44,
kIntersectionObserver = 45,
kIs = 46,
kJsModules = 47,
kMediaSession = 48,
kOffscreenCanvas = 49,
kOriginPrivateFileSystem = 50,
kPictureInPicture = 51,
kPointerLock = 52,
kRelativeColor = 53,
kScope = 54,
kScrollbarColor = 55,
kScrollbarGutter = 56,
kScrollbarWidth = 57,
kScrollend = 58,
kScrollSnap = 59,
kScrollToTextFragment = 60,
kShowPickerInput = 61,
kSlot = 62,
kSpeechRecognition = 63,
kSpeechSynthesis = 64,
kStorageAccess = 65,
kStorageBuckets = 66,
kTargetText = 67,
kTemplate = 68,
kTextIndent = 69,
kTextSpacingTrim = 70,
kTextWrapBalance = 71,
kTextWrapPretty = 72,
kTransitionBehavior = 73,
kTrustedTypes = 74,
kUserPseudos = 75,
kWebcodecs = 76,
kWebhid = 77,
kWebLocks = 78,
kWebp = 79,
kWebtransport = 80,
kWebusb = 81,
kWebvtt = 82,
kWhere = 83,
kDatalist = 84,
kDirPseudo = 85,
kHiddenUntilFound = 86,
kWillChange = 87,
kAbortsignalAny = 88,
kNavigation = 89,
kMathml = 90,
kCanvasCreateconicgradient = 91,
kCanvasReset = 92,
kCanvasRoundrect = 93,
kCanvasTextBaselines = 94,
kColorMix = 95,
kAriaAttributeReflection = 96,
kAnchorPositioning = 97,
kImageSet = 98,
kStructuredClone = 99,
kSlotAssign = 100,
kMasks = 101,
kDeviceOrientationEvents = 102,
kDRAFT_Gamepad = 103,
kScreenWakeLock = 104,
kWebBluetooth = 105,
kWebNfc = 106,
kDRAFT_Serial = 107,
kJsModulesServiceWorkers = 108,
kJsModulesSharedWorkers = 109,
kJsModulesWorkers = 110,
// Add new features immediately above this line. Don't change assigned
// numbers of any item, and don't reuse removed slots.
// Also, run update_use_counter_feature_enum.py in
// chromium/src/tools/metrics/histograms/ to update the UMA mapping.
};
// LINT.ThenChange(//tools/metrics/histograms/enums.xml:WebDXFeatureObserver)