Backed out 6 changesets (bug 814821, bug 815158, bug 814195) for test failures

Backed out changeset 0c2011091748 (bug 815158)
Backed out changeset 9d70b4460508 (bug 814195)
Backed out changeset bf8746658a72 (bug 814821)
Backed out changeset e73366b088d7 (bug 814821)
Backed out changeset 49fc6d535c41 (bug 814821)
Backed out changeset 987aea26a43a (bug 814821)
This commit is contained in:
Ehsan Akhgari 2012-11-27 16:30:39 -05:00
parent 39f9b2e5b5
commit d6d6c3d26a
21 changed files with 415 additions and 187 deletions

View File

@ -530,7 +530,7 @@ public:
SetAttr(kNameSpaceID_None, nsGkAtoms::id, aId, true);
}
nsDOMTokenList* GetClassList();
nsDOMTokenList* ClassList();
nsDOMAttributeMap* GetAttributes()
{
nsDOMSlots *slots = DOMSlots();

View File

@ -447,12 +447,12 @@ Element::GetLastElementChild() const
}
nsDOMTokenList*
Element::GetClassList()
Element::ClassList()
{
Element::nsDOMSlots *slots = DOMSlots();
if (!slots->mClassList) {
nsIAtom* classAttr = GetClassAttributeName();
nsCOMPtr<nsIAtom> classAttr = GetClassAttributeName();
if (classAttr) {
slots->mClassList = new nsDOMTokenList(this, classAttr);
}
@ -464,7 +464,7 @@ Element::GetClassList()
void
Element::GetClassList(nsIDOMDOMTokenList** aClassList)
{
NS_IF_ADDREF(*aClassList = GetClassList());
NS_IF_ADDREF(*aClassList = ClassList());
}
already_AddRefed<nsIHTMLCollection>

View File

@ -260,7 +260,7 @@ public:
virtual ~nsContentList();
// nsWrapperCache
using nsWrapperCache::GetWrapperPreserveColor;
using nsWrapperCache::GetWrapper;
virtual JSObject* WrapObject(JSContext *cx, JSObject *scope,
bool *triedToWrap);

View File

@ -2311,7 +2311,11 @@ nsINode::QuerySelectorAll(const nsAString& aSelector, ErrorResult& aResult)
JSObject*
nsINode::WrapObject(JSContext *aCx, JSObject *aScope, bool *aTriedToWrap)
{
MOZ_ASSERT(IsDOMBinding());
// Not all nodes have been converted
if (!IsDOMBinding()) {
*aTriedToWrap = false;
return nullptr;
}
// Make sure one of these is true
// (1) our owner document has a script handling object,

View File

@ -70,11 +70,11 @@ public:
virtual void GetSupportedNames(nsTArray<nsString>& aNames) = 0;
JSObject* GetWrapperPreserveColor()
JSObject* GetWrapper()
{
nsWrapperCache* cache;
CallQueryInterface(this, &cache);
return cache->GetWrapperPreserveColor();
return cache->GetWrapper();
}
virtual JSObject* WrapObject(JSContext *cx, JSObject *scope,
bool *triedToWrap) = 0;

View File

@ -58,7 +58,7 @@ public:
HTMLPropertiesCollection(nsGenericHTMLElement* aRoot);
virtual ~HTMLPropertiesCollection();
using nsWrapperCache::GetWrapperPreserveColor;
using nsWrapperCache::GetWrapper;
virtual JSObject* WrapObject(JSContext *cx, JSObject *scope,
bool *triedToWrap);

View File

@ -100,7 +100,6 @@
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/ErrorResult.h"
#include "nsHTMLDocument.h"
#include "nsDOMTouchEvent.h"
using namespace mozilla;
using namespace mozilla::dom;
@ -2907,24 +2906,6 @@ nsGenericHTMLElement::IsLabelable() const
Tag() == nsGkAtoms::meter;
}
// static
bool
nsGenericHTMLElement::PrefEnabled()
{
// This is a bit of a hack because we don't support non-bool prefs to enable
// properties. This function will be called every time a HTMLElement interface
// prototype object is created. The first time this is called we set a boolean
// pref (dom.w3c_touch_events.expose) which controls the touch event
// properties on HTMLElement.
static bool sDidSetPref = false;
if (!sDidSetPref) {
sDidSetPref = true;
Preferences::SetBool("dom.w3c_touch_events.expose",
nsDOMTouchEvent::PrefEnabled());
}
return true;
}
//----------------------------------------------------------------------
nsGenericHTMLFormElement::nsGenericHTMLFormElement(already_AddRefed<nsINodeInfo> aNodeInfo)

View File

@ -715,8 +715,6 @@ public:
virtual bool IsLabelable() const;
static bool PrefEnabled();
protected:
/**
* Add/remove this element to the documents name cache

View File

@ -48,9 +48,9 @@ function reflectString(aParameters)
* specifications, don't add it to the loop below and keep it here.
*/
element.setAttribute(contentAttr, null);
is(element.getAttribute(contentAttr), "null",
todo_is(element.getAttribute(contentAttr), "null",
"null should have been stringified to 'null'");
is(element[idlAttr], "null",
todo_is(element[idlAttr], "null",
"null should have been stringified to 'null'");
element.removeAttribute(contentAttr);
@ -423,8 +423,14 @@ function reflectBoolean(aParameters)
element.setAttribute(contentAttr, v.value);
is(element[idlAttr], true,
"IDL attribute should return always return 'true' if the content attribute has been set");
is(element.getAttribute(contentAttr), v.stringified,
"Content attribute should return the stringified value it has been set to.");
if (v.value === null) {
// bug 667856
todo(element.getAttribute(contentAttr), v.stringified,
"Content attribute should return the stringified value it has been set to.");
} else {
is(element.getAttribute(contentAttr), v.stringified,
"Content attribute should return the stringified value it has been set to.");
}
element.removeAttribute(contentAttr);
element[idlAttr] = v.value;
@ -459,7 +465,7 @@ function reflectInt(aParameters)
{
// Expected value returned by .getAttribute() when |value| has been previously passed to .setAttribute().
function expectedGetAttributeResult(value) {
return String(value);
return (value !== null) ? String(value) : "";
}
function stringToInteger(value, nonNegative, defaultValue) {

View File

@ -453,17 +453,16 @@ CreateInterfaceObjects(JSContext* cx, JSObject* global, JSObject* protoProto,
}
}
bool
NativeInterface2JSObjectAndThrowIfFailed(JSContext* aCx,
JSObject* aScope,
static bool
NativeInterface2JSObjectAndThrowIfFailed(XPCLazyCallContext& aLccx,
JSContext* aCx,
JS::Value* aRetval,
xpcObjectHelper& aHelper,
const nsIID* aIID,
bool aAllowNativeWrapper)
{
nsresult rv;
XPCLazyCallContext lccx(JS_CALLER, aCx, aScope);
if (!XPCConvert::NativeInterface2JSObject(lccx, aRetval, NULL, aHelper, aIID,
if (!XPCConvert::NativeInterface2JSObject(aLccx, aRetval, NULL, aHelper, aIID,
NULL, aAllowNativeWrapper, &rv)) {
// I can't tell if NativeInterface2JSObject throws JS exceptions
// or not. This is a sloppy stab at the right semantics; the
@ -476,6 +475,25 @@ NativeInterface2JSObjectAndThrowIfFailed(JSContext* aCx,
return true;
}
bool
DoHandleNewBindingWrappingFailure(JSContext* cx, JSObject* scope,
nsISupports* value, JS::Value* vp)
{
if (JS_IsExceptionPending(cx)) {
return false;
}
XPCLazyCallContext lccx(JS_CALLER, cx, scope);
if (value) {
xpcObjectHelper helper(value);
return NativeInterface2JSObjectAndThrowIfFailed(lccx, cx, vp, helper, NULL,
true);
}
return Throw<true>(cx, NS_ERROR_XPC_BAD_CONVERT_JS);
}
// Can only be called with the immediate prototype of the instance object. Can
// only be called on the prototype of an object known to be a DOM instance.
JSBool
@ -493,7 +511,9 @@ bool
XPCOMObjectToJsval(JSContext* cx, JSObject* scope, xpcObjectHelper &helper,
const nsIID* iid, bool allowNativeWrapper, JS::Value* rval)
{
if (!NativeInterface2JSObjectAndThrowIfFailed(cx, scope, rval, helper, iid,
XPCLazyCallContext lccx(JS_CALLER, cx, scope);
if (!NativeInterface2JSObjectAndThrowIfFailed(lccx, cx, rval, helper, iid,
allowNativeWrapper)) {
return false;
}

View File

@ -187,7 +187,7 @@ IsDOMObject(JSObject* obj)
// of thing it's looking at).
// U must be something that a T* can be assigned to (e.g. T* or an nsRefPtr<T>).
template <prototypes::ID PrototypeID, class T, typename U>
MOZ_ALWAYS_INLINE nsresult
inline nsresult
UnwrapObject(JSContext* cx, JSObject* obj, U& value)
{
/* First check to see whether we have a DOM object */
@ -497,23 +497,9 @@ CheckWrapperCacheCast<T, true>
};
#endif
MOZ_ALWAYS_INLINE bool
CouldBeDOMBinding(void*)
{
return true;
}
MOZ_ALWAYS_INLINE bool
CouldBeDOMBinding(nsWrapperCache* aCache)
{
return aCache->IsDOMBinding();
}
// Create a JSObject wrapping "value", if there isn't one already, and store it
// in *vp. "value" must be a concrete class that implements a
// GetWrapperPreserveColor() which can return its existing wrapper, if any, and
// a WrapObject() which will try to create a wrapper. Typically, this is done by
// having "value" inherit from nsWrapperCache.
// Create a JSObject wrapping "value", for cases when "value" is a
// non-wrapper-cached object using WebIDL bindings. "value" must implement a
// WrapObject() method taking a JSContext and a scope.
template <class T>
MOZ_ALWAYS_INLINE bool
WrapNewBindingObject(JSContext* cx, JSObject* scope, T* value, JS::Value* vp)
@ -525,12 +511,9 @@ WrapNewBindingObject(JSContext* cx, JSObject* scope, T* value, JS::Value* vp)
*vp = JS::ObjectValue(*obj);
return true;
}
} else {
// Inline this here while we have non-dom objects in wrapper caches.
if (!CouldBeDOMBinding(value)) {
return false;
}
}
if (!obj) {
bool triedToWrap;
obj = value->WrapObject(cx, scope, &triedToWrap);
if (!obj) {
@ -570,9 +553,11 @@ WrapNewBindingObject(JSContext* cx, JSObject* scope, T* value, JS::Value* vp)
return JS_WrapValue(cx, vp);
}
// Create a JSObject wrapping "value", for cases when "value" is a
// non-wrapper-cached object using WebIDL bindings. "value" must implement a
// WrapObject() method taking a JSContext and a scope.
// Create a JSObject wrapping "value", if there isn't one already, and store it
// in *vp. "value" must be a concrete class that implements a GetWrapper()
// which can return its existing wrapper, if any, and a WrapObject() which will
// try to create a wrapper. Typically, this is done by having "value" inherit
// from nsWrapperCache.
template <class T>
inline bool
WrapNewBindingNonWrapperCachedObject(JSContext* cx, JSObject* scope, T* value,
@ -609,47 +594,26 @@ WrapNewBindingNonWrapperCachedObject(JSContext* cx, JSObject* scope,
return WrapNewBindingNonWrapperCachedObject(cx, scope, value.get(), vp);
}
// Only set allowNativeWrapper to false if you really know you need it, if in
// doubt use true. Setting it to false disables security wrappers.
bool
NativeInterface2JSObjectAndThrowIfFailed(JSContext* aCx,
JSObject* aScope,
JS::Value* aRetval,
xpcObjectHelper& aHelper,
const nsIID* aIID,
bool aAllowNativeWrapper);
inline nsWrapperCache*
GetWrapperCache(nsWrapperCache* cache)
{
return cache;
}
inline nsWrapperCache*
GetWrapperCache(nsGlobalWindow* not_allowed);
inline nsWrapperCache*
GetWrapperCache(void* p)
{
return NULL;
}
/**
* A method to handle new-binding wrap failure, by possibly falling back to
* wrapping as a non-new-binding object.
*/
bool
DoHandleNewBindingWrappingFailure(JSContext* cx, JSObject* scope,
nsISupports* value, JS::Value* vp);
/**
* An easy way to call the above when you have a value which
* multiply-inherits from nsISupports.
*/
template <class T>
MOZ_ALWAYS_INLINE bool
bool
HandleNewBindingWrappingFailure(JSContext* cx, JSObject* scope, T* value,
JS::Value* vp)
{
if (JS_IsExceptionPending(cx)) {
return false;
}
qsObjectHelper helper(value, GetWrapperCache(value));
return NativeInterface2JSObjectAndThrowIfFailed(cx, scope, vp, helper,
nullptr, true);
nsCOMPtr<nsISupports> val;
CallQueryInterface(value, getter_AddRefs(val));
return DoHandleNewBindingWrappingFailure(cx, scope, val, vp);
}
// Helper for smart pointers (nsAutoPtr/nsRefPtr/nsCOMPtr).
@ -737,6 +701,21 @@ FindEnumStringIndex(JSContext* cx, JS::Value v, const EnumEntry* values,
return -1;
}
inline nsWrapperCache*
GetWrapperCache(nsWrapperCache* cache)
{
return cache;
}
inline nsWrapperCache*
GetWrapperCache(nsGlobalWindow* not_allowed);
inline nsWrapperCache*
GetWrapperCache(void* p)
{
return NULL;
}
struct ParentObject {
template<class T>
ParentObject(T* aObject) :

View File

@ -194,20 +194,6 @@ DOMInterfaces = {
}
}],
'Element': {
# 'prefable' is True because some nodes are not on new bindings yet, so the
# wrapping code for Element return values needs to fall back to XPConnect as
# needed.
'prefable': True,
'hasXPConnectImpls': True,
'hasInstanceInterface': 'nsIDOMElement',
'resultNotAddRefed': [
'classList', 'attributes', 'children', 'firstElementChild',
'lastElementChild', 'previousElementSibling', 'nextElementSibling',
'getAttributeNode', 'getAttributeNodeNS'
]
},
'Event': [
{
'workers': True,
@ -525,7 +511,8 @@ DOMInterfaces = {
{
'nativeType': 'nsXHREventTarget',
'headerFile': 'nsXMLHttpRequest.h',
'concrete': False
'concrete': False,
'prefable': True,
},
{
'workers': True,
@ -535,7 +522,8 @@ DOMInterfaces = {
'XMLHttpRequestUpload': [
{
'nativeType': 'nsXMLHttpRequestUpload',
'headerFile': 'nsXMLHttpRequest.h'
'headerFile': 'nsXMLHttpRequest.h',
'prefable': True
},
{
'workers': True,
@ -738,6 +726,7 @@ addExternalIface('CSSValue')
addExternalIface('DocumentType', nativeType='nsIDOMDocumentType')
addExternalIface('DOMStringList', nativeType='nsDOMStringList',
headerFile='nsDOMLists.h')
addExternalIface('Element', nativeType='mozilla::dom::Element')
addExternalIface('File')
addExternalIface('HitRegionOptions', nativeType='nsISupports')
addExternalIface('HTMLElement')

View File

@ -154,15 +154,34 @@
"EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on document.doctype with too few arguments must throw TypeError": true,
"EventTarget interface: calling removeEventListener(DOMString,EventListener,boolean) on document.doctype with too few arguments must throw TypeError": true,
"EventTarget interface: calling dispatchEvent(Event) on document.doctype with too few arguments must throw TypeError": true,
"Element interface: attribute namespaceURI": true,
"Element interface: attribute prefix": true,
"Element interface: attribute localName": true,
"Element interface: existence and properties of interface object": true,
"Element interface: existence and properties of interface prototype object": true,
"Element interface: existence and properties of interface prototype object's \"constructor\" property": true,
"Element interface: attribute tagName": true,
"Element interface: attribute id": true,
"Element interface: attribute className": true,
"Element interface: attribute attributes": true,
"Element interface: attribute classList": true,
"Element interface: attribute children": true,
"Element interface: attribute firstElementChild": true,
"Element interface: attribute lastElementChild": true,
"Element interface: attribute previousElementSibling": true,
"Element interface: attribute nextElementSibling": true,
"Element interface: attribute childElementCount": true,
"Element interface: operation remove()": true,
"Element must be primary interface of element": true,
"Stringification of element": "debug",
"Element interface: element must inherit property \"id\" with the proper type (4)": true,
"Element interface: element must inherit property \"className\" with the proper type (5)": true,
"Element interface: calling getAttribute(DOMString) on element with too few arguments must throw TypeError": true,
"Element interface: calling getAttributeNS(DOMString,DOMString) on element with too few arguments must throw TypeError": true,
"Element interface: calling setAttribute(DOMString,DOMString) on element with too few arguments must throw TypeError": true,
"Element interface: calling setAttributeNS(DOMString,DOMString,DOMString) on element with too few arguments must throw TypeError": true,
"Element interface: calling removeAttribute(DOMString) on element with too few arguments must throw TypeError": true,
"Element interface: calling removeAttributeNS(DOMString,DOMString) on element with too few arguments must throw TypeError": true,
"Element interface: calling hasAttribute(DOMString) on element with too few arguments must throw TypeError": true,
"Element interface: calling hasAttributeNS(DOMString,DOMString) on element with too few arguments must throw TypeError": true,
"Element interface: calling getElementsByTagName(DOMString) on element with too few arguments must throw TypeError": true,
"Element interface: calling getElementsByTagNameNS(DOMString,DOMString) on element with too few arguments must throw TypeError": true,
"Element interface: calling getElementsByClassName(DOMString) on element with too few arguments must throw TypeError": true,
"Element interface: element must inherit property \"remove\" with the proper type (25)": true,
"EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on element with too few arguments must throw TypeError": true,
"EventTarget interface: calling removeEventListener(DOMString,EventListener,boolean) on element with too few arguments must throw TypeError": true,

View File

@ -32,7 +32,7 @@ interface Element : Node {
FIXME Bug 810677 Move className from HTMLElement to Element
attribute DOMString className;
*/
readonly attribute DOMTokenList? classList;
readonly attribute DOMTokenList classList;
//readonly attribute Attr[] attributes;
DOMString? getAttribute(DOMString name);
@ -74,13 +74,6 @@ interface Element : Node {
// Mozilla specific stuff
[SetterThrows,LenientThis]
attribute EventHandler onmouseenter;
[SetterThrows,LenientThis]
attribute EventHandler onmouseleave;
[SetterThrows]
attribute EventHandler onwheel;
// Selectors API
/**
* Returns whether this element would be selected by the given selector
@ -132,7 +125,7 @@ interface Element : Node {
[Throws]
Attr removeAttributeNode(Attr oldAttr);
[Throws]
Attr getAttributeNodeNS(DOMString? namespaceURI, DOMString localName);
Attr getAttributeNodeNS(DOMString namespaceURI, DOMString localName);
[Throws]
Attr setAttributeNodeNS(Attr newAttr);
/*

View File

@ -15,7 +15,6 @@
interface DOMStringMap;
interface HTMLMenuElement;
[PrefControlled]
interface HTMLElement : Element {
// metadata attributes
attribute DOMString title;
@ -201,17 +200,24 @@ interface HTMLElement : Element {
// FIXME Bug 810677 Move className from HTMLElement to Element
attribute DOMString className;
[SetterThrows,Pref="dom.w3c_touch_events.expose"]
[SetterThrows,LenientThis]
attribute EventHandler onmouseenter;
[SetterThrows,LenientThis]
attribute EventHandler onmouseleave;
[SetterThrows]
attribute EventHandler onwheel;
[SetterThrows,Pref="dom.w3c_touch_events.enabled"]
attribute EventHandler ontouchstart;
[SetterThrows,Pref="dom.w3c_touch_events.expose"]
[SetterThrows,Pref="dom.w3c_touch_events.enabled"]
attribute EventHandler ontouchend;
[SetterThrows,Pref="dom.w3c_touch_events.expose"]
[SetterThrows,Pref="dom.w3c_touch_events.enabled"]
attribute EventHandler ontouchmove;
[SetterThrows,Pref="dom.w3c_touch_events.expose"]
[SetterThrows,Pref="dom.w3c_touch_events.enabled"]
attribute EventHandler ontouchenter;
[SetterThrows,Pref="dom.w3c_touch_events.expose"]
[SetterThrows,Pref="dom.w3c_touch_events.enabled"]
attribute EventHandler ontouchleave;
[SetterThrows,Pref="dom.w3c_touch_events.expose"]
[SetterThrows,Pref="dom.w3c_touch_events.enabled"]
attribute EventHandler ontouchcancel;
[SetterThrows]

View File

@ -28,7 +28,6 @@ webidl_files = \
DOMSettableTokenList.webidl \
DOMStringMap.webidl \
DynamicsCompressorNode.webidl \
Element.webidl \
EventHandler.webidl \
EventListener.webidl \
EventTarget.webidl \

View File

@ -798,6 +798,27 @@ xpc_qsUnwrapThisFromCcxImpl(XPCCallContext &ccx,
return true;
}
JSObject*
xpc_qsUnwrapObj(JS::Value v, nsISupports **ppArgRef, nsresult *rv)
{
if (v.isNullOrUndefined()) {
*ppArgRef = nullptr;
*rv = NS_OK;
return nullptr;
}
if (!v.isObject()) {
*ppArgRef = nullptr;
*rv = ((v.isInt32() && v.toInt32() == 0)
? NS_ERROR_XPC_BAD_CONVERT_JS_ZERO_ISNOT_NULL
: NS_ERROR_XPC_BAD_CONVERT_JS);
return nullptr;
}
*rv = NS_OK;
return &v.toObject();
}
nsresult
xpc_qsUnwrapArgImpl(JSContext *cx,
jsval v,

View File

@ -435,43 +435,49 @@ castNativeFromWrapper(JSContext *cx,
return nullptr;
}
*rv = NS_ERROR_XPC_BAD_CONVERT_JS;
nsISupports *native;
if (wrapper) {
native = wrapper->GetIdentityObject();
cur = wrapper->GetFlatJSObject();
if (!native || !HasBitInInterfacesBitmap(cur, interfaceBit)) {
native = nullptr;
} else if (lccx) {
lccx->SetWrapper(wrapper, tearoff);
return nullptr;
}
} else if (cur && IS_SLIM_WRAPPER(cur)) {
native = static_cast<nsISupports*>(xpc_GetJSPrivate(cur));
if (!native || !HasBitInInterfacesBitmap(cur, interfaceBit)) {
native = nullptr;
} else if (lccx) {
lccx->SetWrapper(cur);
}
} else if (cur && protoDepth >= 0) {
const mozilla::dom::DOMClass* domClass;
mozilla::dom::DOMObjectSlot slot =
mozilla::dom::GetDOMClass(cur, domClass);
native = mozilla::dom::UnwrapDOMObject<nsISupports>(cur, slot);
if (native &&
(uint32_t)domClass->mInterfaceChain[protoDepth] != protoID) {
native = nullptr;
} else if (cur) {
if (IS_SLIM_WRAPPER(cur)) {
native = static_cast<nsISupports*>(xpc_GetJSPrivate(cur));
if (!native || !HasBitInInterfacesBitmap(cur, interfaceBit)) {
return nullptr;
}
} else if (protoDepth >= 0) {
const mozilla::dom::DOMClass* domClass;
mozilla::dom::DOMObjectSlot slot =
mozilla::dom::GetDOMClass(cur, domClass);
native = mozilla::dom::UnwrapDOMObject<nsISupports>(cur, slot);
if (!native ||
(uint32_t)domClass->mInterfaceChain[protoDepth] != protoID) {
return nullptr;
}
} else {
return nullptr;
}
} else {
native = nullptr;
return nullptr;
}
if (native) {
*pRef = nullptr;
*pVal = OBJECT_TO_JSVAL(cur);
*rv = NS_OK;
} else {
*rv = NS_ERROR_XPC_BAD_CONVERT_JS;
*pRef = nullptr;
*pVal = OBJECT_TO_JSVAL(cur);
if (lccx) {
if (wrapper)
lccx->SetWrapper(wrapper, tearoff);
else if (IS_SLIM_WRAPPER(cur))
lccx->SetWrapper(cur);
}
*rv = NS_OK;
return native;
}
@ -500,23 +506,8 @@ xpc_qsUnwrapThisFromCcx(XPCCallContext &ccx,
pThisVal);
}
MOZ_ALWAYS_INLINE JSObject*
xpc_qsUnwrapObj(jsval v, nsISupports **ppArgRef, nsresult *rv)
{
*rv = NS_OK;
if (v.isObject()) {
return &v.toObject();
}
if (!v.isNullOrUndefined()) {
*rv = ((v.isInt32() && v.toInt32() == 0)
? NS_ERROR_XPC_BAD_CONVERT_JS_ZERO_ISNOT_NULL
: NS_ERROR_XPC_BAD_CONVERT_JS);
}
*ppArgRef = nullptr;
return nullptr;
}
JSObject*
xpc_qsUnwrapObj(jsval v, nsISupports **ppArgRef, nsresult *rv);
nsresult
xpc_qsUnwrapArgImpl(JSContext *cx, jsval v, const nsIID &iid, void **ppArg,

View File

@ -95,6 +95,40 @@ members = [
'nsIDOMDocument.onmouseenter',
'nsIDOMDocument.onmouseleave',
'nsIDOMDocument.URL',
'nsIDOMElement.removeAttributeNS',
'nsIDOMElement.removeAttribute',
'nsIDOMElement.getAttribute',
'nsIDOMElement.getElementsByTagName',
'nsIDOMElement.setAttribute',
'nsIDOMElement.getElementsByTagNameNS',
'nsIDOMElement.hasAttributeNS',
'nsIDOMElement.tagName',
'nsIDOMElement.setAttributeNS',
'nsIDOMElement.hasAttribute',
'nsIDOMElement.getAttributeNS',
'nsIDOMElement.onmouseenter',
'nsIDOMElement.onmouseleave',
'nsIDOMElement.getElementsByClassName',
'nsIDOMElement.getClientRects',
'nsIDOMElement.getBoundingClientRect',
'nsIDOMElement.scrollTop',
'nsIDOMElement.scrollLeft',
'nsIDOMElement.scrollHeight',
'nsIDOMElement.scrollWidth',
'nsIDOMElement.clientTop',
'nsIDOMElement.clientLeft',
'nsIDOMElement.clientHeight',
'nsIDOMElement.clientWidth',
'nsIDOMElement.firstElementChild',
'nsIDOMElement.lastElementChild',
'nsIDOMElement.previousElementSibling',
'nsIDOMElement.nextElementSibling',
'nsIDOMElement.childElementCount',
'nsIDOMElement.children',
'nsIDOMElement.classList',
'nsIDOMElement.setCapture',
'nsIDOMElement.releaseCapture',
'nsIDOMElement.mozMatchesSelector',
'nsIDOMNamedNodeMap.item',
'nsIDOMNamedNodeMap.length',
'nsIDOMNodeSelector.querySelector',
@ -449,8 +483,7 @@ customIncludes = [
'HTMLPropertiesCollection.h',
'nsHTMLMenuElement.h',
'nsICSSDeclaration.h',
'mozilla/dom/NodeBinding.h',
'mozilla/dom/ElementBinding.h'
'mozilla/dom/NodeBinding.h'
]
customReturnInterfaces = [
@ -510,6 +543,101 @@ customMethodCalls = {
'nsIDOMStorage_Clear': {
'code': nsIDOMStorage_Clear_customMethodCallCode
},
'nsIDOMElement_GetScrollTop': {
'thisType': 'mozilla::dom::Element',
'code': ' int32_t result = self->ScrollTop();',
'canFail': False
},
'nsIDOMElement_SetScrollTop': {
'thisType': 'mozilla::dom::Element',
'canFail': False
},
'nsIDOMElement_GetScrollLeft': {
'thisType': 'mozilla::dom::Element',
'code': ' int32_t result = self->ScrollLeft();',
'canFail': False
},
'nsIDOMElement_SetScrollLeft': {
'thisType': 'mozilla::dom::Element',
'canFail': False
},
'nsIDOMElement_GetScrollHeight': {
'thisType': 'mozilla::dom::Element',
'code': ' int32_t result = self->ScrollHeight();',
'canFail': False
},
'nsIDOMElement_GetScrollWidth': {
'thisType': 'mozilla::dom::Element',
'code': ' int32_t result = self->ScrollWidth();',
'canFail': False
},
'nsIDOMElement_GetClientTop': {
'thisType': 'mozilla::dom::Element',
'code': ' int32_t result = self->ClientTop();',
'canFail': False
},
'nsIDOMElement_SetClientTop': {
'thisType': 'mozilla::dom::Element',
'canFail': False
},
'nsIDOMElement_GetClientLeft': {
'thisType': 'mozilla::dom::Element',
'code': ' int32_t result = self->ClientLeft();',
'canFail': False
},
'nsIDOMElement_SetClientLeft': {
'thisType': 'mozilla::dom::Element',
'canFail': False
},
'nsIDOMElement_GetClientHeight': {
'thisType': 'mozilla::dom::Element',
'code': ' int32_t result = self->ClientHeight();',
'canFail': False
},
'nsIDOMElement_GetClientWidth': {
'thisType': 'mozilla::dom::Element',
'code': ' int32_t result = self->ClientWidth();',
'canFail': False
},
'nsIDOMElement_GetFirstElementChild': {
'thisType': 'mozilla::dom::Element',
'code': ' nsIContent *result = self->GetFirstElementChild();',
'canFail': False
},
'nsIDOMElement_GetLastElementChild': {
'thisType': 'mozilla::dom::Element',
'code': ' nsIContent *result = self->GetLastElementChild();',
'canFail': False
},
'nsIDOMElement_GetPreviousElementSibling': {
'thisType': 'mozilla::dom::Element',
'code': ' nsIContent *result = self->GetPreviousElementSibling();',
'canFail': False
},
'nsIDOMElement_GetNextElementSibling': {
'thisType': 'mozilla::dom::Element',
'code': ' nsIContent *result = self->GetNextElementSibling();',
'canFail': False
},
'nsIDOMElement_GetClassList': {
'thisType': 'mozilla::dom::Element',
'code': ' nsDOMTokenList *result = self->ClassList();',
'canFail': False
},
'nsIDOMElement_SetCapture': {
'thisType': 'mozilla::dom::Element',
'canFail': False
},
'nsIDOMElement_ReleaseCapture': {
'thisType': 'mozilla::dom::Element',
'canFail': False
},
'nsIDOMElement_MozMatchesSelector': {
'thisType': 'mozilla::dom::Element',
'code': ' mozilla::ErrorResult error;\n'
' bool result = self->MozMatchesSelector(arg0, error);\n'
' rv = error.ErrorCode();'
},
'nsIDOMNodeSelector_QuerySelector': {
'thisType': 'nsINode',
'code': ' mozilla::ErrorResult error;\n'
@ -611,6 +739,14 @@ customMethodCalls = {
'self->GetElementsByTagNameNS(arg0, arg1);',
'canFail': False
},
'nsIDOMElement_': {
'thisType': 'mozilla::dom::Element'
},
'nsIDOMElement_GetTagName': {
'thisType': 'mozilla::dom::Element',
'code': 'nsString result = self->NodeName();',
'canFail': False
},
'nsIDOMDocument_CreateElement': {
'thisType': 'nsDocument',
'code': ' nsCOMPtr<nsIContent> result;\n'
@ -650,6 +786,94 @@ customMethodCalls = {
'thisType' : 'nsDocument',
'unwrapThisFailureFatal' : False
},
'nsIDOMElement_GetOnmouseenter' : {
'thisType' : 'mozilla::dom::Element',
'unwrapThisFailureFatal' : False
},
'nsIDOMElement_SetOnmouseenter' : {
'thisType' : 'mozilla::dom::Element',
'unwrapThisFailureFatal' : False
},
'nsIDOMElement_GetOnmouseleave' : {
'thisType' : 'mozilla::dom::Element',
'unwrapThisFailureFatal' : False
},
'nsIDOMElement_SetOnmouseleave' : {
'thisType' : 'mozilla::dom::Element',
'unwrapThisFailureFatal' : False
},
'nsIDOMElement_RemoveAttributeNS' : {
'thisType' : 'mozilla::dom::Element',
'code': ' mozilla::ErrorResult error;\n'
' self->RemoveAttributeNS(arg0, arg1, error);\n'
' rv = error.ErrorCode();'
},
'nsIDOMElement_RemoveAttribute' : {
'thisType' : 'mozilla::dom::Element',
'code': ' mozilla::ErrorResult error;\n'
' self->RemoveAttribute(arg0, error);\n'
' rv = error.ErrorCode();'
},
'nsIDOMElement_GetAttribute' : {
'thisType' : 'mozilla::dom::Element',
'code': ' nsString result;\n'
' self->GetAttribute(arg0, result);',
'canFail': False
},
'nsIDOMElement_GetAttributeNS' : {
'thisType' : 'mozilla::dom::Element',
'code': ' nsString result;\n'
' self->GetAttributeNS(arg0, arg1, result);',
'canFail': False
},
'nsIDOMElement_SetAttribute' : {
'thisType' : 'mozilla::dom::Element',
'code': ' mozilla::ErrorResult error;\n'
' self->SetAttribute(arg0, arg1, error);\n'
' rv = error.ErrorCode();'
},
'nsIDOMElement_SetAttributeNS' : {
'thisType' : 'mozilla::dom::Element',
'code': ' mozilla::ErrorResult error;\n'
' self->SetAttributeNS(arg0, arg1, arg2, error);\n'
' rv = error.ErrorCode();'
},
'nsIDOMElement_HasAttribute' : {
'thisType' : 'mozilla::dom::Element',
'code': ' bool result = self->HasAttribute(arg0);',
'canFail': False
},
'nsIDOMElement_HasAttributeNS' : {
'thisType' : 'mozilla::dom::Element',
'code': ' bool result = self->HasAttributeNS(arg0, arg1);',
'canFail': False
},
'nsIDOMElement_GetElementsByTagName' : {
'thisType' : 'mozilla::dom::Element',
'code': ' nsCOMPtr<nsIHTMLCollection> result = self->GetElementsByTagName(arg0);',
'canFail': False
},
'nsIDOMElement_GetClientRects' : {
'thisType' : 'mozilla::dom::Element',
'code': ' mozilla::ErrorResult error;\n'
' nsRefPtr<nsClientRectList> result = self->GetClientRects(error);\n'
' rv = error.ErrorCode();'
},
'nsIDOMElement_GetBoundingClientRect' : {
'thisType' : 'mozilla::dom::Element',
'code': ' nsRefPtr<nsClientRect> result = self->GetBoundingClientRect();',
'canFail': False
},
'nsIDOMElement_GetChildElementCount' : {
'thisType' : 'mozilla::dom::Element',
'code': ' uint32_t result = self->ChildElementCount();',
'canFail': False
},
'nsIDOMElement_GetChildElements' : {
'thisType' : 'mozilla::dom::Element',
'code': ' nsIHTMLCollection* result = self->Children();',
'canFail': False
},
'nsIDOMHTMLElement_GetTitle': {
'thisType' : 'nsGenericHTMLElement',
'canFail': False
@ -831,6 +1055,5 @@ customMethodCalls = {
}
newBindingProperties = {
'nsIDOMNode': 'mozilla::dom::NodeBinding::sNativePropertyHooks.mNativeProperties.regular',
'nsIDOMElement': 'mozilla::dom::ElementBinding::sNativePropertyHooks.mNativeProperties.regular'
'nsIDOMNode': 'mozilla::dom::NodeBinding::sNativePropertyHooks.mNativeProperties.regular'
}

View File

@ -219,8 +219,7 @@ CommonDialog.prototype = {
initTextbox : function (aName, aValue) {
this.ui[aName + "Container"].hidden = false;
this.ui[aName + "Textbox"].setAttribute("value",
aValue !== null ? aValue : "");
this.ui[aName + "Textbox"].setAttribute("value", aValue);
},
setButtonsEnabledState : function(enabled) {

View File

@ -2513,7 +2513,7 @@ var gDetailView = {
document.getElementById("detail-name").textContent = aAddon.name;
var icon = aAddon.icon64URL ? aAddon.icon64URL : aAddon.iconURL;
document.getElementById("detail-icon").src = icon ? icon : "";
document.getElementById("detail-icon").src = icon ? icon : null;
document.getElementById("detail-creator").setCreator(aAddon.creator, aAddon.homepageURL);
var version = document.getElementById("detail-version");