mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
Backout 270257.
This commit is contained in:
parent
c072174d65
commit
66d32b786e
@ -212,7 +212,29 @@ nsSVGElement::SetAttr(PRInt32 aNamespaceID, nsIAtom* aName, nsIAtom* aPrefix,
|
||||
|
||||
if (aNamespaceID == kNameSpaceID_None && IsEventName(aName)) {
|
||||
nsCOMPtr<nsIEventListenerManager> manager;
|
||||
GetListenerManager(getter_AddRefs(manager));
|
||||
if (aName == nsSVGAtoms::onload) {
|
||||
// If we have a document, and it has a script global, add the
|
||||
// event listener on the global.
|
||||
|
||||
// Until we figure out how to handle multiple onloads, only
|
||||
// onload on the root element (least surprise, hopefully).
|
||||
// This test isn't ideal, as it's really checking for an
|
||||
// empty document, which could happen with javascript DOM
|
||||
// creation as well as for the root element of a document
|
||||
// we're parsing. But in famous last words, this code will
|
||||
// be changing soon to allow multiple onloads per document.
|
||||
nsIDocument *document = GetCurrentDoc();
|
||||
if (document && !document->GetRootContent()) {
|
||||
nsCOMPtr<nsIDOMEventReceiver> receiver =
|
||||
do_QueryInterface(document->GetScriptGlobalObject());
|
||||
if (receiver) {
|
||||
receiver->GetListenerManager(getter_AddRefs(manager));
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
GetListenerManager(getter_AddRefs(manager));
|
||||
}
|
||||
if (manager) {
|
||||
manager->AddScriptEventListener(NS_STATIC_CAST(nsIContent*, this), aName,
|
||||
aValue, PR_TRUE);
|
||||
|
@ -341,6 +341,5 @@ nsSVGGraphicElement::IsAttributeMapped(const nsIAtom* name) const
|
||||
PRBool
|
||||
nsSVGGraphicElement::IsEventName(nsIAtom* aName)
|
||||
{
|
||||
return IsGraphicElementEventName(aName) ||
|
||||
aName == nsSVGAtoms::onload;
|
||||
return IsGraphicElementEventName(aName);
|
||||
}
|
||||
|
@ -293,8 +293,6 @@ void
|
||||
nsSVGScriptElement::GetScriptType(nsAString& type)
|
||||
{
|
||||
GetType(type);
|
||||
if (type.LowerCaseEqualsLiteral("text/ecmascript"))
|
||||
type.AssignLiteral("text/javascript");
|
||||
}
|
||||
|
||||
// variation of this code in nsHTMLScriptElement - check if changes
|
||||
|
Loading…
Reference in New Issue
Block a user