2008-12-08  Julien Chaffraix  <jchaffraix@webkit.org>

        Reviewed by Darin Adler.

        Bug 22665: Remove setCreatedByParser(bool) from the few elements that use it
        https://bugs.webkit.org/show_bug.cgi?id=22665

        Remove setCreatedByParser from the script elements (HTML and SVG).

        * dom/XMLTokenizer.cpp:
        (WebCore::XMLTokenizer::eventuallyMarkAsParserCreated): Removed
        call to setCreatedByParser for the 2 elements.

        * dom/make_names.pl: Modified to call the constructor with
        the createByParser parameter if 'constructorNeedsCreatedByParser'
        is set.
        
        * html/HTMLElementFactory.cpp:
        (WebCore::scriptConstructor):
        * html/HTMLScriptElement.cpp:
        (WebCore::HTMLScriptElement::HTMLScriptElement):
        * html/HTMLScriptElement.h:
        * html/HTMLTagNames.in: Added constructorNeedsCreatedByParser
        to script.
        * svg/SVGScriptElement.cpp:
        (WebCore::SVGScriptElement::SVGScriptElement):
        * svg/SVGScriptElement.h:
        * svg/svgtags.in: Added constructorNeedsCreatedByParser
        to script.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@39111 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/html/HTMLScriptElement.cpp b/WebCore/html/HTMLScriptElement.cpp
index 89e6a04..2ced94f 100644
--- a/WebCore/html/HTMLScriptElement.cpp
+++ b/WebCore/html/HTMLScriptElement.cpp
@@ -32,11 +32,12 @@
 
 using namespace HTMLNames;
 
-HTMLScriptElement::HTMLScriptElement(const QualifiedName& tagName, Document* doc)
+HTMLScriptElement::HTMLScriptElement(const QualifiedName& tagName, Document* doc, bool createdByParser)
     : HTMLElement(tagName, doc)
     , m_data(this, this)
 {
     ASSERT(hasTagName(scriptTag));
+    m_data.setCreatedByParser(createdByParser);
 }
 
 HTMLScriptElement::~HTMLScriptElement()
@@ -48,11 +49,6 @@
     return attr->name() == sourceAttributeValue();
 }
 
-void HTMLScriptElement::setCreatedByParser(bool createdByParser)
-{
-    m_data.setCreatedByParser(createdByParser);
-}
-
 bool HTMLScriptElement::shouldExecuteAsJavaScript() const
 {
     return m_data.shouldExecuteAsJavaScript();