Closed Bug 60511 Opened 24 years ago Closed 23 years ago

[DOCTYPE] Should activate standards layout for ISO doctypes

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla1.0

People

(Reporter: hsivonen, Assigned: dbaron)

References

Details

(Whiteboard: [Hixie-P5] easy fix)

Attachments

(1 file)

(This is seems to be covered in bug 44340, but that "enhancement" is futured and
I think this issue deserves to be tracked separately.)

Currently, Mozilla triggers the quirks layout mode when an ISO/IEC 15445:2000
 doctype declaration is used. This is a Bad Thing. ISO/IEC 15445:2000 is
stricter than HTML 4 Strict.

The standards layout mode should be activated for these doctype declarations:
<!DOCTYPE HTML PUBLIC "ISO/IEC 15445:2000//DTD HyperText Markup Language//EN">
<!DOCTYPE HTML PUBLIC "ISO/IEC 15445:2000//DTD HTML//EN">
(regardless of a possible system identifier such as
"ftp://ftp.cs.tcd.ie/isohtml/15445.dtd")
Blocks: 34662
Keywords: mozilla0.9
Perhaps also covered by bug 55264?
Depends on: 55264
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.1
updated qa contact.
QA Contact: janc → bsharma
*** Bug 70908 has been marked as a duplicate of this bug. ***
ISO/IEC 15445:2000 is almost the same as ISO/IEC 15445:1999, and at present
Mozilla treats 15445:1999 as a strict mode.  I think that we should not
distinguish these two DTDs.  I've made a patch to fix this bug.

Index: nsParser.cpp
===================================================================
RCS file: /cvsroot/mozilla/htmlparser/src/nsParser.cpp,v
retrieving revision 3.239
diff -u -r3.239 nsParser.cpp
--- nsParser.cpp	2001/03/10 21:01:03	3.239
+++ nsParser.cpp	2001/03/15 06:37:16
@@ -752,7 +752,7 @@
               else {

                   //now check for strict ISO/IEC OWNER...
-
if(kNotFound!=aBuffer.Find("15445:1999",PR_FALSE,theOffset,theDTDPos-theTokenizer.mOffset))
{
+
if(kNotFound!=aBuffer.Find("15445:",PR_FALSE,theOffset,theDTDPos-theTokenizer.mOffset))
{
                   thePublicID=eDTDMode_strict;  //this ISO/IEC DTD is always
strict.
                   aDocType=eHTML4Text;
                 }
@@ -911,7 +911,7 @@
       PRInt32 theStartPos=theSubIndex+5;
       PRInt32 theCount=theEnd-theStartPos;

-      if(kNotFound!=aBuffer.Find("ISO/IEC
15445:1999",PR_TRUE,theIndex,theEnd-theIndex)) {
+      if(kNotFound!=aBuffer.Find("ISO/IEC
15445:",PR_TRUE,theIndex,theEnd-theIndex)) {
           //per spec, this DTD is always strict...
         aParseMode=eDTDMode_strict;
         aDocType=eHTML4Text;

This bug doesn't seem to be a higher priority compared to the rest of my m0.9.1
bugs. Moving to m0.9.2. 
Target Milestone: mozilla0.9.1 → mozilla0.9.2
Whiteboard: [Hixie-P5] easy fix
Priority: P3 → P2
moving to 0.9.3
Target Milestone: mozilla0.9.2 → mozilla0.9.3
Moving to more realistic target - m0.9.4!
Target Milestone: mozilla0.9.3 → mozilla0.9.4
[timeless] any reason not to treat _all_ iso doctypes as strict?
<choess> timeless: I doubt it. anyone writing even HTML 2.0-equivalent with an 
ISO doctype probably knows how to DTRT.

anyways, there's a patch, there's no reason for this bug to be continuously 
pushed out w/o consideration. would someone please review it and address my 
question [which would codewise be equivalent to suggesting:
|+ if(kNotFound!=aBuffer.Find("ISO/IEC ",PR_TRUE,theIndex,theEnd-theIndex)) {|]
Keywords: approval, patch, review
Notes on bug: we should probably recognize anything that says "ISO/IEC 15445"
for the purposes of doctype sniffing.  15445 is the ISO standard for HTML, and
it gets updated periodically as HTML is updated, so a different number won't
suddenly appear (unlike RFCs).  While "number:year" is the currently canonical
way to date a specification, "number-year" was an old syntax; I think this was
changed before SGML was invented, but I don't see any harm in not bothering to
check the character after "15445".
To clarify slightly my previous comment, I don't think we should recognize all
ISO doctypes; I doubt anything with a different ISO number will come over the
wire as text/html, but checking number just seems more like the Right Thing to do.
r=hixie on the attached patch
Target Milestone: mozilla0.9.4 → mozilla1.0
I'm very concerned that the patch on this bug has been rotting here. 
Considering this, I think even more strongly than I did before that we need to
do our DOCTYPE detection the other way around -- have a list of doctypes that
trigger quirks mode, and let all unknown doctypes trigger strict mode.

So I'm going to take bug 55264, and I intend to fix it for 0.9.5.
taking
Assignee: harishd → dbaron
Status: ASSIGNED → NEW
Fixed with the checkin for bug 55264, 2001-09-08 11:37 PDT.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
QA Contact: bsharma → moied
Verified on OS X (2002040809) and Solaris (2002031500) with ISO HTML doctypes,
1999 and 2000 versions, long and short public ids, with and without a system
identifier. Also verified using a fictitious public id with a future  year.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: