Closed Bug 545403 Opened 14 years ago Closed 14 years ago

[HTML5][Patch] dom/tests/mochitest/dom-level1-core/test_hc_documentgetdoctype.html fails

Categories

(Core :: DOM: HTML Parser, defect, P1)

x86
macOS
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: hsivonen, Assigned: hsivonen)

Details

Attachments

(1 file, 1 obsolete file)

dom/tests/mochitest/dom-level1-core/test_hc_documentgetdoctype.html fails. It expects the doctype name in different case.
Priority: -- → P1
Assignee: nobody → hsivonen
Status: NEW → ASSIGNED
Summary: [HTML5] dom/tests/mochitest/dom-level1-core/test_hc_documentgetdoctype.html fails → [HTML5][Patch] dom/tests/mochitest/dom-level1-core/test_hc_documentgetdoctype.html fails
The test and the old parser were previously changed to match a now-obsolete snapshot of the WHATWG spec. Now HTML5 has changed to lower-case the doctype name instead of upper-casing it.
Attachment #426666 - Attachment is obsolete: true
Attachment #428390 - Flags: review?(bnewman)
Comment on attachment 428390 [details] [diff] [review]
Change the test to accept both upper and lower case, with proper indent

>-                        // modified to uppercase per WHATWG
>-			assertEquals("nodeName","HTML",docTypeName);
>+			// Modified to allow lower case for the HTML5 parser and upper case for the old parser
>+			assertTrue("nodeName", "HTML" == docTypeName || "html" == docTypeName);

Alternatively, if you want to keep readability of assertion failure messages, you could do

    assertEquals("nodeName", "html", docTypeName.toLowerCase());

Your call.
Attachment #428390 - Flags: review?(bnewman) → review+
(In reply to comment #3)
> (From update of attachment 428390 [details] [diff] [review])
> >-                        // modified to uppercase per WHATWG
> >-			assertEquals("nodeName","HTML",docTypeName);
> >+			// Modified to allow lower case for the HTML5 parser and upper case for the old parser
> >+			assertTrue("nodeName", "HTML" == docTypeName || "html" == docTypeName);
> 
> Alternatively, if you want to keep readability of assertion failure messages,
> you could do
> 
>     assertEquals("nodeName", "html", docTypeName.toLowerCase());
> 
> Your call.

Thanks.

Pushed as is:
http://hg.mozilla.org/mozilla-central/rev/ee56d65affa3

toLowerCase() would allow "hTmL", which is unwanted.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: