2012-05-21 04:12:37 -07:00
|
|
|
# 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/.
|
|
|
|
|
2012-03-30 21:42:20 -07:00
|
|
|
# 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 (required).
|
|
|
|
# * 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).
|
|
|
|
# * concrete - Indicates whether there exist objects with this interface as
|
|
|
|
# their primary interface (defaults to True).
|
|
|
|
# * prefable - Indicates whether this binding is subject to the about:config
|
|
|
|
# pref, or whether it's always enabled (defaults to False).
|
|
|
|
# * 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.
|
2012-05-23 09:44:48 -07:00
|
|
|
# * register - True if this binding should be registered. Defaults to true.
|
2012-05-18 14:25:47 -07:00
|
|
|
# * 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.
|
2012-03-30 21:42:20 -07:00
|
|
|
#
|
|
|
|
# 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
|
|
|
|
#
|
|
|
|
# * infallible - attributes and methods specified in the .webidl file that
|
|
|
|
# cannot fail and therefore do not require the final nsresult&
|
|
|
|
# argument
|
|
|
|
# * 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
|
|
|
|
|
|
|
|
DOMInterfaces = {
|
|
|
|
|
2012-05-10 12:24:59 -07:00
|
|
|
'Blob': [
|
2012-03-30 21:42:20 -07:00
|
|
|
{
|
2012-05-10 12:24:59 -07:00
|
|
|
'nativeType': 'nsIDOMBlob',
|
|
|
|
'headerFile': 'nsIDOMFile.h',
|
2012-03-30 21:42:20 -07:00
|
|
|
'prefable': True,
|
2012-05-10 12:24:59 -07:00
|
|
|
'castable': False
|
2012-03-30 21:42:20 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'workers': True,
|
2012-05-10 12:24:59 -07:00
|
|
|
'nativeType': 'JSObject',
|
|
|
|
'headerFile': 'jsapi.h',
|
|
|
|
'castable': False
|
2012-03-30 21:42:20 -07:00
|
|
|
}],
|
|
|
|
|
2012-05-10 12:24:59 -07:00
|
|
|
'Document': [
|
2012-03-30 21:42:20 -07:00
|
|
|
{
|
2012-05-10 12:24:59 -07:00
|
|
|
'nativeType': 'nsIDocument',
|
|
|
|
'prefable': True,
|
|
|
|
'castable': False
|
2012-03-30 21:42:20 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'workers': True,
|
2012-05-10 12:24:59 -07:00
|
|
|
'nativeType': 'JSObject',
|
|
|
|
'headerFile': 'jsapi.h',
|
|
|
|
'castable': False
|
2012-03-30 21:42:20 -07:00
|
|
|
}],
|
|
|
|
|
2012-05-10 12:24:59 -07:00
|
|
|
'Event': [
|
2012-03-30 21:42:20 -07:00
|
|
|
{
|
2012-05-10 12:24:59 -07:00
|
|
|
'nativeType': 'nsIDOMEvent',
|
2012-03-30 21:42:20 -07:00
|
|
|
'prefable': True,
|
2012-05-10 12:24:59 -07:00
|
|
|
'castable': False
|
2012-03-30 21:42:20 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'workers': True,
|
|
|
|
'nativeType': 'JSObject',
|
|
|
|
'headerFile': 'jsapi.h',
|
|
|
|
'castable': False
|
|
|
|
}],
|
|
|
|
|
2012-05-10 12:24:59 -07:00
|
|
|
'EventListener': [
|
2012-03-30 21:42:20 -07:00
|
|
|
{
|
2012-05-10 12:24:59 -07:00
|
|
|
'nativeType': 'nsIDOMEventListener',
|
|
|
|
'prefable': True
|
2012-03-30 21:42:20 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'workers': True,
|
|
|
|
'nativeType': 'JSObject',
|
2012-05-10 12:24:59 -07:00
|
|
|
'headerFile': 'jsapi.h'
|
2012-03-30 21:42:20 -07:00
|
|
|
}],
|
|
|
|
|
2012-05-10 12:24:59 -07:00
|
|
|
'EventTarget': [
|
2012-03-30 21:42:20 -07:00
|
|
|
{
|
2012-05-10 12:24:59 -07:00
|
|
|
'nativeType': 'nsDOMEventTargetHelper',
|
|
|
|
'hasInstanceInterface': 'nsIDOMEventTarget',
|
|
|
|
'concrete': False,
|
2012-03-30 21:42:20 -07:00
|
|
|
'prefable': True,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'workers': True,
|
2012-05-10 12:24:59 -07:00
|
|
|
'nativeType': 'mozilla::dom::workers::EventTarget',
|
|
|
|
'headerFile': 'mozilla/dom/workers/bindings/EventTarget.h',
|
|
|
|
'concrete': False
|
2012-03-30 21:42:20 -07:00
|
|
|
}],
|
|
|
|
|
2012-05-10 12:24:59 -07:00
|
|
|
'FormData': [
|
2012-03-30 21:42:20 -07:00
|
|
|
{
|
2012-05-10 12:24:59 -07:00
|
|
|
'nativeType': 'nsIDOMFormData',
|
2012-03-30 21:42:20 -07:00
|
|
|
'prefable': True,
|
|
|
|
'castable': False
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'workers': True,
|
|
|
|
'nativeType': 'JSObject',
|
|
|
|
'headerFile': 'jsapi.h',
|
|
|
|
'castable': False
|
|
|
|
}],
|
|
|
|
|
2012-05-10 12:24:59 -07:00
|
|
|
'IID': [
|
2012-03-30 21:42:20 -07:00
|
|
|
{
|
2012-05-10 12:24:59 -07:00
|
|
|
'nativeType': 'nsIJSIID',
|
|
|
|
'headerFile': 'xpcjsid.h',
|
2012-03-30 21:42:20 -07:00
|
|
|
'prefable': True,
|
|
|
|
'castable': False
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'workers': True,
|
|
|
|
'nativeType': 'JSObject',
|
|
|
|
'headerFile': 'jsapi.h',
|
|
|
|
'castable': False
|
|
|
|
}],
|
|
|
|
|
2012-05-10 12:24:59 -07:00
|
|
|
'InputStream': [
|
2012-03-30 21:42:20 -07:00
|
|
|
{
|
2012-05-10 12:24:59 -07:00
|
|
|
'nativeType': 'nsIInputStream',
|
2012-03-30 21:42:20 -07:00
|
|
|
'prefable': True,
|
2012-05-10 12:24:59 -07:00
|
|
|
'castable': False,
|
|
|
|
'notflattened': True
|
2012-03-30 21:42:20 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'workers': True,
|
2012-05-10 12:24:59 -07:00
|
|
|
'nativeType': 'JSObject',
|
|
|
|
'headerFile': 'jsapi.h',
|
|
|
|
'castable': False
|
2012-03-30 21:42:20 -07:00
|
|
|
}],
|
|
|
|
|
2012-05-10 12:24:59 -07:00
|
|
|
'MozChannel': [
|
2012-03-30 21:42:20 -07:00
|
|
|
{
|
2012-05-10 12:24:59 -07:00
|
|
|
'nativeType': 'nsIChannel',
|
2012-03-30 21:42:20 -07:00
|
|
|
'prefable': True,
|
2012-05-10 12:24:59 -07:00
|
|
|
'castable': False,
|
|
|
|
'notflattened': True
|
2012-03-30 21:42:20 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'workers': True,
|
|
|
|
'nativeType': 'JSObject',
|
|
|
|
'headerFile': 'jsapi.h',
|
|
|
|
'castable': False
|
|
|
|
}],
|
|
|
|
|
2012-05-31 11:16:48 -07:00
|
|
|
'WebGLRenderingContext': {
|
|
|
|
'nativeType': 'mozilla::WebGLContext',
|
|
|
|
'prefable': True,
|
|
|
|
'resultNotAddRefed': [ 'canvas', 'getContextAttributes', 'getExtension',
|
|
|
|
'getAttachedShaders' ],
|
|
|
|
'implicitJSContext': [ 'texImage2D', 'texSubImage2D' ],
|
|
|
|
'infallible': [ 'canvas', 'drawingBufferWidth', 'drawingBufferHeight',
|
|
|
|
'isContextLost', 'getSupportedExtensions',
|
|
|
|
'getExtension', 'activeTexture',
|
|
|
|
'attachShader', 'bindAttribLocation', 'bindBuffer',
|
|
|
|
'bindFramebuffer', 'bindRenderbuffer', 'bindTexture',
|
|
|
|
'blendColor', 'blendEquation', 'blendEquationSeparate',
|
|
|
|
'blendFunc', 'blendFuncSeparate', 'bufferData',
|
|
|
|
'bufferSubData', 'checkFramebufferStatus',
|
|
|
|
'clear', 'clearColor', 'clearDepth', 'clearStencil',
|
|
|
|
'colorMask', 'compileShader', 'compressedTexImage2D',
|
|
|
|
'compressedTexSubImage2D', 'copyTexImage2D',
|
|
|
|
'copyTexSubImage2D', 'createBuffer', 'createFramebuffer',
|
|
|
|
'createProgram', 'createRenderbuffer', 'createShader',
|
|
|
|
'createTexture', 'cullFace', 'deleteBuffer',
|
|
|
|
'deleteFramebuffer', 'deleteProgram', 'deleteRenderbuffer',
|
|
|
|
'deleteShader', 'deleteTexture', 'depthFunc', 'depthMask',
|
|
|
|
'depthRange', 'detachShader', 'disable',
|
|
|
|
'disableVertexAttribArray', 'drawArrays', 'drawElements',
|
|
|
|
'enable', 'enableVertexAttribArray', 'finish', 'flush',
|
|
|
|
'framebufferRenderbuffer', 'framebufferTexture2D',
|
|
|
|
'frontFace', 'generateMipmap', 'getActiveAttrib',
|
|
|
|
'getActiveUniform', 'getAttachedShaders', 'getAttribLocation',
|
|
|
|
'getBufferParameter', 'getError', 'getProgramParameter',
|
|
|
|
'getRenderbufferParameter', 'getShaderParameter',
|
|
|
|
'getShaderPrecisionFormat', 'getShaderSource',
|
|
|
|
'getTexParameter', 'getUniformLocation',
|
|
|
|
'getVertexAttribOffset', 'hint', 'isBuffer',
|
|
|
|
'isEnabled', 'isFramebuffer', 'isProgram', 'isRenderbuffer',
|
|
|
|
'isShader', 'isTexture', 'lineWidth', 'pixelStorei',
|
|
|
|
'polygonOffset', 'renderbufferStorage', 'sampleCoverage',
|
|
|
|
'scissor', 'shaderSource', 'stencilFunc',
|
|
|
|
'stencilFuncSeparate', 'stencilMask', 'stencilMaskSeparate',
|
|
|
|
'stencilOp', 'stencilOpSeparate', 'texParameterf',
|
|
|
|
'texParameteri', 'uniform1f', 'uniform1fv', 'uniform1i',
|
|
|
|
'uniform1iv', 'uniform2f', 'uniform2fv', 'uniform2i',
|
|
|
|
'uniform2iv', 'uniform3f', 'uniform3fv', 'uniform3i',
|
|
|
|
'uniform3iv', 'uniform4f', 'uniform4fv', 'uniform4i',
|
|
|
|
'uniform4iv', 'uniformMatrix2fv', 'uniformMatrix3fv',
|
|
|
|
'uniformMatrix4fv', 'useProgram', 'validateProgram',
|
|
|
|
'vertexAttrib1f', 'vertexAttrib1fv', 'vertexAttrib2f',
|
|
|
|
'vertexAttrib2fv', 'vertexAttrib3f', 'vertexAttrib3fv',
|
|
|
|
'vertexAttrib4f', 'vertexAttrib4fv', 'vertexAttribPointer',
|
|
|
|
'viewport'
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
2012-05-10 12:24:59 -07:00
|
|
|
'XMLHttpRequest': [
|
2012-03-30 21:42:20 -07:00
|
|
|
{
|
2012-05-10 12:24:59 -07:00
|
|
|
'nativeType': 'nsXMLHttpRequest',
|
|
|
|
'prefable': True,
|
|
|
|
'infallible': {
|
|
|
|
'all': [
|
|
|
|
'readyState', 'withCredentials', 'abort', 'statusText',
|
|
|
|
'getAllResponseHeaders', 'overrideMimeType', 'mozBackgroundRequest',
|
2012-06-07 11:28:33 -07:00
|
|
|
'multipart', 'channel', 'upload', 'status', 'mozAnon', 'mozSystem'
|
2012-05-10 12:24:59 -07:00
|
|
|
],
|
|
|
|
'getterOnly': [
|
2012-06-04 18:29:56 -07:00
|
|
|
'responseType', 'timeout', 'onreadystatechange', 'onuploadprogress'
|
2012-05-10 12:24:59 -07:00
|
|
|
]
|
|
|
|
},
|
2012-05-31 11:16:48 -07:00
|
|
|
# XXXbz need a JSContext for send() and sendAsBinary because of
|
|
|
|
# the old nsIVariant-based signatures which actually use it for
|
2012-06-07 11:28:33 -07:00
|
|
|
# typed arrays. Once those go away, we can nuke them from this
|
|
|
|
# list.
|
|
|
|
'implicitJSContext': [ 'constructor', 'send', 'sendAsBinary' ],
|
2012-05-10 12:24:59 -07:00
|
|
|
'resultNotAddRefed': [ 'upload', 'responseXML' ]
|
2012-03-30 21:42:20 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'workers': True,
|
2012-05-10 12:24:59 -07:00
|
|
|
'nativeType': 'mozilla::dom::workers::XMLHttpRequest',
|
|
|
|
'headerFile': 'mozilla/dom/workers/bindings/XMLHttpRequest.h',
|
|
|
|
'infallible': {
|
2012-06-07 11:28:33 -07:00
|
|
|
'all': ['readyState', 'statusText', 'mozAnon', 'mozSystem' ],
|
2012-05-10 12:24:59 -07:00
|
|
|
'getterOnly': [ 'timeout', 'withCredentials', 'mozBackgroundRequest',
|
|
|
|
'responseType', 'responseXML', 'channel', 'multipart' ]
|
|
|
|
}
|
|
|
|
|
2012-03-30 21:42:20 -07:00
|
|
|
}],
|
|
|
|
|
|
|
|
'XMLHttpRequestEventTarget': [
|
|
|
|
{
|
|
|
|
'nativeType': 'nsXHREventTarget',
|
|
|
|
'headerFile': 'nsXMLHttpRequest.h',
|
|
|
|
'concrete': False,
|
|
|
|
'prefable': True,
|
|
|
|
'infallible': {
|
|
|
|
'getterOnly': [
|
|
|
|
'onabort', 'onerror', 'onload', 'onloadstart', 'onprogress',
|
|
|
|
'ontimeout', 'onloadend'
|
|
|
|
]
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'workers': True,
|
|
|
|
'concrete': False,
|
|
|
|
'nativeType': 'mozilla::dom::workers::XMLHttpRequestEventTarget',
|
|
|
|
'headerFile': 'mozilla/dom/workers/bindings/XMLHttpRequestEventTarget.h'
|
|
|
|
}],
|
|
|
|
|
2012-05-10 12:24:59 -07:00
|
|
|
'XMLHttpRequestUpload': [
|
2012-03-30 21:42:20 -07:00
|
|
|
{
|
2012-05-10 12:24:59 -07:00
|
|
|
'nativeType': 'nsXMLHttpRequestUpload',
|
|
|
|
'headerFile': 'nsXMLHttpRequest.h',
|
|
|
|
'prefable': True
|
2012-03-30 21:42:20 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'workers': True,
|
2012-05-10 12:24:59 -07:00
|
|
|
'nativeType': 'mozilla::dom::workers::XMLHttpRequestUpload',
|
|
|
|
'headerFile': 'mozilla/dom/workers/bindings/XMLHttpRequestUpload.h'
|
2012-03-30 21:42:20 -07:00
|
|
|
}],
|
|
|
|
|
2012-05-23 09:44:48 -07:00
|
|
|
####################################
|
|
|
|
# Test Interfaces of various sorts #
|
|
|
|
####################################
|
|
|
|
|
|
|
|
'TestInterface' : {
|
|
|
|
'nativeType': 'mozilla::dom::TestInterface',
|
|
|
|
'headerFile': 'TestBindingHeader.h',
|
2012-05-23 09:44:48 -07:00
|
|
|
'register': False,
|
2012-05-24 22:08:26 -07:00
|
|
|
'resultNotAddRefed': [ 'receiveWeakSelf', 'receiveWeakNullableSelf',
|
|
|
|
'receiveWeakCastableObjectSequence',
|
|
|
|
'receiveWeakNullableCastableObjectSequence',
|
|
|
|
'receiveWeakCastableObjectNullableSequence',
|
2012-05-18 14:25:47 -07:00
|
|
|
'receiveWeakNullableCastableObjectNullableSequence' ],
|
|
|
|
'binaryNames': { 'methodRenamedFrom': 'methodRenamedTo',
|
|
|
|
'attributeGetterRenamedFrom': 'attributeGetterRenamedTo',
|
|
|
|
'attributeRenamedFrom': 'attributeRenamedTo' }
|
2012-05-29 20:45:18 -07:00
|
|
|
},
|
|
|
|
|
|
|
|
'TestNonCastableInterface' : {
|
|
|
|
'nativeType': 'mozilla::dom::TestNonCastableInterface',
|
|
|
|
'headerFile': 'TestBindingHeader.h',
|
|
|
|
'register': False,
|
|
|
|
'castable': False
|
|
|
|
},
|
|
|
|
|
|
|
|
'TestExternalInterface' : {
|
|
|
|
'nativeType': 'mozilla::dom::TestExternalInterface',
|
|
|
|
'headerFile': 'TestBindingHeader.h',
|
|
|
|
'register': False,
|
|
|
|
'castable': False
|
|
|
|
},
|
|
|
|
|
2012-03-30 21:42:20 -07:00
|
|
|
}
|
2012-05-31 11:16:48 -07:00
|
|
|
|
|
|
|
# These are temporary, until they've been converted to use new DOM bindings
|
|
|
|
def addExternalIface(iface, nativeType=None, headerFile=None):
|
|
|
|
if nativeType is None:
|
|
|
|
nativeType = 'nsIDOM' + iface
|
|
|
|
domInterface = {
|
|
|
|
'nativeType': nativeType,
|
|
|
|
'concrete': False,
|
|
|
|
'castable': False
|
|
|
|
}
|
|
|
|
if not headerFile is None:
|
|
|
|
domInterface['headerFile'] = headerFile
|
|
|
|
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('HTMLCanvasElement')
|
|
|
|
addExternalHTMLElement('HTMLImageElement')
|
|
|
|
addExternalHTMLElement('HTMLVideoElement')
|
|
|
|
addExternalIface('ImageData', nativeType='mozilla::dom::ImageData',
|
|
|
|
headerFile='mozilla/dom/ImageData.h')
|
|
|
|
addExternalIface('WebGLActiveInfo', nativeType='mozilla::WebGLActiveInfo',
|
|
|
|
headerFile='WebGLContext.h')
|
|
|
|
addExternalIface('WebGLBuffer', nativeType='mozilla::WebGLBuffer',
|
|
|
|
headerFile='WebGLContext.h')
|
|
|
|
addExternalIface('WebGLContextAttributes', nativeType='JSObject',
|
|
|
|
headerFile='jsapi.h')
|
|
|
|
addExternalIface('WebGLExtension', nativeType='nsIWebGLExtension',
|
|
|
|
headerFile='WebGLContext.h')
|
|
|
|
addExternalIface('WebGLFramebuffer', nativeType='mozilla::WebGLFramebuffer',
|
|
|
|
headerFile='WebGLContext.h')
|
|
|
|
addExternalIface('WebGLProgram', nativeType='mozilla::WebGLProgram',
|
|
|
|
headerFile='WebGLContext.h')
|
|
|
|
addExternalIface('WebGLRenderbuffer', nativeType='mozilla::WebGLRenderbuffer',
|
|
|
|
headerFile='WebGLContext.h')
|
|
|
|
addExternalIface('WebGLShader', nativeType='mozilla::WebGLShader',
|
|
|
|
headerFile='WebGLContext.h')
|
|
|
|
addExternalIface('WebGLShaderPrecisionFormat',
|
|
|
|
nativeType='mozilla::WebGLShaderPrecisionFormat',
|
|
|
|
headerFile='WebGLContext.h')
|
|
|
|
addExternalIface('WebGLTexture', nativeType='mozilla::WebGLTexture',
|
|
|
|
headerFile='WebGLContext.h')
|
|
|
|
addExternalIface('WebGLUniformLocation',
|
|
|
|
nativeType='mozilla::WebGLUniformLocation',
|
|
|
|
headerFile='WebGLContext.h')
|