gecko/dom/bindings/Bindings.conf
Boris Zbarsky 8231be64a0 Bug 824589. Convert XULElement to WebIDL. r=peterv
The assertions in nsINode and nsWrapperCache are to eagerly catch
failures to override those methods.

The classinfo change for XULTreeBuilder is needed because one of those
is returned via an nsIXULTemplateBuilder attribute on XULElement.
Alternately, I could mark it notflattened in Bindings.conf, but Enn
said he prefers this anyway.

The change to the QI impl in BindingUtils is needed because when
XPConnect converts an IID from C++ to JS it makes is an nsJSID, not an
nsJSIID.  We've run into this before, sadly.

I removed "id" from nsIDOMXULElement because it's already on Element.
I suppose I could have left it there, but this seems cleaner.

The nsJSIID::HasInstance changes are needed to support XBL-implemented
interfaces.  Sadly, this does mean that if the underlying object QIs
to something but we didn't put those props on the WebIDL we'll end up
testing true for instanceof but not exposing the props.  I don't see
an obviously better way.  We should work on killing off uses of
"instanceof someinterface".

The browser.js change is needed to avoid throwing exceptions during
browser-chrome tests that are now getting reported because our
swapFrameLoaders is no longer an XPConnect method.
2013-01-29 12:51:55 -05:00

1260 lines
34 KiB
Plaintext

# 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 http://mozilla.org/MPL/2.0/.
# DOM Bindings Configuration.
#
# The WebIDL interfaces are defined in dom/webidl. For each such interface, there
# is a corresponding entry in the configuration table below. The configuration
# table maps each interface name to a |descriptor| or list of |descriptor|s.
#
# Valid fields for all descriptors:
# * nativeType - The native type (concrete class or XPCOM interface) that
# instances of this interface will unwrap to. If not
# specified, defaults to "mozilla::dom::InterfaceName" for
# non-worker non-external-or-callback interfaces, to
# "mozilla::dom::workers::InterfaceName" for worker
# non-external interfaces, to 'nsIDOM' followed by the
# interface name for non-worker external-or-callback
# interfaces, and to "JSObject" for worker external-or-callback
# interfaces.
# * headerFile - The file in which the nativeType is declared (defaults
# to an educated guess).
# * castable - Indicates whether the value in the wrapper can be cast to
# nativeType, or whether it needs to be QI-ed (defaults to True
# for everything but callback interfaces and external interfaces,
# for which it defaults to false and is not allowed to be set
# at all).
# * concrete - Indicates whether there exist objects with this interface as
# their primary interface. Always False for callback interfaces.
# defaults to True otherwise.
# * prefable - Indicates whether this bindings should be disabled if the
# global pref for Web IDL bindings is set to false. This is a
# risk mitigation strategy and it will cause all of the Web IDL
# bindings marked as prefable to fall back to the xpconnect
# bindings in case something goes wrong. This defaults to False.
# Setting this on objects which only have Web IDL bindings does
# not make any sense.
# Cannot be set on external interfaces.
# * workers - Indicates whether the descriptor is intended to be used for
# worker threads (defaults to false).
# * customTrace - The native class will use a custom trace hook (defaults to
# true for workers, false otherwise).
# * customFinalize - The native class will use a custom finalize hook
# (defaults to true for workers, false otherwise).
# * notflattened - The native type does not have nsIClassInfo, so when
# wrapping it the right IID needs to be passed in.
# * register - True if this binding should be registered. Defaults to true.
# * binaryNames - Dict for mapping method and attribute names to different
# names when calling the native methods (defaults to an empty
# dict). The keys are the property names as they appear in the
# .webidl file and the values are the names as they should be
# in the WebIDL.
# * wrapperCache: True if this object is a wrapper cache. Objects that are
# not can only be returned from a limited set of methods,
# cannot be prefable, and must ensure that they disallow
# XPConnect wrapping. Always false for callback interfaces.
# Always true for worker descriptors for non-callback
# interfaces. Defaults to true for non-worker non-callback
# descriptors.
# * nativeOwnership: Describes how the native object is held. 4 possible
# types: worker object ("worker"), non-refcounted object
# ("owned"), refcounted non-nsISupports object
# ("refcounted") or nsISupports ("nsisupports").
# Non-refcounted objects need to inherit from
# mozilla::dom::NonRefcountedDOMObject and preferably use
# MOZ_COUNT_CTOR/MOZ_COUNT_DTOR in their
# constructor/destructor so they participate in leak
# logging.
# This mostly determines how the finalizer releases the
# binding's hold on the native object. For a worker object
# it'll call Release, for a non-refcounted object it'll
# call delete through XPConnect's deferred finalization
# mechanism, for a refcounted object it'll call Release
# through XPConnect's deferred finalization mechanism.
# Always "worker" for worker descriptors. Defaults to
# "nsisupports".
#
# The following fields are either a string, an array (defaults to an empty
# array) or a dictionary with three possible keys (all, getterOnly and
# setterOnly) each having such an array as the value
#
# * implicitJSContext - attributes and methods specified in the .webidl file
# that require a JSContext as the first argument
# * resultNotAddRefed - attributes and methods specified in the .webidl file
# that do not AddRef the return value
#
# A descriptor can also have 'skipGen': True specified if it should be skipped
# when deciding what header includes to generate and should never have an
# implementation generated for it. This is only needed in special cases like
# worker descriptors for objects that will never actually appear in workers.
DOMInterfaces = {
'AudioContext': {
'implicitJSContext': [ 'createBuffer' ],
'nativeOwnership': 'refcounted',
'resultNotAddRefed': [ 'destination', 'listener' ],
},
'AudioBufferSourceNode': {
'wrapperCache': False
},
'AudioListener' : {
'nativeOwnership': 'refcounted'
},
'AudioNode' : {
'concrete': False,
},
'AudioParam' : {
'nativeOwnership': 'refcounted'
},
'AudioSourceNode': {
'concrete': False,
},
'BiquadFilterNode': {
'resultNotAddRefed': [ 'frequency', 'q', 'gain' ],
'wrapperCache': False
},
'Blob': [
{
'headerFile': 'nsIDOMFile.h',
},
{
'workers': True,
}],
'CanvasRenderingContext2D': {
'implicitJSContext': [
'createImageData', 'getImageData', 'strokeStyle',
'fillStyle', 'mozDash'
],
'resultNotAddRefed': [ 'canvas' ],
'binaryNames': {
'mozImageSmoothingEnabled': 'imageSmoothingEnabled',
'mozFillRule': 'fillRule'
}
},
'CaretPosition' : {
'nativeType': 'nsDOMCaretPosition',
},
'CDATASection': {
'hasInstanceInterface': 'nsIDOMCDATASection',
},
'CharacterData': {
'nativeType': 'nsGenericDOMDataNode',
'hasInstanceInterface': 'nsIDOMCharacterData',
'concrete': False
},
'ClientRectList': {
'nativeType': 'nsClientRectList',
'headerFile': 'nsClientRect.h',
'resultNotAddRefed': [ 'item' ]
},
'Comment': {
'hasInstanceInterface': 'nsIDOMComment',
},
'CSS': {
'concrete': False,
},
'CSS2Properties': {
'nativeType': 'nsDOMCSSDeclaration'
},
"CSSPrimitiveValue": {
"nativeType": "nsROCSSPrimitiveValue",
"resultNotAddRefed": ["getRGBColorValue", "getRectValue"]
},
'CSSStyleDeclaration': {
'nativeType': 'nsICSSDeclaration'
},
"CSSValue": {
"concrete": False
},
"CSSValueList": {
"nativeType": "nsDOMCSSValueList",
"hasInstanceInterface": "nsIDOMCSSValueList"
},
'DelayNode': [
{
'resultNotAddRefed': [ 'delayTime' ],
'wrapperCache': False
}],
'Document': [
{
'nativeType': 'nsIDocument',
'hasXPConnectImpls': True,
'hasInstanceInterface': 'nsIDOMDocument',
'resultNotAddRefed': [ 'implementation', 'doctype', 'documentElement',
'getElementById', 'adoptNode', 'defaultView',
'activeElement', 'currentScript',
'mozFullScreenElement', 'mozPointerLockElement',
'styleSheets', 'styleSheetSets', 'elementFromPoint',
'querySelector', 'getAnonymousNodes',
'getAnonymousElementByAtribute', 'getBindingParent'
]
},
{
'nativeType': 'JSObject',
'workers': True,
'skipGen': True
}],
'DOMParser': {
'nativeType': 'nsDOMParser',
},
'DocumentFragment': {
'resultNotAddRefed': [ 'querySelector' ]
},
'DocumentType': {
'hasInstanceInterface': 'nsIDOMDocumentType'
},
'DOMSettableTokenList': {
'nativeType': 'nsDOMSettableTokenList',
'binaryNames': {
'__stringifier': 'Stringify'
}
},
'DOMStringMap': {
'nativeType': 'nsDOMStringMap'
},
'DOMTokenList': {
'nativeType': 'nsDOMTokenList',
'binaryNames': {
'__stringifier': 'Stringify'
}
},
'DummyInterface': {
'skipGen': True,
'register': False,
},
'DummyInterfaceWorkers': {
'skipGen': True,
'register': False,
'workers': True
},
'DynamicsCompressorNode': {
'resultNotAddRefed': [ 'threshold', 'knee', 'ratio',
'reduction', 'attack', 'release' ],
'binaryNames': {
'release': 'getRelease'
},
'wrapperCache': False
},
'Element': {
'hasXPConnectImpls': True,
'hasInstanceInterface': 'nsIDOMElement',
'resultNotAddRefed': [
'classList', 'attributes', 'children', 'firstElementChild',
'lastElementChild', 'previousElementSibling', 'nextElementSibling',
'getAttributeNode', 'getAttributeNodeNS', 'querySelector'
]
},
'Event': [
{
'workers': True,
}],
'EventListener': [
{
'nativeType': 'nsIDOMEventListener'
},
{
'workers': True,
}],
'EventTarget': [
{
'hasInstanceInterface': 'nsIDOMEventTarget',
'hasXPConnectImpls': True,
'concrete': False,
},
{
'workers': True,
'concrete': False
}],
'FileHandle': {
'nativeType': 'mozilla::dom::file::FileHandle'
},
'FileList': {
'nativeType': 'nsDOMFileList',
'headerFile': 'nsDOMFile.h',
'resultNotAddRefed': [ 'item' ]
},
'FileReaderSync': {
'workers': True,
},
'DOMTransaction': [
{
'nativeType': 'nsIUndoManagerTransaction',
'headerFile': 'nsIUndoManagerTransaction.h',
}],
'UndoManager': [
{
'implicitJSContext' : [ 'undo', 'redo', 'transact' ]
}],
'FormData': [
{
'nativeType': 'nsFormData'
},
{
'workers': True,
'skipGen': True,
'nativeType': 'JSObject'
}],
'GainNode': {
'resultNotAddRefed': [ 'gain' ],
'wrapperCache': False
},
'HTMLAnchorElement': {
'binaryNames': {
'__stringifier': 'Stringify'
},
'hasInstanceInterface': 'nsIDOMHTMLAnchorElement',
},
'HTMLBodyElement': {
'hasInstanceInterface': 'nsIDOMHTMLBodyElement',
},
'HTMLCollection': {
'nativeType': 'nsIHTMLCollection',
'resultNotAddRefed': [ 'item' ]
},
'HTMLDataListElement': {
'resultNotAddRefed': [
'options'
]
},
'HTMLDivElement': {
'hasInstanceInterface': 'nsIDOMHTMLDivElement',
},
'HTMLDListElement': {
'headerFile' : 'mozilla/dom/HTMLSharedListElement.h'
},
'HTMLDocument': {
'nativeType': 'nsHTMLDocument',
'register': False,
'hasXPConnectImpls': True,
'hasInstanceInterface': 'nsIDOMHTMLDocument',
'resultNotAddRefed': [ 'body', 'head', 'images', 'embeds', 'plugins',
'links', 'forms', 'scripts', 'anchors', 'applets' ],
'implicitJSContext': [ 'open', 'write', 'writeln' ]
},
'HTMLElement': {
'nativeType': 'nsGenericHTMLElement',
'hasXPConnectImpls': True,
'hasInstanceInterface': 'nsIDOMHTMLElement',
'resultNotAddRefed': [
'itemType', 'itemRef', 'itemProp', 'properties', 'contextMenu', 'style',
'offsetParent'
]
},
'HTMLFrameSetElement': {
'hasInstanceInterface': 'nsIDOMHTMLFrameSetElement',
},
'HTMLHeadingElement': {
'hasInstanceInterface': 'nsIDOMHTMLHeadingElement',
},
'HTMLImageElement': {
'hasInstanceInterface': 'nsIDOMHTMLImageElement',
},
'HTMLLabelElement': {
'resultNotAddRefed': [
'form', 'control'
],
'hasInstanceInterface': 'nsIDOMHTMLLabelElement',
},
'HTMLLIElement': {
'hasInstanceInterface': 'nsIDOMHTMLLIElement',
},
'HTMLOListElement': {
'headerFile' : 'mozilla/dom/HTMLSharedListElement.h',
'hasInstanceInterface': 'nsIDOMHTMLOListElement'
},
'HTMLOptionsCollection': {
'nativeType': 'nsHTMLOptionCollection',
'headerFile': 'nsHTMLSelectElement.h',
'resultNotAddRefed': [ 'item' ],
'binaryNames': {
'__indexedsettercreator': 'SetOption'
}
},
'HTMLParagraphElement': {
'hasInstanceInterface': 'nsIDOMHTMLParagraphElement',
},
'HTMLPreElement': {
'hasInstanceInterface': 'nsIDOMHTMLPreElement',
},
'HTMLPropertiesCollection': {
'headerFile': 'HTMLPropertiesCollection.h',
'resultNotAddRefed': [ 'item', 'namedItem', 'names' ]
},
'HTMLScriptElement': {
'hasInstanceInterface': 'nsIDOMHTMLScriptElement',
},
'HTMLTableCellElement': {
'hasInstanceInterface': 'nsIDOMHTMLTableCellElement'
},
'HTMLTableColElement': {
'hasInstanceInterface': 'nsIDOMHTMLTableColElement'
},
'HTMLTableElement': {
'hasInstanceInterface': 'nsIDOMHTMLTableElement',
'resultNotAddRefed': [
'caption', 'tHead', 'tFoot', 'tBodies', 'rows'
]
},
'HTMLTableRowElement': {
'hasInstanceInterface': 'nsIDOMHTMLTableRowElement',
'resultNotAddRefed': [
'cells'
]
},
'HTMLTableSectionElement': {
'hasInstanceInterface': 'nsIDOMHTMLTableSectionElement',
'resultNotAddRefed': [
'rows'
]
},
'HTMLUListElement': {
'headerFile' : 'mozilla/dom/HTMLSharedListElement.h'
},
'IID': [
{
'nativeType': 'nsIJSID',
'headerFile': 'xpcjsid.h',
},
{
'workers': True,
}],
'ImageData': {
'wrapperCache': False
},
'InputStream': [
{
'nativeType': 'nsIInputStream',
'notflattened': True
},
{
'workers': True,
}],
'Location': {
# NOTE: Before you turn on codegen for Location, make sure all the
# Unforgeable stuff is dealt with.
'nativeType': 'nsIDOMLocation',
'skipGen': True,
'register': False
},
'MediaStreamList': {
'headerFile': 'MediaStreamList.h',
'wrapperCache': False,
'nativeOwnership': 'owned',
'resultNotAddRefed': [ '__indexedGetter' ],
'binaryNames': { '__indexedGetter': 'IndexedGetter' }
},
'MozChannel': [
{
'nativeType': 'nsIChannel',
'notflattened': True
},
{
'workers': True,
}],
'MutationObserver': {
'nativeType': 'nsDOMMutationObserver',
},
'MutationRecord': {
'nativeType': 'nsDOMMutationRecord',
'headerFile': 'nsDOMMutationObserver.h',
'resultNotAddRefed': [ 'target', 'addedNodes', 'removedNodes',
'previousSibling', 'nextSibling' ]
},
'Node': {
'nativeType': 'nsINode',
'concrete': False,
'hasXPConnectImpls': True,
'hasInstanceInterface': 'nsIDOMNode',
'resultNotAddRefed': [ 'ownerDocument', 'parentNode', 'parentElement',
'childNodes', 'firstChild', 'lastChild',
'previousSibling', 'nextSibling', 'insertBefore',
'appendChild', 'replaceChild', 'removeChild',
'attributes' ]
},
'NodeFilter': {
'nativeType': 'nsIDOMNodeFilter',
'headerFile': 'nsIDOMNodeFilter.h',
},
'NodeList': {
'nativeType': 'nsINodeList',
'resultNotAddRefed': [ 'item' ]
},
'PaintRequest': {
'nativeType': 'nsPaintRequest',
'prefable': True
},
'PaintRequestList': {
'nativeType': 'nsPaintRequestList',
'headerFile': 'nsPaintRequest.h',
'resultNotAddRefed': [ 'item' ]
},
'PannerNode': [
{
'resultNotAddRefed': [ 'coneGain', 'distanceGain' ],
'wrapperCache': False
}],
'Performance': {
'nativeType': 'nsPerformance',
'resultNotAddRefed': [ 'timing', 'navigation' ]
},
'PerformanceTiming': {
'nativeType': 'nsPerformanceTiming',
'headerFile': 'nsPerformance.h'
},
'PerformanceNavigation': {
'nativeType': 'nsPerformanceNavigation',
'headerFile': 'nsPerformance.h'
},
'ProcessingInstruction': {
'hasInstanceInterface': 'nsIDOMProcessingInstruction',
},
'PropertyNodeList': {
'headerFile': 'HTMLPropertiesCollection.h',
'resultNotAddRefed': [ 'item' ]
},
'Rect': {
"nativeType": "nsDOMCSSRect",
'resultNotAddRefed': [ "top", "right", "bottom", "left" ]
},
'RGBColor': {
"nativeType": "nsDOMCSSRGBColor",
'resultNotAddRefed': [ "alpha", "blue", "green", "red" ]
},
'Screen': {
'nativeType': 'nsScreen',
'prefable': True,
},
'SVGAElement': {
'hasInstanceInterface': 'nsIDOMSVGAElement',
},
'SVGAnimatedLengthList': {
'nativeType': 'mozilla::DOMSVGAnimatedLengthList',
'headerFile': 'DOMSVGAnimatedLengthList.h'
},
'SVGAnimatedNumberList': {
'nativeType': 'mozilla::DOMSVGAnimatedNumberList',
'headerFile': 'DOMSVGAnimatedNumberList.h'
},
'SVGAnimatedPreserveAspectRatio': {
'nativeType': 'mozilla::dom::DOMSVGAnimatedPreserveAspectRatio',
'headerFile': 'SVGAnimatedPreserveAspectRatio.h'
},
'SVGAnimatedTransformList': {
'nativeType': 'mozilla::DOMSVGAnimatedTransformList',
'headerFile': 'DOMSVGAnimatedTransformList.h'
},
'SVGAnimationElement': {
'resultNotAddRefed': ['targetElement'],
'concrete': False
},
'SVGElement': {
'nativeType': 'nsSVGElement',
'hasXPConnectImpls': True,
'hasInstanceInterface': 'nsIDOMSVGElement',
'resultNotAddRefed': ['ownerSVGElement', 'viewportElement', 'style']
},
'SVGGraphicsElement': {
'concrete': False,
},
'SVGGradientElement': {
'concrete': False,
},
'SVGImageElement': {
'hasInstanceInterface': 'nsIDOMSVGImageElement',
},
'SVGLocatableElement': {
'concrete': False,
'resultNotAddRefed': ['nearestViewportElement', 'farthestViewportElement']
},
'SVGLengthList': {
'nativeType': 'mozilla::DOMSVGLengthList',
'headerFile': 'DOMSVGLengthList.h',
'resultNotAddRefed': [ 'getItem' ]
},
'SVGLinearGradientElement': {
'headerFile': 'mozilla/dom/SVGGradientElement.h',
},
'SVGNumberList': {
'nativeType': 'mozilla::DOMSVGNumberList',
'headerFile': 'DOMSVGNumberList.h',
'resultNotAddRefed': [ 'getItem' ]
},
'SVGPathSeg': {
'nativeType': 'mozilla::DOMSVGPathSeg',
'headerFile': 'DOMSVGPathSeg.h',
'concrete': False,
},
'SVGPathSegClosePath': {
'nativeType': 'mozilla::DOMSVGPathSegClosePath',
'headerFile': 'DOMSVGPathSeg.h'
},
'SVGPathSegMovetoAbs': {
'nativeType': 'mozilla::DOMSVGPathSegMovetoAbs',
'headerFile': 'DOMSVGPathSeg.h'
},
'SVGPathSegMovetoRel': {
'nativeType': 'mozilla::DOMSVGPathSegMovetoRel',
'headerFile': 'DOMSVGPathSeg.h'
},
'SVGPathSegLinetoAbs': {
'nativeType': 'mozilla::DOMSVGPathSegLinetoAbs',
'headerFile': 'DOMSVGPathSeg.h'
},
'SVGPathSegLinetoRel': {
'nativeType': 'mozilla::DOMSVGPathSegLinetoRel',
'headerFile': 'DOMSVGPathSeg.h'
},
'SVGPathSegCurvetoCubicAbs': {
'nativeType': 'mozilla::DOMSVGPathSegCurvetoCubicAbs',
'headerFile': 'DOMSVGPathSeg.h'
},
'SVGPathSegCurvetoCubicRel': {
'nativeType': 'mozilla::DOMSVGPathSegCurvetoCubicRel',
'headerFile': 'DOMSVGPathSeg.h'
},
'SVGPathSegCurvetoQuadraticAbs': {
'nativeType': 'mozilla::DOMSVGPathSegCurvetoQuadraticAbs',
'headerFile': 'DOMSVGPathSeg.h'
},
'SVGPathSegCurvetoQuadraticRel': {
'nativeType': 'mozilla::DOMSVGPathSegCurvetoQuadraticRel',
'headerFile': 'DOMSVGPathSeg.h'
},
'SVGPathSegArcAbs': {
'nativeType': 'mozilla::DOMSVGPathSegArcAbs',
'headerFile': 'DOMSVGPathSeg.h'
},
'SVGPathSegArcRel': {
'nativeType': 'mozilla::DOMSVGPathSegArcRel',
'headerFile': 'DOMSVGPathSeg.h'
},
'SVGPathSegLinetoHorizontalAbs': {
'nativeType': 'mozilla::DOMSVGPathSegLinetoHorizontalAbs',
'headerFile': 'DOMSVGPathSeg.h'
},
'SVGPathSegLinetoHorizontalRel': {
'nativeType': 'mozilla::DOMSVGPathSegLinetoHorizontalRel',
'headerFile': 'DOMSVGPathSeg.h'
},
'SVGPathSegLinetoVerticalAbs': {
'nativeType': 'mozilla::DOMSVGPathSegLinetoVerticalAbs',
'headerFile': 'DOMSVGPathSeg.h'
},
'SVGPathSegLinetoVerticalRel': {
'nativeType': 'mozilla::DOMSVGPathSegLinetoVerticalRel',
'headerFile': 'DOMSVGPathSeg.h'
},
'SVGPathSegCurvetoCubicSmoothAbs': {
'nativeType': 'mozilla::DOMSVGPathSegCurvetoCubicSmoothAbs',
'headerFile': 'DOMSVGPathSeg.h'
},
'SVGPathSegCurvetoCubicSmoothRel': {
'nativeType': 'mozilla::DOMSVGPathSegCurvetoCubicSmoothRel',
'headerFile': 'DOMSVGPathSeg.h'
},
'SVGPathSegCurvetoQuadraticSmoothAbs': {
'nativeType': 'mozilla::DOMSVGPathSegCurvetoQuadraticSmoothAbs',
'headerFile': 'DOMSVGPathSeg.h'
},
'SVGPathSegCurvetoQuadraticSmoothRel': {
'nativeType': 'mozilla::DOMSVGPathSegCurvetoQuadraticSmoothRel',
'headerFile': 'DOMSVGPathSeg.h'
},
'SVGPathSegList': {
'nativeType': 'mozilla::DOMSVGPathSegList',
'headerFile': 'DOMSVGPathSegList.h',
'resultNotAddRefed': [ 'getItem' ]
},
'SVGPoint': {
'nativeType': 'mozilla::nsISVGPoint',
'headerFile': 'nsISVGPoint.h'
},
'SVGPointList': {
'nativeType': 'mozilla::DOMSVGPointList',
'headerFile': 'DOMSVGPointList.h',
'resultNotAddRefed': [ 'getItem' ]
},
'SVGPreserveAspectRatio': {
'nativeType': 'mozilla::dom::DOMSVGPreserveAspectRatio',
'headerFile': 'SVGPreserveAspectRatio.h'
},
'SVGRadialGradientElement': {
'headerFile': 'mozilla/dom/SVGGradientElement.h',
},
'SVGTextContentElement': {
'concrete': False
},
'SVGTextPositioningElement': {
'concrete': False
},
'SVGTitleElement': {
'hasInstanceInterface': 'nsIDOMSVGTitleElement',
},
'SVGTransform': {
'nativeType': 'mozilla::DOMSVGTransform',
'headerFile': 'DOMSVGTransform.h',
'resultNotAddRefed': [ 'matrix' ]
},
'SVGTransformableElement': {
'concrete': False
},
'SVGTransformList': {
'nativeType': 'mozilla::DOMSVGTransformList',
'headerFile': 'DOMSVGTransformList.h',
'resultNotAddRefed': [ 'getItem' ]
},
'SVGSVGElement': {
'resultNotAddRefed': [ 'getElementById' ]
},
'Text': {
'nativeType': 'nsTextNode',
'hasInstanceInterface': 'nsIDOMText',
},
'TextDecoder': [
{
'workers': True,
}],
'TextEncoder': [
{
'implicitJSContext': [ 'encode' ],
},
{
'workers': True,
'implicitJSContext': [ 'encode' ],
}],
'URL' : {
'concrete': False,
},
'WebGLActiveInfo': {
'nativeType': 'mozilla::WebGLActiveInfo',
'headerFile': 'WebGLContext.h',
'wrapperCache': False
},
'WebGLBuffer': {
'nativeType': 'mozilla::WebGLBuffer',
'headerFile': 'WebGLBuffer.h'
},
'WebGLExtensionCompressedTextureATC': {
'nativeType': 'mozilla::WebGLExtensionCompressedTextureATC',
'headerFile': 'WebGLExtensions.h'
},
'WebGLExtensionCompressedTexturePVRTC': {
'nativeType': 'mozilla::WebGLExtensionCompressedTexturePVRTC',
'headerFile': 'WebGLExtensions.h'
},
'WebGLExtensionCompressedTextureS3TC': {
'nativeType': 'mozilla::WebGLExtensionCompressedTextureS3TC',
'headerFile': 'WebGLExtensions.h'
},
'WebGLExtensionDepthTexture': {
'nativeType': 'mozilla::WebGLExtensionDepthTexture',
'headerFile': 'WebGLExtensions.h'
},
'WebGLExtensionDebugRendererInfo': {
'nativeType': 'mozilla::WebGLExtensionDebugRendererInfo',
'headerFile': 'WebGLExtensions.h'
},
'WebGLExtensionLoseContext': {
'nativeType': 'mozilla::WebGLExtensionLoseContext',
'headerFile': 'WebGLExtensions.h'
},
'WebGLExtensionStandardDerivatives': {
'nativeType': 'mozilla::WebGLExtensionStandardDerivatives',
'headerFile': 'WebGLExtensions.h'
},
'WebGLExtensionTextureFilterAnisotropic': {
'nativeType': 'mozilla::WebGLExtensionTextureFilterAnisotropic',
'headerFile': 'WebGLExtensions.h'
},
'WebGLExtensionTextureFloat': {
'nativeType': 'mozilla::WebGLExtensionTextureFloat',
'headerFile': 'WebGLExtensions.h'
},
'WebGLFramebuffer': {
'nativeType': 'mozilla::WebGLFramebuffer',
'headerFile': 'WebGLFramebuffer.h'
},
'WebGLProgram': {
'nativeType': 'mozilla::WebGLProgram',
'headerFile': 'WebGLProgram.h'
},
'WebGLRenderbuffer': {
'nativeType': 'mozilla::WebGLRenderbuffer',
'headerFile': 'WebGLRenderbuffer.h'
},
'WebGLRenderingContext': {
'nativeType': 'mozilla::WebGLContext',
'headerFile': 'WebGLContext.h',
'resultNotAddRefed': [ 'canvas', 'getContextAttributes', 'getExtension',
'getAttachedShaders' ],
'implicitJSContext': [ 'getSupportedExtensions' ],
},
'WebGLShader': {
'nativeType': 'mozilla::WebGLShader',
'headerFile': 'WebGLShader.h'
},
'WebGLShaderPrecisionFormat': {
'nativeType': 'mozilla::WebGLShaderPrecisionFormat',
'headerFile': 'WebGLShaderPrecisionFormat.h',
'wrapperCache': False
},
'WebGLTexture': {
'nativeType': 'mozilla::WebGLTexture',
'headerFile': 'WebGLTexture.h'
},
'WebGLUniformLocation': {
'nativeType': 'mozilla::WebGLUniformLocation',
'headerFile': 'WebGLUniformLocation.h',
'wrapperCache': False
},
'WebSocket': {
'headerFile': 'WebSocket.h',
'implicitJSContext': [ 'constructor' ]
},
'XMLHttpRequest': [
{
'nativeType': 'nsXMLHttpRequest',
'implicitJSContext': [ 'constructor', ],
'resultNotAddRefed': [ 'upload', 'responseXML' ]
},
{
'workers': True,
}],
'XMLHttpRequestEventTarget': [
{
'nativeType': 'nsXHREventTarget',
'headerFile': 'nsXMLHttpRequest.h',
'concrete': False
},
{
'workers': True,
'concrete': False,
}],
'XMLHttpRequestUpload': [
{
'nativeType': 'nsXMLHttpRequestUpload',
'headerFile': 'nsXMLHttpRequest.h'
},
{
'workers': True,
}],
'XMLSerializer': {
'nativeType': 'nsDOMSerializer',
},
'XPathEvaluator': {
'nativeType': 'nsXPathEvaluator',
'headerFile': 'nsXPathEvaluator.h',
'wrapperCache': False
},
'XULElement': {
'nativeType': 'nsXULElement',
'resultNotAddRefed': [ 'controllers', 'style' ],
'hasInstanceInterface': 'nsIDOMXULElement',
},
####################################
# Test Interfaces of various sorts #
####################################
'TestInterface' : {
# Keep this in sync with TestExampleInterface
'headerFile': 'TestBindingHeader.h',
'register': False,
'resultNotAddRefed': [ 'receiveWeakSelf', 'receiveWeakNullableSelf',
'receiveWeakOther', 'receiveWeakNullableOther',
'receiveWeakExternal', 'receiveWeakNullableExternal',
'ReceiveWeakCallbackInterface',
'ReceiveWeakNullableCallbackInterface',
'receiveWeakCastableObjectSequence',
'receiveWeakNullableCastableObjectSequence',
'receiveWeakCastableObjectNullableSequence',
'receiveWeakNullableCastableObjectNullableSequence' ],
'binaryNames': { 'methodRenamedFrom': 'methodRenamedTo',
'attributeGetterRenamedFrom': 'attributeGetterRenamedTo',
'attributeRenamedFrom': 'attributeRenamedTo',
'__stringifier' : 'Stringify' }
},
'TestChildInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False,
},
'TestNonCastableInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False,
'castable': False
},
'TestExternalInterface' : {
'nativeType': 'mozilla::dom::TestExternalInterface',
'headerFile': 'TestBindingHeader.h',
'register': False
},
'TestNonWrapperCacheInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False,
'wrapperCache': False
},
'IndirectlyImplementedInterface': {
'headerFile': 'TestBindingHeader.h',
'register': False,
'castable': False,
'concrete': False
},
'OnlyForUseInConstructor' : {
'headerFile': 'TestBindingHeader.h',
'register': False
},
'TestIndexedGetterInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False
},
'TestNamedGetterInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False
},
'TestIndexedGetterAndSetterAndNamedGetterInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False
},
'TestIndexedAndNamedGetterInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False
},
'TestIndexedSetterInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False
},
'TestNamedSetterInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False
},
'TestIndexedAndNamedSetterInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False
},
'TestIndexedAndNamedGetterAndSetterInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False,
'binaryNames': { '__stringifier': 'Stringify' }
},
'TestRenamedInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False,
'nativeType': 'nsRenamedInterface'
},
'TestIndexedDeleterInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False
},
'TestIndexedDeleterWithRetvalInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False
},
'TestNamedDeleterInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False
},
'TestNamedDeleterWithRetvalInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False
},
'TestIndexedAndNamedDeleterInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False
},
'TestCppKeywordNamedMethodsInterface' : {
'headerFile': 'TestBindingHeader.h',
'register': False
},
'TestExampleInterface' : {
# Keep this in sync with TestInterface
'headerFile': 'TestExampleInterface-example.h',
'register': False,
'resultNotAddRefed': [ 'receiveWeakSelf', 'receiveWeakNullableSelf',
'receiveWeakOther', 'receiveWeakNullableOther',
'receiveWeakExternal', 'receiveWeakNullableExternal',
'ReceiveWeakCallbackInterface',
'ReceiveWeakNullableCallbackInterface',
'receiveWeakCastableObjectSequence',
'receiveWeakNullableCastableObjectSequence',
'receiveWeakCastableObjectNullableSequence',
'receiveWeakNullableCastableObjectNullableSequence' ],
'binaryNames': { 'methodRenamedFrom': 'methodRenamedTo',
'attributeGetterRenamedFrom': 'attributeGetterRenamedTo',
'attributeRenamedFrom': 'attributeRenamedTo' }
},
'TestExampleProxyInterface' : {
'headerFile': 'TestExampleProxyInterface-example.h',
'register': False
}
}
# These are temporary, until they've been converted to use new DOM bindings
def addExternalIface(iface, nativeType=None, headerFile=None,
notflattened=False):
if iface in DOMInterfaces:
raise Exception('Interface declared both as WebIDL and External interface')
domInterface = {
'concrete': False
}
if not nativeType is None:
domInterface['nativeType'] = nativeType
if not headerFile is None:
domInterface['headerFile'] = headerFile
domInterface['notflattened'] = notflattened
DOMInterfaces[iface] = domInterface
# If you add one of these, you need to make sure nsDOMQS.h has the relevant
# macros added for it
def addExternalHTMLElement(element):
nativeElement = 'ns' + element
addExternalIface(element, nativeType=nativeElement,
headerFile=nativeElement + '.h')
addExternalHTMLElement('HTMLFormElement')
addExternalHTMLElement('HTMLMenuElement')
addExternalHTMLElement('HTMLOptionElement')
addExternalHTMLElement('HTMLOptGroupElement')
addExternalHTMLElement('HTMLVideoElement')
addExternalIface('Attr')
addExternalIface('CanvasGradient', headerFile='nsIDOMCanvasRenderingContext2D.h')
addExternalIface('CanvasPattern', headerFile='nsIDOMCanvasRenderingContext2D.h')
addExternalIface('ClientRect')
addExternalIface("Counter")
addExternalIface('CSSRule')
addExternalIface('DOMRequest')
addExternalIface('DOMStringList')
addExternalIface('File')
addExternalIface('HitRegionOptions', nativeType='nsISupports')
addExternalIface('HTMLHeadElement', nativeType='mozilla::dom::Element')
addExternalIface('HTMLCanvasElement', nativeType='mozilla::dom::HTMLCanvasElement')
addExternalIface('imgINotificationObserver', nativeType='imgINotificationObserver')
addExternalIface('imgIRequest', nativeType='imgIRequest', notflattened=True)
addExternalIface('LockedFile')
addExternalIface('MediaStream')
addExternalIface('MozBoxObject', nativeType='nsIBoxObject')
addExternalIface('MozControllers', nativeType='nsIControllers')
addExternalIface('MozFrameLoader', nativeType='nsIFrameLoader', notflattened=True)
addExternalIface('MozRDFCompositeDataSource', nativeType='nsIRDFCompositeDataSource',
notflattened=True)
addExternalIface('MozRDFResource', nativeType='nsIRDFResource', notflattened=True)
addExternalIface('MozXULTemplateBuilder', nativeType='nsIXULTemplateBuilder')
addExternalIface('NamedNodeMap')
addExternalIface('NodeIterator')
addExternalIface('nsIStreamListener', nativeType='nsIStreamListener', notflattened=True)
addExternalIface('nsISupports', nativeType='nsISupports')
addExternalIface('OutputStream', nativeType='nsIOutputStream',
notflattened=True)
addExternalIface('Principal', nativeType='nsIPrincipal',
headerFile='nsIPrincipal.h', notflattened=True)
addExternalIface('Range', nativeType='nsRange')
addExternalIface('Selection', nativeType='nsISelection')
addExternalIface('StyleSheetList')
addExternalIface('SVGAnimatedEnumeration', headerFile='nsIDOMSVGAnimatedEnum.h')
addExternalIface('SVGAnimatedNumber')
addExternalIface('SVGAnimatedString')
addExternalIface('SVGLength')
addExternalIface('SVGNumber')
addExternalIface('TextMetrics', headerFile='nsIDOMCanvasRenderingContext2D.h')
addExternalIface('TreeWalker')
addExternalIface('Touch', headerFile='nsIDOMTouchEvent.h')
addExternalIface('TouchList', headerFile='nsIDOMTouchEvent.h')
addExternalIface('URI', nativeType='nsIURI', headerFile='nsIURI.h',
notflattened=True)
addExternalIface('UserDataHandler')
addExternalIface('Window')
addExternalIface('WindowProxy', nativeType='nsIDOMWindow')
addExternalIface('XPathResult', nativeType='nsISupports')
addExternalIface('XPathExpression')
addExternalIface('XPathNSResolver')