blob: 8b1c1155a21c77df1ee17bf81dddfb7a8ae7624c [file] [log] [blame]
# This file desribes all Web IDL extended attributes that are supported by the
# Cobalt bindings code generation pipeline. Using an extended attribute not
# listed below will cause the build to fail.
# Extended attributes include attributes listed in the Web IDL specification
# (http://heycam.github.io/webidl/#idl-extended-attributes) and custom
# attributes that we need to support Cobalt's bindings implementation.
#
# This file and format is derived from Blink IDL extended attribute whitelist,
# which can be found under
# third_party/blink/Source/bindings/IDLExtendedAttributes.txt
#
# If you introduce a new extended attribute or value:
# (1) add the extended attribute or value to this file
# (2) add test cases to run-bindings-tests to exercise the new attribute,
# if appropriate.
#
# The syntax of this file is as follows:
# - One extended attribute per one line: Name and (optionally) Values.
# - "Attr" means that the Attr does not take a value, i.e. [Attr].
# - "Attr=X" means that Attr takes a required value, which must be X;
# i.e. [Attr=X].
# - "Attr=X|Y|Z" means that Attr takes a required value, and the valid
# values are X, Y, and Z, and combinations thereof;
# e.g. [Attr=X], [Attr=Y], [Attr=X|Z].
# The separator must be | or &, so [Attr=X&Z] is also valid; the
# separator makes a difference for Conditional, but otherwise is simply
# a style convention.
# - "Attr=|X|Y|Z" means that Attr takes an optional value, whose valid
# values (if present) are X, Y, and Z, and combinations thereof; e.g.
# [Attr], [Attr=X], [Attr=Y], [Attr=X|Z], [Attr=X|Y|Z], [Attr=X&Z].
# Note that including an empty value in the list, as in [Attr=X||Y],
# is NOT valid: the value is optional, but empty values are not allowed.
# - "Attr=*" means that Attr takes a required value, which can be
# arbitrary, and combinations thereof, e.g. [Attr=IndexedDB],
# [Attr=DeleteFunction], [Attr=X|Y].
# - "Attr=|*" means that Attr takes an optional value, which can be
# arbitrary, e.g. [Attr], [Attr=X].
# - "Attr=X|*" means that Attr takes an required value, which can be
# arbitrary, but that "X" is standard, e.g. [Attr=X], [Attr=Foo].
#
# An Interface Object for this interface will not be created.
# https://www.w3.org/TR/WebIDL/#NoInterfaceObject
NoInterfaceObject
# This interface will be used as a global object. PrimaryGlobal s intended to be
# used by the Window interface, but is also used for TestWindow in unit tests.
# http://heycam.github.io/webidl/#Global
Global
PrimaryGlobal
# This interface is exposed on the specified global interface, rather than
# the default of Window.
# This is generally used for exposing interfaces to Worker interfaces, but it is
# also used in Cobalt to expose interfaces used in unit tests to a TestWindow
# global interface, rather than the default Window global interface.
# http://heycam.github.io/webidl/#Exposed
Exposed=*
# The value of this attribute is a list of functions to be called that will
# return a scoped_refptr<Wrappable>.
# The raw pointer will be added as an opaque root when an instance of this
# interface is visited during garbage collection.
AddOpaqueRoots=|*
# The value of this attribute is a function to be called that will return a
# scoped_refptr<Wrappable> that represents an opaque root of an object
# implementing this interface.
# If opaque root of an object is in the set of opaque roots that have been
# collected during garbage collection, the object's wrapper will be kept alive
# as well.
GetOpaqueRoot=*
# Call the Cobalt function this property is bound to with the corresponding
# object added to the head of the function's parameters.
# StackTrace is a custom addition to CallWith for the purpose of testing
# GetStackTrace, and is not specified in the spec.
CallWith=EnvironmentSettings|StackTrace
ConstructorCallWith=EnvironmentSettings
# The constructor/attribute/operation may raise an exception. A pointer to an
# ExceptionState interface will be passed to the implementation at the end of
# the parameter list.
RaisesException=|Constructor|Setter
# The Constructor keyword exposes a Constructor to JavaScript.
Constructor
# The Constructor for an interface is different from the interface name.
NamedConstructor=*
# When set on a DOMString type, null will be converted to the empty string
# rather than the string "null".
TreatNullAs=EmptyString
# When TreatUndefinedAs=EmptyString is set on a DOMString type, undefined will
# be converted to the empty string rather than the string "undefined".
TreatUndefinedAs=EmptyString
# Surround the affected code in #if defined(CONDITIONAL_VALUE). Can be applied
# to interfaces and individual properties.
Conditional=*
# Marks an interface or properties of an interface as not supported. Such
# properties are not visible from JavaScript. Attempts to access them will
# trigger a notification.
NotSupported
# If the Clamp extended attribute appears on an operation argument,
# writable attribute or dictionary member whose type is one of the
# integer types, it indicates that when an ECMAScript Number is
# converted to the IDL type, out of range values will be clamped to the
# range of valid values, rather than using the operators that use a
# module operation.
Clamp
# Not yet supported
ArrayClass
LenientThis
OverrideBuiltins
PutForwards=*
Replaceable
Unforgeable
# Ignored attributes. We do not perform any additional logic in the bindings
# when these attributes are present
NewObject
SameObject
# Allows to specify an alternate method name for an attribute implementation.
# Can be used to avoid using reserved keywords for method names.
ImplementedAs=*