зеркало из https://github.com/mozilla/pjs.git
Fix for 75024. r=danm, sr=ben
This commit is contained in:
Родитель
48c7988529
Коммит
bc91edac71
|
@ -149,7 +149,7 @@ nsDOMEvent::nsDOMEvent(nsIPresContext* aPresContext, nsEvent* aEvent, const nsAR
|
|||
mEvent = PR_NEWZAP(nsEvent);
|
||||
mEvent->eventStructType = NS_EVENT;
|
||||
}
|
||||
else if (eventType.EqualsIgnoreCase("MutationEvent")) {
|
||||
else if (eventType.EqualsIgnoreCase("MutationEvents")) {
|
||||
mEvent = PR_NEWZAP(nsMutationEvent);
|
||||
mEvent->eventStructType = NS_MUTATION_EVENT;
|
||||
}
|
||||
|
@ -1393,9 +1393,14 @@ nsDOMEvent::GetScriptObject(nsIScriptContext *aContext, void** aScriptObject)
|
|||
nsresult res = NS_OK;
|
||||
|
||||
if (nsnull == mScriptObject) {
|
||||
nsISupports *supports = (nsISupports *)(nsIDOMMouseEvent *)this;
|
||||
|
||||
res = NS_NewScriptKeyEvent(aContext, supports, nsnull, (void**)&mScriptObject);
|
||||
if (mEvent && mEvent->eventStructType == NS_MUTATION_EVENT) {
|
||||
nsISupports *supports = (nsISupports *)(nsIDOMMutationEvent *)this;
|
||||
res = NS_NewScriptMutationEvent(aContext, supports, nsnull, (void**)&mScriptObject);
|
||||
}
|
||||
else {
|
||||
nsISupports *supports = (nsISupports *)(nsIDOMMouseEvent *)this;
|
||||
res = NS_NewScriptKeyEvent(aContext, supports, nsnull, (void**)&mScriptObject);
|
||||
}
|
||||
}
|
||||
*aScriptObject = mScriptObject;
|
||||
|
||||
|
|
|
@ -43,9 +43,9 @@ class nsDOMMutationEvent : public nsIDOMMutationEvent, public nsDOMEvent
|
|||
|
||||
nsDOMMutationEvent::nsDOMMutationEvent(nsIPresContext* aPresContext,
|
||||
nsEvent* aEvent)
|
||||
:nsDOMEvent(aPresContext, aEvent, NS_LITERAL_STRING("MutationEvent"))
|
||||
:nsDOMEvent(aPresContext, aEvent, NS_LITERAL_STRING("MutationEvents"))
|
||||
{
|
||||
nsMutationEvent* mutation = (nsMutationEvent*)aEvent;
|
||||
nsMutationEvent* mutation = (nsMutationEvent*)mEvent;
|
||||
SetTarget(mutation->mTarget);
|
||||
}
|
||||
|
||||
|
@ -60,6 +60,7 @@ NS_INTERFACE_MAP_BEGIN(nsDOMMutationEvent)
|
|||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIDOMEvent, nsIDOMMutationEvent)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIPrivateDOMEvent)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMMutationEvent)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIScriptObjectOwner)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -2091,13 +2091,13 @@ nsresult nsEventListenerManager::CreateEvent(nsIPresContext* aPresContext,
|
|||
{
|
||||
nsAutoString str(aEventType);
|
||||
if (!aEvent && !str.EqualsIgnoreCase("MouseEvent") && !str.EqualsIgnoreCase("KeyEvent") &&
|
||||
!str.EqualsIgnoreCase("HTMLEvent") && !str.EqualsIgnoreCase("MutationEvent") &&
|
||||
!str.EqualsIgnoreCase("HTMLEvent") && !str.EqualsIgnoreCase("MutationEvents") &&
|
||||
!str.EqualsIgnoreCase("Event")) {
|
||||
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
|
||||
}
|
||||
|
||||
if ((aEvent && aEvent->eventStructType == NS_MUTATION_EVENT) ||
|
||||
(!aEvent && str.EqualsIgnoreCase("MutationEvent")))
|
||||
(!aEvent && str.EqualsIgnoreCase("MutationEvents")))
|
||||
return NS_NewDOMMutationEvent(aDOMEvent, aPresContext, aEvent);
|
||||
return NS_NewDOMUIEvent(aDOMEvent, aPresContext, aEventType, aEvent);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче