From 635d18ab9f39d143d30ccd0be099803122381c5a Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Mon, 7 Apr 2014 19:24:01 +0300 Subject: [PATCH] Bug 906511 - Correctly initialize .bubbles and .cancelable; r=smaug --- content/base/src/nsDocument.cpp | 8 +++++- .../failures/html/dom/nodes/mochitest.ini | 1 - .../nodes/test_Document-createEvent.html.json | 26 ------------------- 3 files changed, 7 insertions(+), 28 deletions(-) delete mode 100644 dom/imptests/failures/html/dom/nodes/test_Document-createEvent.html.json diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 31e457a6e66..34f0b0db55e 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -7750,7 +7750,13 @@ nsIDocument::CreateEvent(const nsAString& aEventType, ErrorResult& rv) const rv = EventDispatcher::CreateEvent(const_cast(this), presContext, nullptr, aEventType, getter_AddRefs(ev)); - return ev ? dont_AddRef(ev.forget().take()->InternalDOMEvent()) : nullptr; + if (!ev) { + return nullptr; + } + WidgetEvent* e = ev->GetInternalNSEvent(); + e->mFlags.mBubbles = false; + e->mFlags.mCancelable = false; + return dont_AddRef(ev.forget().take()->InternalDOMEvent()); } void diff --git a/dom/imptests/failures/html/dom/nodes/mochitest.ini b/dom/imptests/failures/html/dom/nodes/mochitest.ini index bf2af32115f..37c9e5c6c00 100644 --- a/dom/imptests/failures/html/dom/nodes/mochitest.ini +++ b/dom/imptests/failures/html/dom/nodes/mochitest.ini @@ -5,7 +5,6 @@ support-files = [test_Document-createElement-namespace.html.json] [test_Document-createElementNS.html.json] -[test_Document-createEvent.html.json] [test_Document-getElementsByTagName.html.json] [test_Node-isEqualNode.xhtml.json] [test_Node-properties.html.json] diff --git a/dom/imptests/failures/html/dom/nodes/test_Document-createEvent.html.json b/dom/imptests/failures/html/dom/nodes/test_Document-createEvent.html.json deleted file mode 100644 index d036c19b79e..00000000000 --- a/dom/imptests/failures/html/dom/nodes/test_Document-createEvent.html.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "createEvent('CustomEvent') should be initialized correctly.": true, - "createEvent('customevent') should be initialized correctly.": true, - "createEvent('CUSTOMEVENT') should be initialized correctly.": true, - "createEvent('Event') should be initialized correctly.": true, - "createEvent('event') should be initialized correctly.": true, - "createEvent('EVENT') should be initialized correctly.": true, - "createEvent('Events') should be initialized correctly.": true, - "createEvent('events') should be initialized correctly.": true, - "createEvent('EVENTS') should be initialized correctly.": true, - "createEvent('HTMLEvents') should be initialized correctly.": true, - "createEvent('htmlevents') should be initialized correctly.": true, - "createEvent('HTMLEVENTS') should be initialized correctly.": true, - "createEvent('MouseEvent') should be initialized correctly.": true, - "createEvent('mouseevent') should be initialized correctly.": true, - "createEvent('MOUSEEVENT') should be initialized correctly.": true, - "createEvent('MouseEvents') should be initialized correctly.": true, - "createEvent('mouseevents') should be initialized correctly.": true, - "createEvent('MOUSEEVENTS') should be initialized correctly.": true, - "createEvent('UIEvent') should be initialized correctly.": true, - "createEvent('uievent') should be initialized correctly.": true, - "createEvent('UIEVENT') should be initialized correctly.": true, - "createEvent('UIEvents') should be initialized correctly.": true, - "createEvent('uievents') should be initialized correctly.": true, - "createEvent('UIEVENTS') should be initialized correctly.": true -}