From e650da245bb5b8c810955e765aa06a018a1f5f06 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 12 Apr 2013 10:51:25 -0400 Subject: [PATCH] Bug 860591. Install WebIDL quickstubs for event interfaces as needed. r=smaug --- dom/base/nsDOMClassInfoID.h | 4 +++- dom/bindings/Bindings.conf | 2 ++ dom/bindings/crashtests/860591.html | 20 ++++++++++++++++++++ dom/bindings/crashtests/crashtests.list | 1 + js/xpconnect/src/dom_quickstubs.qsconf | 18 ++++++------------ js/xpconnect/src/nsDOMQS.h | 4 ++++ 6 files changed, 36 insertions(+), 13 deletions(-) create mode 100644 dom/bindings/crashtests/860591.html diff --git a/dom/base/nsDOMClassInfoID.h b/dom/base/nsDOMClassInfoID.h index 0a683adbc67f..de3120038f84 100644 --- a/dom/base/nsDOMClassInfoID.h +++ b/dom/base/nsDOMClassInfoID.h @@ -61,7 +61,9 @@ DOMCI_CASTABLE_INTERFACE(nsGenericHTMLElement, nsGenericHTMLElement, 6, \ _extra) \ DOMCI_CASTABLE_INTERFACE(nsHTMLDocument, nsIDocument, 7, _extra) \ DOMCI_CASTABLE_INTERFACE(nsStyledElement, nsStyledElement, 8, _extra) \ -DOMCI_CASTABLE_INTERFACE(nsSVGElement, nsIContent, 9, _extra) +DOMCI_CASTABLE_INTERFACE(nsSVGElement, nsIContent, 9, _extra) \ +DOMCI_CASTABLE_INTERFACE(nsDOMMouseEvent, nsIDOMMouseEvent, 10, _extra) \ +DOMCI_CASTABLE_INTERFACE(nsDOMUIEvent, nsIDOMUIEvent, 11, _extra) // Make sure all classes mentioned in DOMCI_CASTABLE_INTERFACES // have been declared. diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf index 6d921ffb8153..1cd2492e8fe5 100644 --- a/dom/bindings/Bindings.conf +++ b/dom/bindings/Bindings.conf @@ -573,6 +573,7 @@ DOMInterfaces = { 'MouseEvent': { 'nativeType': 'nsDOMMouseEvent', + 'hasXPConnectImpls': True, }, 'MozChannel': [ @@ -974,6 +975,7 @@ DOMInterfaces = { 'UIEvent': { 'nativeType': 'nsDOMUIEvent', + 'hasXPConnectImpls': True }, 'URL' : [{ diff --git a/dom/bindings/crashtests/860591.html b/dom/bindings/crashtests/860591.html new file mode 100644 index 000000000000..565a729c4d04 --- /dev/null +++ b/dom/bindings/crashtests/860591.html @@ -0,0 +1,20 @@ + + + + + + diff --git a/dom/bindings/crashtests/crashtests.list b/dom/bindings/crashtests/crashtests.list index 4761bd1d30ef..ea8e158fbc70 100644 --- a/dom/bindings/crashtests/crashtests.list +++ b/dom/bindings/crashtests/crashtests.list @@ -2,4 +2,5 @@ asserts-if(cocoaWidget,0-1) load 769464.html load 822340-1.html load 822340-2.html load 832899.html +load 860591.html load 860551.html diff --git a/js/xpconnect/src/dom_quickstubs.qsconf b/js/xpconnect/src/dom_quickstubs.qsconf index ff5e7d2d8640..ea5897d29259 100644 --- a/js/xpconnect/src/dom_quickstubs.qsconf +++ b/js/xpconnect/src/dom_quickstubs.qsconf @@ -62,18 +62,6 @@ members = [ 'nsIDOMMozNamedAttrMap.length', 'nsIDOMDOMStringList.*', - 'nsIDOMEvent.type', - 'nsIDOMEvent.target', - 'nsIDOMEvent.currentTarget', - 'nsIDOMEvent.eventPhase', - 'nsIDOMEvent.bubbles', - 'nsIDOMEvent.cancelable', - 'nsIDOMEvent.timeStamp', - 'nsIDOMEvent.stopPropagation', - 'nsIDOMEvent.preventDefault', - 'nsIDOMEvent.initEvent', - 'nsIDOMEvent.defaultPrevented', - 'nsIDOMEvent.stopImmediatePropagation', 'nsIDOMKeyEvent.*', 'nsIDOMDragEvent.*', 'nsIDOMNotifyPaintEvent.*', @@ -207,6 +195,9 @@ customIncludes = [ 'nsPerformance.h', 'mozilla/dom/HTMLDocumentBinding.h', 'mozilla/dom/EventTargetBinding.h', + 'mozilla/dom/EventBinding.h', + 'mozilla/dom/MouseEventBinding.h', + 'mozilla/dom/UIEventBinding.h', ] customReturnInterfaces = [ @@ -256,4 +247,7 @@ newBindingProperties = { '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', } diff --git a/js/xpconnect/src/nsDOMQS.h b/js/xpconnect/src/nsDOMQS.h index 3ef04aec697f..0bff94b8b473 100644 --- a/js/xpconnect/src/nsDOMQS.h +++ b/js/xpconnect/src/nsDOMQS.h @@ -17,6 +17,8 @@ #include "nsICSSDeclaration.h" #include "nsSVGElement.h" #include "nsDOMEvent.h" +#include "nsDOMMouseEvent.h" +#include "nsDOMUIEvent.h" #include "mozilla/dom/EventTargetBinding.h" #include "mozilla/dom/NodeBinding.h" #include "mozilla/dom/ElementBinding.h" @@ -52,6 +54,8 @@ NEW_BINDING(nsIDocument, Document); NEW_BINDING(nsDocument, Document); NEW_BINDING(nsSVGElement, SVGElement); NEW_BINDING(nsDOMEvent, Event); +NEW_BINDING(nsDOMMouseEvent, MouseEvent); +NEW_BINDING(nsDOMUIEvent, UIEvent); #define DEFINE_UNWRAP_CAST(_interface, _base, _bit) \ template <> \