Reviewed by Antti & Eric.

Fixes: https://bugs.webkit.org/show_bug.cgi?id=20372

Finish HTMLScriptElement / SVGScriptElement unification.
SVG <script> support is complete now, full SVGLoad event
respecting the influence of the externalResourcesRequired attribute
as well as SVGError event support. All other features shared with HTML.

Tests: fast/dom/HTMLScriptElement/script-reexecution.html
       svg/dom/SVGScriptElement/script-change-externalResourcesRequired-while-loading.svg
       svg/dom/SVGScriptElement/script-load-and-error-events.svg
       svg/dom/SVGScriptElement/script-reexecution.svg
       svg/dom/SVGScriptElement/script-set-href.svg


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36699 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/html/HTMLScriptElement.cpp b/WebCore/html/HTMLScriptElement.cpp
index 63b5fd4..3e39d3a 100644
--- a/WebCore/html/HTMLScriptElement.cpp
+++ b/WebCore/html/HTMLScriptElement.cpp
@@ -214,6 +214,9 @@
  
 void HTMLScriptElement::dispatchLoadEvent()
 {
+    ASSERT(!m_data.haveFiredLoadEvent());
+    m_data.setHaveFiredLoadEvent(true);
+
     dispatchEventForType(loadEvent, false, false);
 }