Closed Bug 98218 Opened 23 years ago Closed 23 years ago

[DOCTYPE]mode detection for HTML doc with XML-decl is confused

Categories

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

x86
Linux
defect

Tracking

()

VERIFIED FIXED
mozilla0.9.7

People

(Reporter: dbaron, Assigned: harishd)

Details

(Whiteboard: [fix in hand])

Attachments

(3 files)

DESCRIPTION:  The mode detection for an HTML document that has an XML
declaration (a pseudo-PI) is confused.  It puts the parser into standard mode
but somehow layout stays in quirks mode:

http://www.bath.ac.uk/%7Epy8ieh/cgi/compat-test.pl?DOCTYPE=%3C%3Fxml+version%3D%221.0%22%3F%3E&MODE=full

The tests should not contradict each other -- they should show the same result as

http://www.bath.ac.uk/%7Epy8ieh/cgi/compat-test.pl?DOCTYPE=%3C%21DOCTYPE+HTML+PUBLIC+%22-%2F%2FW3C%2F%2FDTD+XHTML+1.0+Strict%2F%2FEN%22%3E&MODE=full
Note that this applies only to documents sent as text/html, not to ones sent as
text/xml.
I really don't know what's preventing the parser from propagating the mode to
layout, but I'm worried that it has something to do with "treating it as XML".
--> 0.9.5
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.5
Priority: -- → P3
QA Contact: bsharma → moied
--> 0.9.6
Target Milestone: mozilla0.9.5 → mozilla0.9.6
Out of time :-( Moving to 0.9.7
Target Milestone: mozilla0.9.6 → mozilla0.9.7
WFM if I add |<!DOCTYPE >|. AIUI layout gets the mode in
HTMLContentSink::AddDocTypeDecl() and stays in quirks mode if the content sink
gets no doctype node.
The mode should be determined in nsParser::DetermineParseMode.  (I wanted to
unify that with the doctype token handling, but the parser was just too
complicated.)
Whiteboard: [fix in hand]
Woo hoo!  A fix!
Keywords: patch
Comment on attachment 59405 [details] [diff] [review]
set layout mode whether a DOCTYPE exists or not

sr=jst
Attachment #59405 - Flags: superreview+
Comment on attachment 59405 [details] [diff] [review]
set layout mode whether a DOCTYPE exists or not

r=heikki
Attachment #59405 - Flags: review+
FIXED.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
verified fixed with build ID 20020117 on win2k and fix checked in cvs (rev 3.502)

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: