https://github.com/mozilla/gecko-dev
Raw File
Tip revision: ef57c404ca4faf989202d2b0a223b25f0817abb5 authored by Kannan Vijayan on 17 June 2013, 18:41:32 UTC
Bug 877287 - Disable running JS code when ion compiling. r=bhackett a=akeybl
Tip revision: ef57c40
dom_quickstubs.qsconf
# -*- Mode: Python -*-
# 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/.

name = 'DOM'

# A quick warning:
#
# Attributes or methods that call GetCurrentNativeCallContext must not be
# quick-stubbed, because quick stubs don't generate a native call context.
# qsgen.py has no way of knowing which attributes and methods do this, as it
# looks at interfaces, not implementations.  The symptoms, if you quick-stub
# one of those, can be really weird, because GetCurrentNativeCallContext
# doesn't crash--it may in fact return a plausible wrong answer.

members = [ 
    # dom/interfaces/base
    #
    # Note that many implementations of interfaces in this directory
    # use GetCurrentNativeCallContext, notably:
    #   - nsIDOMCrypto.{generateCRMFRequest,signText}
    #   - nsIDOMLocation.reload
    #   - nsIDOMNSHistory.go
    #   - nsIDOMJSPluginArray.refresh
    #   - nsIDOMWindow.postMessage
    #   - nsIDOMJSWindow.{prompt,setTimeout,setInterval,open,openDialog}
    #
    # (And nsIDOMModalContentWindow.returnValue is an attribute of type
    # nsIVariant, which qsgen.py can't handle.)
    #
    'nsIDOMWindow.name',
    'nsIDOMWindow.parent',
    'nsIDOMWindow.top',
    'nsIDOMWindow.self',
    # Several window properties are magically resolved, including
    # location, _content, navigator, document, and window itself.
    # These do not need quick stubs.
    #'nsIDOMWindow.document',
    'nsIDOMWindow.getSelection',
    'nsIDOMWindow.scrollByLines',
    'nsIDOMWindow.getComputedStyle',
    'nsIDOMWindow.sessionStorage',
    'nsIDOMWindow.localStorage',
    'nsIDOMWindow.onmouseenter',
    'nsIDOMWindow.onmouseleave',
    'nsIDOMWindowPerformance.performance',
    'nsIDOMJSWindow.dump',
    # nsLocationSH has ~ALLOW_PROP_MODS_TO_PROTOTYPE, so don't try.
    #'nsIDOMLocation.hostname',
    #'nsIDOMLocation.href',

    # dom/interfaces/canvas
    #
    # canvas friends
    'nsIDOMTextMetrics.*',
    'nsIDOMCanvasGradient.*',
    'nsIDOMCanvasPattern.*',

    # dom/interfaces/core
    'nsIDOMMozNamedAttrMap.item',
    'nsIDOMMozNamedAttrMap.length',
    'nsIDOMDOMStringList.*',
    'nsIDOMXULDocument.getBoxObjectFor',

    'nsIDOMKeyEvent.*',
    'nsIDOMMutationEvent.*',
    'nsIDOMDragEvent.*',
    'nsIDOMScrollAreaEvent.*',
    'nsIDOMNotifyPaintEvent.*',
    'nsIDOMMessageEvent.*',
    'nsIDOMMouseScrollEvent.*',
    'nsIDOMProgressEvent.lengthComputable',
    'nsIDOMProgressEvent.loaded',
    'nsIDOMProgressEvent.total',
    #XXX Can't quickstub initProgressEvent because it has long long parameters.

    'nsIDOMTouch.*',
    'nsIDOMTouchList.*',
    'nsIDOMTouchEvent.*',

    # dom/interfaces/geolocation - None.

    # dom/interfaces/html
    'nsIDOMHTMLCommandElement.*',
    'nsIDOMHTMLFormElement.elements',
    'nsIDOMHTMLFormElement.name',
    'nsIDOMHTMLFormElement.submit',
    'nsIDOMHTMLFormElement.length',
    'nsIDOMHTMLFormElement.target',
    'nsIDOMHTMLFormElement.action',
    'nsIDOMHTMLIFrameElement.src',
    'nsIDOMHTMLIFrameElement.contentDocument',
    'nsIDOMHTMLIFrameElement.contentWindow',
    'nsIDOMHTMLInputElement.defaultChecked',
    'nsIDOMHTMLInputElement.disabled',
    'nsIDOMHTMLInputElement.select',
    'nsIDOMHTMLInputElement.checked',
    'nsIDOMHTMLInputElement.type',
    'nsIDOMHTMLInputElement.form',
    'nsIDOMHTMLInputElement.src',
    'nsIDOMHTMLInputElement.name',
    'nsIDOMHTMLInputElement.value',
    'nsIDOMHTMLInputElement.files',
    'nsIDOMHTMLInputElement.textLength',
    'nsIDOMHTMLInputElement.selectionStart',
    'nsIDOMHTMLInputElement.selectionEnd',
    'nsIDOMHTMLInputElement.selectionDirection',
    'nsIDOMHTMLInputElement.setSelectionRange',
    'nsIDOMHTMLSelectElement.name',
    'nsIDOMHTMLSelectElement.form',
    'nsIDOMHTMLSelectElement.add',
    'nsIDOMHTMLSelectElement.value',
    'nsIDOMHTMLSelectElement.disabled',
    'nsIDOMHTMLSelectElement.length',
    'nsIDOMHTMLSelectElement.remove',
    'nsIDOMHTMLSelectElement.selectedIndex',
    'nsIDOMHTMLSelectElement.item',
    'nsIDOMHTMLSelectElement.type',
    'nsIDOMHTMLSelectElement.options',
    'nsIDOMHTMLSelectElement.size',
    'nsIDOMHTMLCanvasElement.width',
    'nsIDOMHTMLCanvasElement.height',
    'nsIDOMHTMLCanvasElement.getContext',
    'nsIDOMHTMLCanvasElement.toDataURL',

    # dom/interfaces/json - None.
    # All methods of nsIJSON call GetCurrentNativeCallContext.

    # dom/interfaces/offline - None.

    # dom/interfaces/range
    'nsIDOMRange.*',

    # dom/interfaces/sidebar - None.

    # dom/interfaces/smil - None.

    # dom/interfaces/storage
    'nsIDOMToString.toString',
    'nsIDOMStorage.setItem',
    'nsIDOMStorage.length',
    'nsIDOMStorage.getItem',
    'nsIDOMStorage.key',
    'nsIDOMStorage.removeItem',
    'nsIDOMStorage.clear',
    'nsIDOMStorageItem.value',

    # dom/interfaces/stylesheets - None.

    # dom/interfaces/svg - None.

    # dom/interfaces/traversal

    # dom/interfaces/xbl - None.

    # dom/interfaces/xpath
    'nsIDOMXPathExpression.evaluate',
    'nsIDOMXPathNSResolver.lookupNamespaceURI',
    'nsIDOMXPathResult.snapshotItem',
    'nsIDOMXPathResult.iterateNext',
    'nsIDOMXPathResult.snapshotLength',
    'nsIDOMXPathResult.resultType',
    'nsIDOMXPathResult.numberValue',
    'nsIDOMXPathResult.stringValue',
    'nsIDOMXPathResult.booleanValue',
    'nsIDOMXPathResult.singleNodeValue',
    'nsIDOMNSXPathExpression.evaluateWithContext',

    # layout/xul/base/public
    'nsIBoxObject.x',
    'nsIBoxObject.y',
    'nsIBoxObject.screenX',
    'nsIBoxObject.screenY',
    'nsIBoxObject.width',
    'nsIBoxObject.height',

    # FileReader
    'nsIDOMFileReader.*',
    
    # Audio
    'nsIDOMNotifyAudioAvailableEvent.frameBuffer',
    'nsIDOMNotifyAudioAvailableEvent.time',
    'nsIDOMHTMLAudioElement.mozWriteAudio',

    # dom/indexedDB
    'nsIIDBCursor.*',
    'nsIIDBCursorWithValue.*',
    'nsIIDBDatabase.*',
    'nsIIDBFileHandle.*',
    'nsIIDBIndex.*',
    'nsIIDBKeyRange.*',
    'nsIIDBObjectStore.*',
    'nsIIDBRequest.*',
    'nsIIDBTransaction.*',
    'nsIIDBOpenDBRequest.*',
    'nsIIDBVersionChangeEvent.*',
    'nsIIndexedDatabaseManager.*',

    'nsIDOMDOMError.*',

    # dom/file
    'nsIDOMLockedFile.*',

    # dom/quota
    'nsIQuotaManager.*',
    'nsIQuotaRequest.*',
    'nsIUsageCallback.*',
    ]

# Most interfaces can be found by searching the includePath; to find
# nsIDOMEvent, for example, just look for nsIDOMEvent.idl.  But IDL filenames
# for very long interface names are slightly abbreviated, and many interfaces
# don't have their own files, just for extra wackiness.  So qsgen.py needs
# a little help.
#
irregularFilenames = {
    # stowaways
    'nsIDOMTextMetrics': 'nsIDOMCanvasRenderingContext2D',
    'nsIDOMCanvasGradient': 'nsIDOMCanvasRenderingContext2D',
    'nsIDOMCanvasPattern': 'nsIDOMCanvasRenderingContext2D',

    'nsIDOMBlob': 'nsIDOMFile',

    'nsIIndexedDatabaseUsageCallback': 'nsIIndexedDatabaseManager',

    'nsIDOMTouch': 'nsIDOMTouchEvent',
    'nsIDOMTouchList': 'nsIDOMTouchEvent',

    'nsITelephoneCallback': 'nsITelephone',

    'nsIDOMWindowPerformance': 'nsIDOMWindow',
    }

customIncludes = [
    'nsDOMQS.h',
    'mozilla/dom/NodeBinding.h',
    'mozilla/dom/ElementBinding.h',
    'mozilla/dom/HTMLElementBinding.h',
    'mozilla/dom/DocumentBinding.h',
    'nsPerformance.h',
    'mozilla/dom/HTMLDocumentBinding.h',
    'mozilla/dom/EventTargetBinding.h',
    'mozilla/dom/EventBinding.h',
    'mozilla/dom/MouseEventBinding.h',
    'mozilla/dom/UIEventBinding.h',
    ]

customReturnInterfaces = [
    'nsIDOMCanvasPattern',
    'nsIDOMCanvasGradient',
    ]

nsIDOMStorage_Clear_customMethodCallCode = """
    rv = self->Clear();
    if (NS_SUCCEEDED(rv))
        JS_ClearNonGlobalObject(cx, obj);
"""

customMethodCalls = {
    'nsIDOMStorage_Clear': {
        'code': nsIDOMStorage_Clear_customMethodCallCode
        },
    'nsIDOMWindow_GetOnmouseenter' : {
        'thisType' : 'nsIDOMWindow',
        'unwrapThisFailureFatal' : False
        },
    'nsIDOMWindow_SetOnmouseenter' : {
        'thisType' : 'nsIDOMWindow',
        'unwrapThisFailureFatal' : False
        },
    'nsIDOMWindow_GetOnmouseleave' : {
        'thisType' : 'nsIDOMWindow',
        'unwrapThisFailureFatal' : False
        },
    'nsIDOMWindow_SetOnmouseleave' : {
        'thisType' : 'nsIDOMWindow',
        'unwrapThisFailureFatal' : False
        },
    'nsIDOMWindowPerformance_GetPerformance' : {
        'thisType': 'nsPIDOMWindow',
        'code' : '    nsPerformance* result = self->GetPerformance();\n',
        'canFail': False,
        },
    }

newBindingProperties = {
    'nsIDOMNode': 'mozilla::dom::NodeBinding::sNativePropertyHooks.mNativeProperties.regular',
    'nsIDOMElement': 'mozilla::dom::ElementBinding::sNativePropertyHooks.mNativeProperties.regular',
    'nsIDOMHTMLElement': 'mozilla::dom::HTMLElementBinding::sNativePropertyHooks.mNativeProperties.regular',
    'nsIDOMDocument': 'mozilla::dom::DocumentBinding::sNativePropertyHooks.mNativeProperties.regular',
    'nsIDOMHTMLDocument': 'mozilla::dom::HTMLDocumentBinding::sNativePropertyHooks.mNativeProperties.regular',
    'nsIDOMEventTarget': 'mozilla::dom::EventTargetBinding::sNativePropertyHooks.mNativeProperties.regular',
    'nsIDOMEvent': 'mozilla::dom::EventBinding::sNativePropertyHooks.mNativeProperties.regular',
    'nsIDOMMouseEvent': 'mozilla::dom::MouseEventBinding::sNativePropertyHooks.mNativeProperties.regular',
    'nsIDOMUIEvent': 'mozilla::dom::UIEventBinding::sNativePropertyHooks.mNativeProperties.regular',
    }
back to top