Reviewed by Eric.
Fixes: https://bugs.webkit.org/show_bug.cgi?id=20865
Prepare HTMLScriptElement & SVGScriptElement unification, and unification of event handling.
Several renames:
dispatchHTMLEvent -> dispatchEventForType
setHTMLEventListener -> setEventListenerForType
getHTMLEventListener -> eventListenerForType
removeHTMLEventListener -> removeEventListenerForType
isHTMLEventListener -> isAttachedToEventTargetNode
...
Similar renames for the dispatch/get/set/*Window*Event functions.
Kill JSSVGLazyEventListener and merge with JSLazyEventListener.
Most important change: Rename setHTMLEventListener to setEventListenerForTypeAndAttribute,
as there exists a generic createEventListener() method now, taking care of JSLazyEventListener creation.
setHTMLEventListener() used createHTMLEventListener() before and was HTML specific.
SVG is able to use the code as well now. This affects most files in html/.
No functional changes.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36466 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/html/HTMLScriptElement.cpp b/WebCore/html/HTMLScriptElement.cpp
index 078eb40..63b5fd4 100644
--- a/WebCore/html/HTMLScriptElement.cpp
+++ b/WebCore/html/HTMLScriptElement.cpp
@@ -71,7 +71,7 @@
if (attrName == srcAttr)
handleSourceAttribute(m_data, attr->value());
else if (attrName == onloadAttr)
- setHTMLEventListener(loadEvent, attr);
+ setEventListenerForTypeAndAttribute(loadEvent, attr);
else
HTMLElement::parseMappedAttribute(attr);
}
@@ -211,15 +211,15 @@
{
return getAttribute(languageAttr).string();
}
-
+
void HTMLScriptElement::dispatchLoadEvent()
{
- dispatchHTMLEvent(loadEvent, false, false);
+ dispatchEventForType(loadEvent, false, false);
}
void HTMLScriptElement::dispatchErrorEvent()
{
- dispatchHTMLEvent(errorEvent, true, false);
+ dispatchEventForType(errorEvent, true, false);
}
}