<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>17080</bug_id>
          
          <creation_ts>2008-01-29 15:04:50 -0800</creation_ts>
          <short_desc>WebKit fails Acid3 HTML parsing test (missing DocType node)</short_desc>
          <delta_ts>2008-02-20 14:51:47 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://acid3.acidtests.org/</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>12751</dependson>
          <blocked>17064</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Eric Seidel (no email)">eric</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ian</cc>
    
    <cc>webkit</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>68722</commentid>
    <comment_count>0</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-01-29 15:04:50 -0800</bug_when>
    <thetext>WebKit fails Acid3 HTML parsing test

I believe the document in question is:

http://hixie.ch/tests/evil/acid/003/empty.html

The contents of which are:
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot;&gt;&lt;html&gt;&lt;head&gt;&lt;title&gt;&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;

In the live dom viewer:
http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20HTML%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20HTML%204.0%2F%2FEN%22%3E%3Chtml%3E%3Chead%3E%3Ctitle%3E%3C%2Ftitle%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E

    function () {
      // test 72: HTML parsing, from Simon Pieters and Anne van Kesteren
      var doc = kungFuDeathGrip.childNodes[3].contentDocument;
      assert(doc, &quot;missing document for test&quot;);
      try {
        // siblings
        doc.open();
        doc.write(&quot;&lt;!DOCTYPE HTML PUBLIC \&quot;-//W3C//DTD HTML 4.0 Transitional//EN\&quot;&gt;&lt;title&gt;&lt;/title&gt;&lt;span&gt;&lt;/span&gt;&lt;script type=\&quot;text/javascript\&quot;&gt;&lt;\/script&gt;&quot;);
        doc.close();
        assertEquals(doc.documentElement.childNodes.length, 2, &quot;wrong number of children in HTML (first test)&quot;);
        assertEquals(doc.documentElement.firstChild.nodeName, &quot;HEAD&quot;, &quot;misplaced HEAD element (first test)&quot;);
        assertEquals(doc.documentElement.firstChild.childNodes.length, 1, &quot;wrong number of children in HEAD (first test)&quot;);
        assertEquals(doc.documentElement.firstChild.firstChild.tagName, &quot;TITLE (first test)&quot;);
        assertEquals(doc.documentElement.lastChild.nodeName, &quot;BODY&quot;, &quot;misplaced BODY element (first test)&quot;);
        assertEquals(doc.documentElement.lastChild.childNodes.length, 2, &quot;wrong number of children in BODY (first test)&quot;);
        assertEquals(doc.documentElement.lastChild.firstChild.tagName, &quot;SPAN&quot;, &quot;misplaced SPAN element (first test)&quot;);
        assertEquals(doc.documentElement.lastChild.lastChild.tagName, &quot;SCRIPT&quot;, &quot;misplaced SCRIPT element (first test)&quot;);
        // parent/child
        doc.open();
        doc.write(&quot;&lt;!DOCTYPE HTML PUBLIC \&quot;-//W3C//DTD HTML 4.01 Transitional//EN\&quot; \&quot;http://www.w3.org/TR/html4/loose.dtd\&quot;&gt;&lt;title&gt;&lt;/title&gt;&lt;span&gt;&lt;script type=\&quot;text/javascript\&quot;&gt;&lt;\/script&gt;&lt;/span&gt;&quot;);
        doc.close();
        assertEquals(doc.documentElement.childNodes.length, 2, &quot;wrong number of children in HTML (second test)&quot;);
        assertEquals(doc.documentElement.firstChild.nodeName, &quot;HEAD&quot;, &quot;misplaced HEAD element (second test)&quot;);
        assertEquals(doc.documentElement.firstChild.childNodes.length, 1, &quot;wrong number of children in HEAD (second test)&quot;);
        assertEquals(doc.documentElement.firstChild.firstChild.tagName, &quot;TITLE (second test)&quot;);
        assertEquals(doc.documentElement.lastChild.nodeName, &quot;BODY&quot;, &quot;misplaced BODY element (second test)&quot;);
        assertEquals(doc.documentElement.lastChild.childNodes.length, 1, &quot;wrong number of children in BODY (second test)&quot;);
        assertEquals(doc.documentElement.lastChild.firstChild.tagName, &quot;SPAN&quot;, &quot;misplaced SPAN element (second test)&quot;);
        assertEquals(doc.documentElement.lastChild.firstChild.firstChild.tagName, &quot;SCRIPT&quot;, &quot;misplaced SCRIPT element (second test)&quot;);
      } finally {
        // prepare the file for the next test
        doc.open();
        doc.write(&quot;&lt;!DOCTYPE HTML PUBLIC \&quot;-//W3C//DTD HTML 4.01//EN\&quot;&gt;&lt;head&gt;&lt;title&gt;&lt;/title&gt;&lt;style type=\&quot;text/css\&quot;&gt;img { height: 10px; }&lt;/style&gt;&lt;body&gt;&lt;p&gt;&lt;img src=\&quot;data:image/gif;base64,R0lGODlhAQABAID%2FAMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw%3D%3D\&quot; alt=\&quot;\&quot;&gt;&quot;);
        doc.close();
      }
      return 5;
    },</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68773</commentid>
    <comment_count>1</comment_count>
    <who name="Robert Blaut">webkit</who>
    <bug_when>2008-01-30 00:39:38 -0800</bug_when>
    <thetext>For me there is a bug in this test. Function assertEquals expected 3 arguments but actually got 2 of them:

assertEquals(doc.documentElement.firstChild.firstChild.tagName, &quot;TITLE (first test)&quot;);
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68784</commentid>
    <comment_count>2</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-01-30 01:22:54 -0800</bug_when>
    <thetext>the 3rd argument to assertEquals is optional.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68788</commentid>
    <comment_count>3</comment_count>
    <who name="Robert Blaut">webkit</who>
    <bug_when>2008-01-30 01:45:10 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; the 3rd argument to assertEquals is optional.
&gt; 

I know that this argument are optional, but for me this test in this state is incorrect. Look at &amp;#8211; current value: tagName &quot;TITLE&quot; is compared to expected result: &quot;TITLE (second test)&quot;. No browser passes this test ;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68790</commentid>
    <comment_count>4</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-01-30 02:18:36 -0800</bug_when>
    <thetext>Ok, I agree, it makes no sense for the tagName to ever be &quot;TITLE (first test)&quot;  passing this on to Hixie to fix the test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68822</commentid>
    <comment_count>5</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2008-01-30 11:43:03 -0800</bug_when>
    <thetext>fixed the test</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68838</commentid>
    <comment_count>6</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-01-30 13:46:48 -0800</bug_when>
    <thetext>Now we fail at:
Test 72: expected: 2, got: 1 - wrong number of children in #document (first test)
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68839</commentid>
    <comment_count>7</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-01-30 13:48:42 -0800</bug_when>
    <thetext>The test has been updated slightly:

    function () {
      // test 72: HTML parsing, from Simon Pieters and Anne van Kesteren
      var doc = kungFuDeathGrip.childNodes[3].contentDocument;
      assert(doc, &quot;missing document for test&quot;);
      try {
        // siblings
        doc.open();
        doc.write(&quot;&lt;!DOCTYPE HTML PUBLIC \&quot;-//W3C//DTD HTML 4.0 Transitional//EN\&quot;&gt;&lt;title&gt;&lt;\/title&gt;&lt;span&gt;&lt;\/span&gt;&lt;script type=\&quot;text/javascript\&quot;&gt;&lt;\/script&gt;&quot;);
        doc.close();
        assertEquals(doc.childNodes.length, 2, &quot;wrong number of children in #document (first test)&quot;);
        assertEquals(doc.firstChild.name, &quot;HTML&quot;, &quot;name wrong (first test)&quot;);
        assertEquals(doc.firstChild.publicId, &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;, &quot;publicId wrong (first test)&quot;);
        if ((doc.firstChild.systemId != null) &amp;&amp; (doc.firstChild.systemId != &quot;&quot;))
          fail(&quot;systemId wrong (first test)&quot;);
        assertEquals(doc.firstChild.internalSubset, null, &quot;internalSubset wrong (first test)&quot;);
        assertEquals(doc.documentElement.childNodes.length, 2, &quot;wrong number of children in HTML (first test)&quot;);
        assertEquals(doc.documentElement.firstChild.nodeName, &quot;HEAD&quot;, &quot;misplaced HEAD element (first test)&quot;);
        assertEquals(doc.documentElement.firstChild.childNodes.length, 1, &quot;wrong number of children in HEAD (first test)&quot;);
        assertEquals(doc.documentElement.firstChild.firstChild.tagName, &quot;TITLE&quot;, &quot;misplaced TITLE element (first test)&quot;);
        assertEquals(doc.documentElement.lastChild.nodeName, &quot;BODY&quot;, &quot;misplaced BODY element (first test)&quot;);
        assertEquals(doc.documentElement.lastChild.childNodes.length, 2, &quot;wrong number of children in BODY (first test)&quot;);
        assertEquals(doc.documentElement.lastChild.firstChild.tagName, &quot;SPAN&quot;, &quot;misplaced SPAN element (first test)&quot;);
        assertEquals(doc.documentElement.lastChild.lastChild.tagName, &quot;SCRIPT&quot;, &quot;misplaced SCRIPT element (first test)&quot;);
        // parent/child
        doc.open();
        doc.write(&quot;&lt;!DOCTYPE HTML PUBLIC \&quot;-//W3C//DTD HTML 4.01 Transitional//EN\&quot; \&quot;http://www.w3.org/TR/html4/loose.dtd\&quot;&gt;&lt;title&gt;&lt;\/title&gt;&lt;span&gt;&lt;script type=\&quot;text/javascript\&quot;&gt;&lt;\/script&gt;&lt;\/span&gt;&quot;);
        doc.close();
        assertEquals(doc.childNodes.length, 2, &quot;wrong number of children in #document (first test)&quot;);
        assertEquals(doc.firstChild.name, &quot;HTML&quot;, &quot;name wrong (second test)&quot;);
        assertEquals(doc.firstChild.publicId, &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;, &quot;publicId wrong (second test)&quot;);
        assertEquals(doc.firstChild.systemId, &quot;http://www.w3.org/TR/html4/loose.dtd&quot;, &quot;systemId wrong (second test)&quot;);
        assertEquals(doc.firstChild.internalSubset, null, &quot;internalSubset wrong (second test)&quot;);
        assertEquals(doc.documentElement.childNodes.length, 2, &quot;wrong number of children in HTML (second test)&quot;);
        assertEquals(doc.documentElement.firstChild.nodeName, &quot;HEAD&quot;, &quot;misplaced HEAD element (second test)&quot;);
        assertEquals(doc.documentElement.firstChild.childNodes.length, 1, &quot;wrong number of children in HEAD (second test)&quot;);
        assertEquals(doc.documentElement.firstChild.firstChild.tagName, &quot;TITLE&quot;, &quot;misplaced TITLE element (second test)&quot;);
        assertEquals(doc.documentElement.lastChild.nodeName, &quot;BODY&quot;, &quot;misplaced BODY element (second test)&quot;);
        assertEquals(doc.documentElement.lastChild.childNodes.length, 1, &quot;wrong number of children in BODY (second test)&quot;);
        assertEquals(doc.documentElement.lastChild.firstChild.tagName, &quot;SPAN&quot;, &quot;misplaced SPAN element (second test)&quot;);
        assertEquals(doc.documentElement.lastChild.firstChild.firstChild.tagName, &quot;SCRIPT&quot;, &quot;misplaced SCRIPT element (second test)&quot;);
      } finally {
        // prepare the file for the next test
        doc.open();
        doc.write(&quot;&lt;!DOCTYPE HTML PUBLIC \&quot;-//W3C//DTD HTML 4.01//EN\&quot;&gt;&lt;head&gt;&lt;title&gt;&lt;\/title&gt;&lt;style type=\&quot;text/css\&quot;&gt;img { height: 10px; }&lt;\/style&gt;&lt;body&gt;&lt;p&gt;&lt;img src=\&quot;data:image/gif;base64,R0lGODlhAQABAID%2FAMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw%3D%3D\&quot; alt=\&quot;\&quot;&gt;&quot;);
        doc.close();
      }
      return 5;
    },
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68840</commentid>
    <comment_count>8</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-01-30 13:52:50 -0800</bug_when>
    <thetext>It looks like this test depends on bug 12751.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68871</commentid>
    <comment_count>9</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2008-01-30 16:27:18 -0800</bug_when>
    <thetext>Yeah, sorry. ;-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68892</commentid>
    <comment_count>10</comment_count>
      <attachid>18810</attachid>
    <who name="Robert Blaut">webkit</who>
    <bug_when>2008-01-30 22:39:40 -0800</bug_when>
    <thetext>Created attachment 18810
test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71313</commentid>
    <comment_count>11</comment_count>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2008-02-20 14:51:47 -0800</bug_when>
    <thetext>Fixed.

</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>18810</attachid>
            <date>2008-01-30 22:39:40 -0800</date>
            <delta_ts>2008-01-30 22:39:40 -0800</delta_ts>
            <desc>test case</desc>
            <filename>test-case1.html</filename>
            <type>text/html</type>
            <size>310</size>
            <attacher name="Robert Blaut">webkit</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMCBUcmFuc2l0aW9uYWwv
L0VOIj48dGl0bGU+PC90aXRsZT48c3Bhbj5UaGVyZSBzaG91bGQgYmUgTk8gUkVEIG9uIHRoZSBw
YWdlPC9zcGFuPjxzY3JpcHQgdHlwZT0idGV4dC9qYXZhc2NyaXB0Ij5pZiAoZG9jdW1lbnQuY2hp
bGROb2Rlcy5sZW5ndGggIT0gMikgZG9jdW1lbnQud3JpdGUoIjxwIHN0eWxlPVwiYmFja2dyb3Vu
ZC1jb2xvcjpyZWRcIj5Eb2N1bWVudCBkb2VzIE5PVCBoYXZlIGV4cGVjdGVkIG51bWJlciBvZiBj
aGlsZE5vZGVzPC9wPiIpOzwvc2NyaXB0Pg==
</data>

          </attachment>
      

    </bug>

</bugzilla>