Closed Bug 363883 Opened 18 years ago Closed 17 years ago

<!*DOCTYPE html> must not trigger strict mode

Categories

(Core :: DOM: HTML Parser, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9alpha5

People

(Reporter: moz, Assigned: MatsPalmgren_bugz)

Details

(Keywords: testcase)

Attachments

(3 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061214 Minefield/3.0a1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061214 Minefield/3.0a1

Doctypes with 1 space or other digit after "<!" trigger strict mode, but must not:

<!*DOCTYPE html> 
<!xDOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">

This bug is years old.


Reproducible: Always

Steps to Reproduce:
1. see upcoming testcase
Actual Results:  
displaying "CSS1Compat"

Expected Results:  
displaying "BackCompat"
Attached file testcase
Test results:

     FF O9 IE7
 1:  b  s  s  <!DOCTYPE>
 2:  b  s  s  <!DOCTYPEz>
 3:  b  b  b  <! DOCTYPE>
 4:  b  b  b  <!zDOCTYPE>
 5:  s  s  s  <!DOCTYPEHTML>
 6:  b  s  s  <!DOCTYPEz HTML>
 7:  s  s  s  <!DOCTYPE HTML>
 8:  s  b  b  <!zDOCTYPE HTML>
 9:  b  s  s  <!DOCTYPE HTMLz>
10:  s  s  s  <!DOCTYPE zHTML>
11:  s  s  s  <!DOCTYPE XHTML>
12:  b  s  s  <!DOCTYPE zzHTML>
13:  s  s  s  <!DOCTYPEzHTML>
14:  b  s  s  <!DOCTYPEzzHTML>
15:  b  s  s  <!DOCTYPE "bla">
16:  b  s  s  <!DOCTYPE HTML "bla">
17:  b  s  s  <!DOCTYPE HTML "html">
18:  b  s  s  <!DOCTYPE PUBLIC>
19:  b  s  s  <!DOCTYPE PUBLIC "bla">
20:  b  s  s  <!DOCTYPE PUBLIC "html">
21:  s  s  s  <!DOCTYPE HTML PUBLIC "bla">
22:  b  b  s  <!DOCTYPE HTML PUBLIC "html">
23:  b  b  s  <!DOCTYPEz HTML PUBLIC "html">
24:  b  s  b  <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//en">
25:  b  b  b  <!DOCTYPEz HTML PUBLIC "-//IETF//DTD HTML 3.2//en">
26:  b  b  b  <!DOCTYPE HTMLz PUBLIC "DTD HTML 3.2">
27:  b  s  b  <!DOCTYPE "DTD HTML 3.2">

FF:  Firefox 20061211 on Linux
O9:  Opera9 on Linux
IE7: IE7 on Vista RC2
b:   BackCompat
s:   CSS1Compat
Assignee: mrbkap → mats.palmgren
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: testcase
OS: Windows XP → All
Hardware: PC → All
Attached patch Patch rev. 1Splinter Review
This patch changes the test result in 8, 10, 11 and 13 to 'b'.
It also changes the DOM for <!*DOCTYPE> (where * is any non-empty string)
which currently produces a doctype node to be a comment node instead.
Attachment #248734 - Flags: superreview?(dbaron)
Attachment #248734 - Flags: review?(mrbkap)
Comment on attachment 248734 [details] [diff] [review]
Patch rev. 1

Sorry it took me so long to get to this.
Attachment #248734 - Flags: review?(mrbkap) → review+
Flags: blocking1.9?
Not a blocker, but lets try to get it in since there's a patch.
Flags: blocking1.9? → blocking1.9-
Whiteboard: [wanted-1.9]
Attachment #248734 - Flags: superreview?(dbaron) → superreview?(jst)
Comment on attachment 248734 [details] [diff] [review]
Patch rev. 1

sr=jst
Attachment #248734 - Flags: superreview?(jst) → superreview+
Checked in to trunk at 2007-05-08 05:19 PDT.

-> FIXED
Status: NEW → RESOLVED
Closed: 17 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9alpha5
Attached patch Mochitest, rev. 1 (obsolete) — Splinter Review
Add mochitest parser/htmlparser/tests/mochitest/test_compatmode.html
testing the DOCTYPEs in comment 2.
Let me know if you have some more interesting ones I should add...
Attachment #264100 - Flags: review?(dbaron)
Comment on attachment 264100 [details] [diff] [review]
Mochitest, rev. 1

r=dbaron; this approach looks great.  Sorry for not getting to it quickly.

One comment is that it might be a little cleaner if you used an object rather than an array, i.e.,:
'<!DOCTYPE>': 'BackCompat",
etc.  (Not sure why you're doing the '+' bit either.)

(Feel free to fix, or not fix, any of that, and land with out additional review.)
Attachment #264100 - Flags: review?(dbaron) → review+
Flags: wanted1.9+
Whiteboard: [wanted-1.9]
Attachment #264100 - Attachment is obsolete: true
mozilla/parser/htmlparser/tests/mochitest/Makefile.in 	1.8
mozilla/parser/htmlparser/tests/mochitest/test_compatmode.html 	1.1 
Flags: in-testsuite? → in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: