mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1153603 - SMIL/SVG event type-> Event Handler mapping shouldn't affect to Event.type. r=heycam
This commit is contained in:
parent
423b16584a
commit
f604952ebe
@ -639,6 +639,22 @@ nsContentUtils::InitializeModifierStrings()
|
|||||||
sModifierSeparator = new nsString(modifierSeparator);
|
sModifierSeparator = new nsString(modifierSeparator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Because of SVG/SMIL we have several atoms mapped to the same
|
||||||
|
// id, but we can rely on ID_TO_EVENT to map id to only one atom.
|
||||||
|
static bool
|
||||||
|
ShouldAddEventToStringEventTable(const EventNameMapping& aMapping)
|
||||||
|
{
|
||||||
|
switch(aMapping.mId) {
|
||||||
|
#define ID_TO_EVENT(name_, id_, type_, struct_) \
|
||||||
|
case id_: return nsGkAtoms::on##name_ == aMapping.mAtom;
|
||||||
|
#include "mozilla/EventNameList.h"
|
||||||
|
#undef ID_TO_EVENT
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
nsContentUtils::InitializeEventTable() {
|
nsContentUtils::InitializeEventTable() {
|
||||||
NS_ASSERTION(!sAtomEventTable, "EventTable already initialized!");
|
NS_ASSERTION(!sAtomEventTable, "EventTable already initialized!");
|
||||||
@ -651,6 +667,7 @@ nsContentUtils::InitializeEventTable() {
|
|||||||
#define NON_IDL_EVENT EVENT
|
#define NON_IDL_EVENT EVENT
|
||||||
#include "mozilla/EventNameList.h"
|
#include "mozilla/EventNameList.h"
|
||||||
#undef WINDOW_ONLY_EVENT
|
#undef WINDOW_ONLY_EVENT
|
||||||
|
#undef NON_IDL_EVENT
|
||||||
#undef EVENT
|
#undef EVENT
|
||||||
{ nullptr }
|
{ nullptr }
|
||||||
};
|
};
|
||||||
@ -664,8 +681,11 @@ nsContentUtils::InitializeEventTable() {
|
|||||||
// Subtract one from the length because of the trailing null
|
// Subtract one from the length because of the trailing null
|
||||||
for (uint32_t i = 0; i < ArrayLength(eventArray) - 1; ++i) {
|
for (uint32_t i = 0; i < ArrayLength(eventArray) - 1; ++i) {
|
||||||
sAtomEventTable->Put(eventArray[i].mAtom, eventArray[i]);
|
sAtomEventTable->Put(eventArray[i].mAtom, eventArray[i]);
|
||||||
sStringEventTable->Put(Substring(nsDependentAtomString(eventArray[i].mAtom), 2),
|
if (ShouldAddEventToStringEventTable(eventArray[i])) {
|
||||||
eventArray[i]);
|
sStringEventTable->Put(
|
||||||
|
Substring(nsDependentAtomString(eventArray[i].mAtom), 2),
|
||||||
|
eventArray[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -287,6 +287,13 @@ gAnim.addEventListener("beginEvent", handleOnBegin, false);
|
|||||||
gAnim.addEventListener("repeatEvent", handleOnRepeat, false);
|
gAnim.addEventListener("repeatEvent", handleOnRepeat, false);
|
||||||
gAnim.addEventListener("endEvent", handleOnEnd, false);
|
gAnim.addEventListener("endEvent", handleOnEnd, false);
|
||||||
gCircle.addEventListener("beginEvent", parentHandler, false);
|
gCircle.addEventListener("beginEvent", parentHandler, false);
|
||||||
|
|
||||||
|
var expectedEvents =
|
||||||
|
["begin", "beginEvent", "repeat", "repeatEvent", "end", "endEvent", "SVGZoom", "zoom"];
|
||||||
|
|
||||||
|
for (var i = 0; i < expectedEvents.length; ++i) {
|
||||||
|
is((new Event(expectedEvents[i])).type, expectedEvents[i], "Unexpected event type!");
|
||||||
|
}
|
||||||
]]>
|
]]>
|
||||||
</script>
|
</script>
|
||||||
</pre>
|
</pre>
|
||||||
|
Loading…
Reference in New Issue
Block a user