2011-09-16 James Simonsen <simonjam@chromium.org>
authorsimonjam@chromium.org <simonjam@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Sep 2011 18:26:24 +0000 (18:26 +0000)
committersimonjam@chromium.org <simonjam@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Sep 2011 18:26:24 +0000 (18:26 +0000)
        Fix HTML5 parser's adoption agency algorithm to reparent correctly
        https://bugs.webkit.org/show_bug.cgi?id=68147

        Reviewed by Eric Seidel.

        * html5lib/resources/webkit02.dat:
2011-09-16  James Simonsen  <simonjam@chromium.org>

        Fix HTML5 parser's adoption agency algorithm to reparent correctly
        https://bugs.webkit.org/show_bug.cgi?id=68147

        Reviewed by Eric Seidel.

        * html/parser/HTMLTreeBuilder.cpp:
        (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):

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

LayoutTests/ChangeLog
LayoutTests/html5lib/resources/webkit02.dat
Source/WebCore/ChangeLog
Source/WebCore/html/parser/HTMLTreeBuilder.cpp

index 59af275..9ebc8e0 100644 (file)
@@ -1,3 +1,12 @@
+2011-09-16  James Simonsen  <simonjam@chromium.org>
+
+        Fix HTML5 parser's adoption agency algorithm to reparent correctly
+        https://bugs.webkit.org/show_bug.cgi?id=68147
+
+        Reviewed by Eric Seidel.
+
+        * html5lib/resources/webkit02.dat:
+
 2011-09-16  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         [Qt] REGRESSION(r95091) It made many tests flakey
index 2218f42..b6dc12f 100644 (file)
 |   <body>
 |     <legend>
 |       "test"
+
+#data
+<b><em><dcell><postfield><postfield><postfield><postfield><missing_glyph><missing_glyph><missing_glyph><missing_glyph><hkern><aside></b></em>
+#errors
+#document-fragment
+div
+#document
+| <b>
+|   <em>
+|     <dcell>
+|       <postfield>
+|         <postfield>
+|           <postfield>
+|             <postfield>
+|               <missing_glyph>
+|                 <missing_glyph>
+|                   <missing_glyph>
+|                     <missing_glyph>
+|                       <hkern>
+| <aside>
+|   <em>
+|     <b>
index d094ffa..d03f29e 100644 (file)
@@ -1,3 +1,13 @@
+2011-09-16  James Simonsen  <simonjam@chromium.org>
+
+        Fix HTML5 parser's adoption agency algorithm to reparent correctly
+        https://bugs.webkit.org/show_bug.cgi?id=68147
+
+        Reviewed by Eric Seidel.
+
+        * html/parser/HTMLTreeBuilder.cpp:
+        (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
+
 2011-09-16  Adam Barth  <abarth@webkit.org>
 
         CodeGeneratorGObject should use C++ style comments for ENABLE guards
index 3f6d32d..7de5493 100644 (file)
@@ -1665,7 +1665,7 @@ void HTMLTreeBuilder::callTheAdoptionAgency(AtomicHTMLToken& token)
             if (lastNode == furthestBlock)
                 bookmark.moveToAfter(nodeEntry);
             // 6.6
-            if (Element* parent = lastNode->element()->parentElement())
+            if (ContainerNode* parent = lastNode->element()->parentNode())
                 parent->parserRemoveChild(lastNode->element());
             node->element()->parserAddChild(lastNode->element());
             if (lastNode->element()->parentElement()->attached() && !lastNode->element()->attached())
@@ -1675,7 +1675,7 @@ void HTMLTreeBuilder::callTheAdoptionAgency(AtomicHTMLToken& token)
         }
         // 7
         const AtomicString& commonAncestorTag = commonAncestor->localName();
-        if (Element* parent = lastNode->element()->parentElement())
+        if (ContainerNode* parent = lastNode->element()->parentNode())
             parent->parserRemoveChild(lastNode->element());
         // FIXME: If this moves to HTMLConstructionSite, this check should use
         // causesFosterParenting(tagName) instead.