Bug 768310 - Don't throw from Event.initEvent if it's called during event dispatch; r=smaug
authorMs2ger <ms2ger@gmail.com>
Sat, 04 Aug 2012 09:43:59 +0200
changeset 101338 c353270e78dfd9c7923deed408576ba4e0be24c4
parent 101337 75de0df7f9268506e676c584434da318a83d8a33
child 101339 3dad862708b832f1e55e72f2cdf1f278ba2ac176
push id23230
push userMs2ger@gmail.com
push dateSat, 04 Aug 2012 07:45:45 +0000
treeherdermozilla-central@20fc34efd733 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs768310
milestone17.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 768310 - Don't throw from Event.initEvent if it's called during event dispatch; r=smaug
content/events/src/nsDOMEvent.cpp
dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/Makefile.in
dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_Event-initEvent.html.json
--- a/content/events/src/nsDOMEvent.cpp
+++ b/content/events/src/nsDOMEvent.cpp
@@ -531,17 +531,17 @@ nsDOMEvent::SetEventType(const nsAString
     nsContentUtils::GetEventIdAndAtom(aEventTypeArg, mEvent->eventStructType,
                                       &(mEvent->message));
 }
 
 NS_IMETHODIMP
 nsDOMEvent::InitEvent(const nsAString& aEventTypeArg, bool aCanBubbleArg, bool aCancelableArg)
 {
   // Make sure this event isn't already being dispatched.
-  NS_ENSURE_TRUE(!NS_IS_EVENT_IN_DISPATCH(mEvent), NS_ERROR_INVALID_ARG);
+  NS_ENSURE_TRUE(!NS_IS_EVENT_IN_DISPATCH(mEvent), NS_OK);
 
   if (NS_IS_TRUSTED_EVENT(mEvent)) {
     // Ensure the caller is permitted to dispatch trusted DOM events.
 
     bool enabled = false;
     nsContentUtils::GetSecurityManager()->
       IsCapabilityEnabled("UniversalXPConnect", &enabled);
 
--- a/dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/Makefile.in
+++ b/dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/Makefile.in
@@ -15,17 +15,16 @@ include $(topsrcdir)/config/rules.mk
 
 _FILES = \
   test_DOMImplementation-createDocument.html.json \
   test_Document-createElementNS.html.json \
   test_Document-getElementsByTagName.html.json \
   test_Element-children.html.json \
   test_Event-constructors.html.json \
   test_Event-defaultPrevented.html.json \
-  test_Event-initEvent.html.json \
   test_EventTarget-dispatchEvent.html.json \
   test_Node-appendChild.html.json \
   test_Node-constants.html.json \
   test_Node-insertBefore.html.json \
   test_Node-isEqualNode.xhtml.json \
   test_Node-removeChild.html.json \
   test_Node-replaceChild.html.json \
   test_NodeFilter-constants.html.json \
deleted file mode 100644
--- a/dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger/test_Event-initEvent.html.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
-  "Calling initEvent must not have an effect during dispatching.": true
-}