diff --git a/dom/events/Event.cpp b/dom/events/Event.cpp index 0d8d1ea328f2..646dd88ae608 100644 --- a/dom/events/Event.cpp +++ b/dom/events/Event.cpp @@ -523,6 +523,7 @@ void Event::SetEventType(const nsAString& aEventTypeArg) { if (mIsMainThreadEvent) { + mEvent->typeString.Truncate(); mEvent->userType = nsContentUtils::GetEventIdAndAtom(aEventTypeArg, mEvent->eventStructType, &(mEvent->message)); diff --git a/dom/events/test/mochitest.ini b/dom/events/test/mochitest.ini index 0b790b6e8675..4eeff715106e 100644 --- a/dom/events/test/mochitest.ini +++ b/dom/events/test/mochitest.ini @@ -157,3 +157,4 @@ skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM skip-if = buildapp == 'b2g' || e10s [test_bug985988.html] [test_dom_storage_event.html] +[test_bug998809.html] diff --git a/dom/events/test/test_bug998809.html b/dom/events/test/test_bug998809.html new file mode 100644 index 000000000000..08499d2c75af --- /dev/null +++ b/dom/events/test/test_bug998809.html @@ -0,0 +1,35 @@ + + + +
+ +++ +