author Edgar Chen <>
Wed, 28 Nov 2018 15:11:38 +0000
changeset 505298 531d30645f389f8ab0502bf9d5f27fb6f820ce26
parent 504646 d61b59d39b4adc3a322609cac931cab5257cbda9
child 507301 a5ad58077bd87428465c52f55997d8254d61a162
permissions -rw-r--r--
Bug 1509795 - Add UseCounter telemetry for Shadow DOM API; r=smaug Differential Revision:

// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at

// This file defines a list of use counters, which are things that can
// record usage of Web platform features and then report this information
// through Telemetry.
// The format of this file is very strict.  Each line can be:
//   (a) a blank line
//   (b) a comment, which is a line that begins with "//"
//   (c) one of four possible use counter declarations:
//         method <IDL interface name>.<IDL operation name>
//         attribute <IDL interface name>.<IDL attribute name>
//         property <CSS property method name>
//         custom <any valid identifier> <description>
// The |CSS property method name| should be CamelCase form of the property
// name with -moz- and -x- prefix removed.
// The <description> for custom counters will be appended to "When a document "
// or "When a page ", so phrase it appropriately.  For instance, "constructs a
// Foo object" or "calls'some value')".  It may contain any
// character (including whitespace).
// To actually cause use counters to be incremented, DOM methods
// and attributes must have a [UseCounter] extended attribute in
// the Web IDL file.  CSS properties require no special treatment
// beyond being listed below.  Custom counters are incremented when
// SetDocumentAndPageUseCounter(eUseCounter_custom_MyName) is called on an
// ns(I)Document object.
// You might reasonably ask why we have this file and we require
// annotating things with [UseCounter] in the relevant WebIDL file as
// well.  Generating things from bindings codegen and ensuring all the
// dependencies were correct would have been rather difficult, and
// annotating the WebIDL files does nothing for identifying CSS
// property usage, which we would also like to track.

method SVGSVGElement.getElementById
attribute SVGSVGElement.currentScale
property Fill
property FillOpacity
attribute XMLDocument.async
attribute DOMError.message
custom DOMErrorConstructor constructed a DOMError

// Push API
method PushManager.subscribe
method PushSubscription.unsubscribe

// window.sidebar
attribute Window.sidebar

// External interface
method External.AddSearchProvider

// no-data URLs for iframes
custom no_data_URL used in iframes

// AppCache API
method OfflineResourceList.swapCache
method OfflineResourceList.update
attribute OfflineResourceList.status
attribute OfflineResourceList.onchecking
attribute OfflineResourceList.onerror
attribute OfflineResourceList.onnoupdate
attribute OfflineResourceList.ondownloading
attribute OfflineResourceList.onprogress
attribute OfflineResourceList.onupdateready
attribute OfflineResourceList.oncached
attribute OfflineResourceList.onobsolete

// Non-standard IndexedDB API
method IDBDatabase.createMutableFile
method IDBDatabase.mozCreateFileHandle
method IDBMutableFile.getFile

// DataTransfer API (gecko-only methods)
method DataTransfer.addElement
attribute DataTransfer.mozItemCount
attribute DataTransfer.mozCursor
method DataTransfer.mozTypesAt
method DataTransfer.mozClearDataAt
method DataTransfer.mozSetDataAt
method DataTransfer.mozGetDataAt
attribute DataTransfer.mozUserCancelled
attribute DataTransfer.mozSourceNode

// Marquee events
custom onstart sets a <marquee> onstart event listener
custom onbounce sets a <marquee> onbounce event listener
custom onfinish sets a <marquee> onfinish event listener

// JavaScript feature usage
custom JS_asmjs uses asm.js
custom JS_wasm uses WebAssembly

// Console API
method console.assert
method console.clear
method console.count
method console.countReset
method console.debug
method console.error
method console.log
method console.table
method console.trace
method console.warn
method console.dir
method console.dirxml
method console.groupCollapsed
method console.groupEnd
method console.time
method console.timeLog
method console.timeEnd
method console.exception
method console.timeStamp
method console.profile
method console.profileEnd

// information
custom DocumentOpen calls in a way that creates a new Window object
custom DocumentOpenReplace calls in a way that creates a new Window object and replaces the old history entry.

custom FilteredCrossOriginIFrame cross-origin <iframe> within a CSS/SVG filter

// Custom Elements
method CustomElementRegistry.define

// Shadow DOM
method Element.attachShadow