Title: [124379] trunk/Source/WebCore
Revision
124379
Author
[email protected]
Date
2012-08-01 15:56:46 -0700 (Wed, 01 Aug 2012)

Log Message

Read tag names and attributes from the saved tokens in HTMLElementStack
https://bugs.webkit.org/show_bug.cgi?id=92830

Reviewed by Adam Barth.

This is a follow-up patch for r123577.
Replaced top()->hasTagName(x) with topStackItem()->hasTagName(x).
Also replaced item->element()->hasTagName(x) with item->hasTagName(x).

No new tests, covered by existing tests.

* html/parser/HTMLElementStack.cpp:
(WebCore::HTMLElementStack::pop):
(WebCore::HTMLElementStack::popUntil):
(WebCore::HTMLElementStack::pushHTMLHtmlElement):
(WebCore::HTMLElementStack::pushHTMLHeadElement):
(WebCore::HTMLElementStack::pushHTMLBodyElement):
(WebCore::HTMLElementStack::push):
(WebCore::HTMLElementStack::insertAbove):
(WebCore::HTMLElementStack::popCommon):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (124378 => 124379)


--- trunk/Source/WebCore/ChangeLog	2012-08-01 22:53:06 UTC (rev 124378)
+++ trunk/Source/WebCore/ChangeLog	2012-08-01 22:56:46 UTC (rev 124379)
@@ -1,3 +1,26 @@
+2012-08-01  Kwang Yul Seo  <[email protected]>
+
+        Read tag names and attributes from the saved tokens in HTMLElementStack
+        https://bugs.webkit.org/show_bug.cgi?id=92830
+
+        Reviewed by Adam Barth.
+
+        This is a follow-up patch for r123577.
+        Replaced top()->hasTagName(x) with topStackItem()->hasTagName(x).
+        Also replaced item->element()->hasTagName(x) with item->hasTagName(x).
+
+        No new tests, covered by existing tests.
+
+        * html/parser/HTMLElementStack.cpp:
+        (WebCore::HTMLElementStack::pop):
+        (WebCore::HTMLElementStack::popUntil):
+        (WebCore::HTMLElementStack::pushHTMLHtmlElement):
+        (WebCore::HTMLElementStack::pushHTMLHeadElement):
+        (WebCore::HTMLElementStack::pushHTMLBodyElement):
+        (WebCore::HTMLElementStack::push):
+        (WebCore::HTMLElementStack::insertAbove):
+        (WebCore::HTMLElementStack::popCommon):
+
 2012-08-01  Antoine Labour  <[email protected]>
 
         [chromium] remove unused fields from LayerRendererCapabilities

Modified: trunk/Source/WebCore/html/parser/HTMLElementStack.cpp (124378 => 124379)


--- trunk/Source/WebCore/html/parser/HTMLElementStack.cpp	2012-08-01 22:53:06 UTC (rev 124378)
+++ trunk/Source/WebCore/html/parser/HTMLElementStack.cpp	2012-08-01 22:56:46 UTC (rev 124379)
@@ -210,13 +210,13 @@
 
 void HTMLElementStack::pop()
 {
-    ASSERT(!top()->hasTagName(HTMLNames::headTag));
+    ASSERT(!topStackItem()->hasTagName(HTMLNames::headTag));
     popCommon();
 }
 
 void HTMLElementStack::popUntil(const AtomicString& tagName)
 {
-    while (!top()->hasLocalName(tagName)) {
+    while (!topStackItem()->hasLocalName(tagName)) {
         // pop() will ASSERT at <body> if callers fail to check that there is an
         // element with localName |tagName| on the stack of open elements.
         pop();
@@ -314,7 +314,7 @@
 
 void HTMLElementStack::pushHTMLHtmlElement(PassRefPtr<HTMLStackItem> item)
 {
-    ASSERT(item->element()->hasTagName(HTMLNames::htmlTag));
+    ASSERT(item->hasTagName(HTMLNames::htmlTag));
     pushRootNodeCommon(item);
 }
     
@@ -328,7 +328,7 @@
 
 void HTMLElementStack::pushHTMLHeadElement(PassRefPtr<HTMLStackItem> item)
 {
-    ASSERT(item->element()->hasTagName(HTMLNames::headTag));
+    ASSERT(item->hasTagName(HTMLNames::headTag));
     ASSERT(!m_headElement);
     m_headElement = item->element();
     pushCommon(item);
@@ -336,7 +336,7 @@
 
 void HTMLElementStack::pushHTMLBodyElement(PassRefPtr<HTMLStackItem> item)
 {
-    ASSERT(item->element()->hasTagName(HTMLNames::bodyTag));
+    ASSERT(item->hasTagName(HTMLNames::bodyTag));
     ASSERT(!m_bodyElement);
     m_bodyElement = item->element();
     pushCommon(item);
@@ -344,9 +344,9 @@
 
 void HTMLElementStack::push(PassRefPtr<HTMLStackItem> item)
 {
-    ASSERT(!item->element()->hasTagName(HTMLNames::htmlTag));
-    ASSERT(!item->element()->hasTagName(HTMLNames::headTag));
-    ASSERT(!item->element()->hasTagName(HTMLNames::bodyTag));
+    ASSERT(!item->hasTagName(HTMLNames::htmlTag));
+    ASSERT(!item->hasTagName(HTMLNames::headTag));
+    ASSERT(!item->hasTagName(HTMLNames::bodyTag));
     ASSERT(m_rootNode);
     pushCommon(item);
 }
@@ -356,9 +356,9 @@
     ASSERT(item);
     ASSERT(recordBelow);
     ASSERT(m_top);
-    ASSERT(!item->element()->hasTagName(HTMLNames::htmlTag));
-    ASSERT(!item->element()->hasTagName(HTMLNames::headTag));
-    ASSERT(!item->element()->hasTagName(HTMLNames::bodyTag));
+    ASSERT(!item->hasTagName(HTMLNames::htmlTag));
+    ASSERT(!item->hasTagName(HTMLNames::headTag));
+    ASSERT(!item->hasTagName(HTMLNames::bodyTag));
     ASSERT(m_rootNode);
     if (recordBelow == m_top) {
         push(item);
@@ -571,9 +571,9 @@
 
 void HTMLElementStack::popCommon()
 {
-    ASSERT(!top()->hasTagName(HTMLNames::htmlTag));
-    ASSERT(!top()->hasTagName(HTMLNames::headTag) || !m_headElement);
-    ASSERT(!top()->hasTagName(HTMLNames::bodyTag) || !m_bodyElement);
+    ASSERT(!topStackItem()->hasTagName(HTMLNames::htmlTag));
+    ASSERT(!topStackItem()->hasTagName(HTMLNames::headTag) || !m_headElement);
+    ASSERT(!topStackItem()->hasTagName(HTMLNames::bodyTag) || !m_bodyElement);
     top()->finishParsingChildren();
     m_top = m_top->releaseNext();
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to