mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-15 19:20:13 +00:00
Patch to enable event.originalTarget on input fields. r=joki
This commit is contained in:
parent
273809641f
commit
cccbddadec
@ -799,6 +799,8 @@ nsHTMLInputElement::HandleDOMEvent(nsIPresContext* aPresContext,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMEventTarget> oldTarget;
|
||||
|
||||
// Do not process any DOM events if the element is disabled
|
||||
PRBool disabled;
|
||||
nsresult rv = GetDisabled(&disabled);
|
||||
@ -850,6 +852,14 @@ nsHTMLInputElement::HandleDOMEvent(nsIPresContext* aPresContext,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
(*aDOMEvent)->GetTarget(getter_AddRefs(oldTarget));
|
||||
|
||||
nsCOMPtr<nsIDOMEventTarget> originalTarget;
|
||||
(*aDOMEvent)->GetOriginalTarget(getter_AddRefs(originalTarget));
|
||||
if (!originalTarget) {
|
||||
privateEvent->SetOriginalTarget(oldTarget);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface((nsIDOMHTMLInputElement*)this);
|
||||
privateEvent->SetTarget(target);
|
||||
}
|
||||
@ -911,7 +921,7 @@ nsHTMLInputElement::HandleDOMEvent(nsIPresContext* aPresContext,
|
||||
}
|
||||
|
||||
// This will reset the target to its original value
|
||||
privateEvent->SetTarget(nsnull);
|
||||
privateEvent->SetTarget(oldTarget);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -799,6 +799,8 @@ nsHTMLInputElement::HandleDOMEvent(nsIPresContext* aPresContext,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMEventTarget> oldTarget;
|
||||
|
||||
// Do not process any DOM events if the element is disabled
|
||||
PRBool disabled;
|
||||
nsresult rv = GetDisabled(&disabled);
|
||||
@ -850,6 +852,14 @@ nsHTMLInputElement::HandleDOMEvent(nsIPresContext* aPresContext,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
(*aDOMEvent)->GetTarget(getter_AddRefs(oldTarget));
|
||||
|
||||
nsCOMPtr<nsIDOMEventTarget> originalTarget;
|
||||
(*aDOMEvent)->GetOriginalTarget(getter_AddRefs(originalTarget));
|
||||
if (!originalTarget) {
|
||||
privateEvent->SetOriginalTarget(oldTarget);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface((nsIDOMHTMLInputElement*)this);
|
||||
privateEvent->SetTarget(target);
|
||||
}
|
||||
@ -911,7 +921,7 @@ nsHTMLInputElement::HandleDOMEvent(nsIPresContext* aPresContext,
|
||||
}
|
||||
|
||||
// This will reset the target to its original value
|
||||
privateEvent->SetTarget(nsnull);
|
||||
privateEvent->SetTarget(oldTarget);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user