2010-12-28 Tony Gentilcore <tonyg@chromium.org>
authortonyg@chromium.org <tonyg@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Dec 2010 21:57:47 +0000 (21:57 +0000)
committertonyg@chromium.org <tonyg@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Dec 2010 21:57:47 +0000 (21:57 +0000)
        Reviewed by Eric Seidel.

        Remove unused member of PendingScript
        https://bugs.webkit.org/show_bug.cgi?id=51684

        This was used when HTMLScriptRunner::runScript created a PendingScript
        for inline scripts. But now it just calls executeScript() directly.
        External scripts always have the minimum starting line number.

        No new tests because no changed functionality.

        * dom/PendingScript.cpp:
        (WebCore::PendingScript::releaseElementAndClear):
        * dom/PendingScript.h:
        (WebCore::PendingScript::PendingScript):
        (WebCore::PendingScript::operator=):
        * html/parser/HTMLScriptRunner.cpp:
        (WebCore::HTMLScriptRunner::sourceFromPendingScript):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74724 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/dom/PendingScript.cpp
WebCore/dom/PendingScript.h
WebCore/html/parser/HTMLScriptRunner.cpp

index af13109..b033e5b 100644 (file)
@@ -1,3 +1,24 @@
+2010-12-28  Tony Gentilcore  <tonyg@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Remove unused member of PendingScript
+        https://bugs.webkit.org/show_bug.cgi?id=51684
+
+        This was used when HTMLScriptRunner::runScript created a PendingScript
+        for inline scripts. But now it just calls executeScript() directly.
+        External scripts always have the minimum starting line number.
+
+        No new tests because no changed functionality.
+
+        * dom/PendingScript.cpp:
+        (WebCore::PendingScript::releaseElementAndClear):
+        * dom/PendingScript.h:
+        (WebCore::PendingScript::PendingScript):
+        (WebCore::PendingScript::operator=):
+        * html/parser/HTMLScriptRunner.cpp:
+        (WebCore::HTMLScriptRunner::sourceFromPendingScript):
+
 2010-12-20  Antonio Gomes  <agomes@rim.com>
 
         Reviewed by Daniel Bates.
index 18f6071..10b8137 100644 (file)
@@ -40,7 +40,6 @@ PendingScript::~PendingScript()
 PassRefPtr<Element> PendingScript::releaseElementAndClear()
 {
     setCachedScript(0);
-    m_startingPosition = TextPosition1::belowRangePosition();
     m_watchingForLoad = false;
     return m_element.release();
 }
index 083507a..f679d5d 100644 (file)
@@ -44,14 +44,12 @@ class Element;
 class PendingScript : public CachedResourceClient {
 public:
     PendingScript()
-        : m_startingPosition(TextPosition1::belowRangePosition())
-        , m_watchingForLoad(false)
+        : m_watchingForLoad(false)
     {
     }
 
     PendingScript(const PendingScript& other)
         : CachedResourceClient(other)
-        , m_startingPosition(other.m_startingPosition)
         , m_watchingForLoad(other.m_watchingForLoad)
         , m_element(other.m_element)
     {
@@ -65,7 +63,6 @@ public:
         if (this == &other)
             return *this;
 
-        m_startingPosition = other.m_startingPosition;
         m_watchingForLoad = other.m_watchingForLoad;
         m_element = other.m_element;
         setCachedScript(other.cachedScript());
@@ -73,10 +70,6 @@ public:
         return *this;
     }
 
-    // FIXME: No setter means this is never set to anything other than 0.
-    // This is either unnecessary or incorrect.
-    TextPosition1 startingPosition() const { return m_startingPosition; }
-
     bool watchingForLoad() const { return m_watchingForLoad; }
     void setWatchingForLoad(bool b) { m_watchingForLoad = b; }
 
@@ -90,7 +83,6 @@ public:
     virtual void notifyFinished(CachedResource*);
 
 private:
-    TextPosition1 m_startingPosition; // Only used for inline script tags.
     bool m_watchingForLoad;
     RefPtr<Element> m_element;
     CachedResourceHandle<CachedScript> m_cachedScript;
index 7978a0f..2672f39 100644 (file)
@@ -99,7 +99,7 @@ ScriptSourceCode HTMLScriptRunner::sourceFromPendingScript(const PendingScript&
         return ScriptSourceCode(script.cachedScript());
     }
     errorOccurred = false;
-    return ScriptSourceCode(script.element()->textContent(), documentURLForScriptExecution(m_document), script.startingPosition());
+    return ScriptSourceCode(script.element()->textContent(), documentURLForScriptExecution(m_document));
 }
 
 bool HTMLScriptRunner::isPendingScriptReady(const PendingScript& script)