Title: [122081] trunk/Source/WebCore
Revision
122081
Author
[email protected]
Date
2012-07-08 21:30:08 -0700 (Sun, 08 Jul 2012)

Log Message

Remove unnecessary member HTMLTreeBuilder::m_lastScriptElementStartPosition
https://bugs.webkit.org/show_bug.cgi?id=90726

Reviewed by Adam Barth.

HTMLTreeBuilder::m_lastScriptElementStartPosition is of no use. Currently,
m_lastScriptElementStartPosition is used to store the text position in
"script" start tag, and then the stored position is passed to m_scriptToProcessStartPosition
later in "script" end tag. Because HTMLTreeBuilder handles one script tag at
a time, we can store the text position directly to m_scriptToProcessStartPosition
in "script" start tag.

No behavior change, so no new tests.

* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
(WebCore::HTMLTreeBuilder::processEndTag):
(WebCore::HTMLTreeBuilder::processScriptStartTag):
* html/parser/HTMLTreeBuilder.h:
(HTMLTreeBuilder):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (122080 => 122081)


--- trunk/Source/WebCore/ChangeLog	2012-07-09 04:15:23 UTC (rev 122080)
+++ trunk/Source/WebCore/ChangeLog	2012-07-09 04:30:08 UTC (rev 122081)
@@ -1,3 +1,26 @@
+2012-07-07  Kwang Yul Seo  <[email protected]>
+
+        Remove unnecessary member HTMLTreeBuilder::m_lastScriptElementStartPosition
+        https://bugs.webkit.org/show_bug.cgi?id=90726
+
+        Reviewed by Adam Barth.
+
+        HTMLTreeBuilder::m_lastScriptElementStartPosition is of no use. Currently,
+        m_lastScriptElementStartPosition is used to store the text position in
+        "script" start tag, and then the stored position is passed to m_scriptToProcessStartPosition
+        later in "script" end tag. Because HTMLTreeBuilder handles one script tag at
+        a time, we can store the text position directly to m_scriptToProcessStartPosition
+        in "script" start tag.
+
+        No behavior change, so no new tests.
+
+        * html/parser/HTMLTreeBuilder.cpp:
+        (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
+        (WebCore::HTMLTreeBuilder::processEndTag):
+        (WebCore::HTMLTreeBuilder::processScriptStartTag):
+        * html/parser/HTMLTreeBuilder.h:
+        (HTMLTreeBuilder):
+
 2012-07-08  Philip Rogers  <[email protected]>
 
         Refactor RenderSVGShape to not contain fallback code

Modified: trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp (122080 => 122081)


--- trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp	2012-07-09 04:15:23 UTC (rev 122080)
+++ trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp	2012-07-09 04:30:08 UTC (rev 122081)
@@ -357,7 +357,6 @@
     , m_shouldSkipLeadingNewline(false)
     , m_parser(parser)
     , m_scriptToProcessStartPosition(uninitializedPositionValue1())
-    , m_lastScriptElementStartPosition(TextPosition::belowRangePosition())
     , m_usePreHTML5ParserQuirks(usePreHTML5ParserQuirks)
 {
 }
@@ -376,7 +375,6 @@
     , m_shouldSkipLeadingNewline(false)
     , m_parser(parser)
     , m_scriptToProcessStartPosition(uninitializedPositionValue1())
-    , m_lastScriptElementStartPosition(TextPosition::belowRangePosition())
     , m_usePreHTML5ParserQuirks(usePreHTML5ParserQuirks)
 {
     // FIXME: This assertion will become invalid if <http://webkit.org/b/60316> is fixed.
@@ -2132,7 +2130,6 @@
             m_isPaused = true;
             ASSERT(m_tree.currentElement()->hasTagName(scriptTag));
             m_scriptToProcess = m_tree.currentElement();
-            m_scriptToProcessStartPosition = m_lastScriptElementStartPosition;
             m_tree.openElements()->pop();
             if (isParsingFragment() && m_fragmentContext.scriptingPermission() == DisallowScriptingContent)
                 m_scriptToProcess->removeAllChildren();
@@ -2646,7 +2643,7 @@
 
     TextPosition position = m_parser->textPosition();
 
-    m_lastScriptElementStartPosition = position;
+    m_scriptToProcessStartPosition = position;
 
     setInsertionMode(TextMode);
 }

Modified: trunk/Source/WebCore/html/parser/HTMLTreeBuilder.h (122080 => 122081)


--- trunk/Source/WebCore/html/parser/HTMLTreeBuilder.h	2012-07-09 04:15:23 UTC (rev 122080)
+++ trunk/Source/WebCore/html/parser/HTMLTreeBuilder.h	2012-07-09 04:30:08 UTC (rev 122081)
@@ -236,11 +236,6 @@
     RefPtr<Element> m_scriptToProcess; // <script> tag which needs processing before resuming the parser.
     TextPosition m_scriptToProcessStartPosition; // Starting line number of the script tag needing processing.
 
-    // FIXME: We probably want to remove this member.  Originally, it was
-    // created to service the legacy tree builder, but it seems to be used for
-    // some other things now.
-    TextPosition m_lastScriptElementStartPosition;
-
     bool m_usePreHTML5ParserQuirks;
 };
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to