2010-07-20 Adam Barth <abarth@webkit.org>
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Jul 2010 02:30:19 +0000 (02:30 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Jul 2010 02:30:19 +0000 (02:30 +0000)
        Reviewed by Eric Seidel.

        Include attributes when reconstructing elements in HTML5 tree builder
        https://bugs.webkit.org/show_bug.cgi?id=42594

        * html5lib/runner-expected-html5.txt:
2010-07-20  Adam Barth  <abarth@webkit.org>

        Reviewed by Eric Seidel.

        Include attributes when reconstructing elements in HTML5 tree builder
        https://bugs.webkit.org/show_bug.cgi?id=42594

        Remove FIXME now that we have a test.

        * html/HTMLConstructionSite.cpp:
        (WebCore::HTMLConstructionSite::createHTMLElementFromElementRecord):

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

LayoutTests/ChangeLog
LayoutTests/html5lib/resources/adoption02.dat [new file with mode: 0644]
LayoutTests/html5lib/runner-expected-html5.txt
LayoutTests/html5lib/runner-expected.txt
LayoutTests/html5lib/runner.html
WebCore/ChangeLog
WebCore/html/HTMLConstructionSite.cpp

index e2483f3..bd5635c 100644 (file)
@@ -1,3 +1,12 @@
+2010-07-20  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Include attributes when reconstructing elements in HTML5 tree builder
+        https://bugs.webkit.org/show_bug.cgi?id=42594
+
+        * html5lib/runner-expected-html5.txt:
+
 2010-07-20  Tony Chang  <tony@chromium.org>
 
         Not reviewed, chromium test expectation.
diff --git a/LayoutTests/html5lib/resources/adoption02.dat b/LayoutTests/html5lib/resources/adoption02.dat
new file mode 100644 (file)
index 0000000..2121e31
--- /dev/null
@@ -0,0 +1,39 @@
+#data
+<b>1<i>2<p>3</b>4
+#errors
+#document
+| <html>
+|   <head>
+|   <body>
+|     <b>
+|       "1"
+|       <i>
+|         "2"
+|     <i>
+|       <p>
+|         <b>
+|           "3"
+|         "4"
+
+#data
+<b id="b">1<i id="i">2<p>3<script>document.getElementById("b").id = "c";document.getElementById("i").id = "j"</script></b>4
+#errors
+#document
+| <html>
+|   <head>
+|   <body>
+|     <b>
+|       id="c"
+|       "1"
+|       <i>
+|         id="j"
+|         "2"
+|     <i>
+|       id="i"
+|       <p>
+|         <b>
+|           id="b"
+|           "3"
+|           <script>
+|             "document.getElementById("b").id = "c";document.getElementById("i").id = "j""
+|         "4"
index 504b278..e41e24c 100644 (file)
@@ -361,110 +361,57 @@ Expected:
 |         <tr>
 |           <td>
 |             "B"
-resources/inbody01.dat: PASS
-
-resources/isindex.dat: PASS
-
-resources/tables01.dat: PASS
-
-resources/tricky01.dat:
+resources/adoption02.dat:
 2
-6
 
-Test 2 of 9 in resources/tricky01.dat failed. Input:
-<html>
-<font color=red><i>Italic and Red<p>Italic and Red </font> Just italic.</p> Italic only.</i> Plain
-<p>I should not be red. <font color=red>Red. <i>Italic and red.</p>
-<p>Italic and red. </i> Red.</font> I should not be red.</p>
-<b>Bold <i>Bold and italic</b> Only Italic </i> Plain
+Test 2 of 2 in resources/adoption02.dat failed. Input:
+<b id="b">1<i id="i">2<p>3<script>document.getElementById("b").id = "c";document.getElementById("i").id = "j"</script></b>4
 Got:
 | <html>
 |   <head>
 |   <body>
-|     <font>
-|       color="red"
-|       <i>
-|         "Italic and Red"
-|     <i>
-|       <p>
-|         <font>
-|           "Italic and Red "
-|         " Just italic."
-|       " Italic only."
-|     " Plain
-"
-|     <p>
-|       "I should not be red. "
-|       <font>
-|         color="red"
-|         "Red. "
-|         <i>
-|           "Italic and red."
-|     <font>
-|       color="red"
-|       <i>
-|         "
-"
-|     <p>
-|       <font>
-|         <i>
-|           "Italic and red. "
-|         " Red."
-|       " I should not be red."
-|     "
-"
 |     <b>
-|       "Bold "
+|       id="c"
+|       "1"
 |       <i>
-|         "Bold and italic"
+|         id="j"
+|         "2"
 |     <i>
-|       " Only Italic "
-|     " Plain"
+|       id="j"
+|       <p>
+|         <b>
+|           id="c"
+|           "3"
+|           <script>
+|             "document.getElementById("b").id = "c";document.getElementById("i").id = "j""
+|         "4"
 Expected:
 | <html>
 |   <head>
 |   <body>
-|     <font>
-|       color="red"
-|       <i>
-|         "Italic and Red"
-|     <i>
-|       <p>
-|         <font>
-|           color="red"
-|           "Italic and Red "
-|         " Just italic."
-|       " Italic only."
-|     " Plain
-"
-|     <p>
-|       "I should not be red. "
-|       <font>
-|         color="red"
-|         "Red. "
-|         <i>
-|           "Italic and red."
-|     <font>
-|       color="red"
-|       <i>
-|         "
-"
-|     <p>
-|       <font>
-|         color="red"
-|         <i>
-|           "Italic and red. "
-|         " Red."
-|       " I should not be red."
-|     "
-"
 |     <b>
-|       "Bold "
+|       id="c"
+|       "1"
 |       <i>
-|         "Bold and italic"
+|         id="j"
+|         "2"
 |     <i>
-|       " Only Italic "
-|     " Plain"
+|       id="i"
+|       <p>
+|         <b>
+|           id="b"
+|           "3"
+|           <script>
+|             "document.getElementById("b").id = "c";document.getElementById("i").id = "j""
+|         "4"
+resources/inbody01.dat: PASS
+
+resources/isindex.dat: PASS
+
+resources/tables01.dat: PASS
+
+resources/tricky01.dat:
+6
 
 Test 6 of 9 in resources/tricky01.dat failed. Input:
 <TABLE>
index 9c5e6a5..1c430fd 100644 (file)
@@ -4953,6 +4953,49 @@ Expected:
 |         <tr>
 |           <td>
 |             "2"
+resources/adoption02.dat:
+2
+
+Test 2 of 2 in resources/adoption02.dat failed. Input:
+<b id="b">1<i id="i">2<p>3<script>document.getElementById("b").id = "c";document.getElementById("i").id = "j"</script></b>4
+Got:
+| <html>
+|   <head>
+|   <body>
+|     <b>
+|       id="c"
+|       "1"
+|       <i>
+|         id="j"
+|         "2"
+|     <i>
+|       id="j"
+|       <p>
+|         <b>
+|           id="c"
+|           "3"
+|           <script>
+|             "document.getElementById("b").id = "c";document.getElementById("i").id = "j""
+|         "4"
+Expected:
+| <html>
+|   <head>
+|   <body>
+|     <b>
+|       id="c"
+|       "1"
+|       <i>
+|         id="j"
+|         "2"
+|     <i>
+|       id="i"
+|       <p>
+|         <b>
+|           id="b"
+|           "3"
+|           <script>
+|             "document.getElementById("b").id = "c";document.getElementById("i").id = "j""
+|         "4"
 resources/inbody01.dat: PASS
 
 resources/isindex.dat:
index cb8836b..18ba310 100644 (file)
@@ -61,6 +61,7 @@ var test_files = [
         'resources/entities02.dat',
         'resources/comments01.dat',
         'resources/adoption01.dat',
+        'resources/adoption02.dat',
         'resources/inbody01.dat',
         'resources/isindex.dat',
         'resources/tables01.dat',
index ea49079..0ef6a40 100644 (file)
@@ -1,3 +1,15 @@
+2010-07-20  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Include attributes when reconstructing elements in HTML5 tree builder
+        https://bugs.webkit.org/show_bug.cgi?id=42594
+
+        Remove FIXME now that we have a test.
+
+        * html/HTMLConstructionSite.cpp:
+        (WebCore::HTMLConstructionSite::createHTMLElementFromElementRecord):
+
 2010-07-20  Sam Weinig  <sam@webkit.org>
 
         Reviewed by Brady Eidson.
index 9d6cdd8..b85590e 100644 (file)
@@ -314,11 +314,7 @@ PassRefPtr<Element> HTMLConstructionSite::createHTMLElement(AtomicHTMLToken& tok
 
 PassRefPtr<Element> HTMLConstructionSite::createHTMLElementFromElementRecord(HTMLElementStack::ElementRecord* record)
 {
-    // FIXME: This will change to use
-    // return createHTMLElementFromSavedElement(record->element());
-    // in a later patch once tested.
-    AtomicHTMLToken fakeToken(HTMLToken::StartTag, record->element()->localName());
-    return createHTMLElement(fakeToken);
+    return createHTMLElementFromSavedElement(record->element());
 }
 
 namespace {