2009-06-19  Adam Barth  <abarth@webkit.org>

        Reviewed by Dimitri Glazkov.

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

        Fix external-script-URL-location.html and
        write-external-script-open.html LayoutTests.

        implicitOpen is called from several places.  We need to setXSSAuditor
        each time, so I moved the call inside implicitOpen.

        * dom/Document.cpp:
        (WebCore::Document::open):
        (WebCore::Document::implicitOpen):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::begin):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@44861 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index 57ef197..4796b63 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -1477,7 +1477,7 @@
         if (m_frame->loader()->state() == FrameStateProvisional)
             m_frame->loader()->stopAllLoaders();
     }
-    
+
     implicitOpen();
 
     if (m_frame)
@@ -1505,6 +1505,9 @@
     m_tokenizer = createTokenizer();
     setParsing(true);
 
+    if (m_frame)
+        m_tokenizer->setXSSAuditor(m_frame->script()->xssAuditor());
+
     // If we reload, the animation controller sticks around and has
     // a stale animation time. We need to update it here.
     if (m_frame && m_frame->animation())