Closed Bug 57999 Opened 24 years ago Closed 24 years ago

XML that is NOT well formed is displayed when a certain stylesheet is applied.

Categories

(Core :: XML, defect, P3)

defect

Tracking

()

VERIFIED FIXED
mozilla0.8

People

(Reporter: chrispetersen, Assigned: harishd)

Details

(Whiteboard: [rtm-][fix in hand]R=nisheeth, sr=vidur)

Attachments

(3 files)

Build: 2000102508
Platform: All
Expected Results: The parser error should occur.
What I got: The document's content is rendered (with style applied).

Steps to reproduce:

1) Save attached xml and css documents:

2) Open the xml document in N6.

3) The document's content is rendered.

4) Since the document is not well-formed, a parser error should be displayed.
Attached file a stylesheet
This problem occurs if the stylesheet is referenced in the xml file (whether or
not the css href can be found). If you remove the xml-stylement declaration, the
parser will display the error properly.
Basically, the xml document must not be well-formed and have a stylesheet
applied to reproduce this bug.
Nominating this bug.
Keywords: rtm
IE 5 (Mac) displays a parser error when attempting this xml document. The 
following tags are not closed: main. 
Updated the severity to major. XML applications MUST report well-formedness errors.
Severity: normal → major
Looking at this issue further, the problem only occurs if the root element is 
missing the end tag. If a child element (inside the well-formed root element) is 
missing a end tag, you get a parser error.
Marking this rtm need info.  About to look at it.
Status: NEW → ASSIGNED
Whiteboard: [rtm need info]
The problem here is that when the stylesheet PI is included in the attached XML 
document, the expat tokenizer's DidTokenize() method is never called with the 
aIsFinalChunk parameter set to true.  Because of this, expat keeps thinking that 
more content is about to come down the pipe and does not throw an error.

When the stylesheet PI is removed, the DidTokenize() method *is* called with the 
aIsFinalChunk parameter set to true and expat throws an error.  This is the 
right behavior.

We need to figure out why, when the stylesheet PI is included, DidTokenize() is 
never called with aIsFinalChunk set to true.

Over to Harish.
Assignee: nisheeth → harishd
Status: ASSIGNED → NEW
Attached patch Proposed fix.Splinter Review
This needs a r= and a sr= to make it in.

Changing the summary to make the severity more important.
Summary: With the stylesheet applied , the browser will rendered a document that's not well-formed. → XML that is NOT well formed is displayed when a certain stylesheet is applied.
Whiteboard: [rtm need info] → [rtm need info] NEEDS R=, NEED SR=
umm /s/important/apparant/g
Nisheeth and I went thro' the patch and we're not completely comfortable with 
it. Will work on it.
Status: NEW → ASSIGNED
The fix is correct. It passes on the same state that we'd get through other
codepaths when the stream has ended. I've asked Harish to run the XML test suite
and also see whether we hit this case while loading up chrome. I do have
reservations about its importance for rtm, but if it precludes us from showing
well-formedness errors at all for most XML files, it should be fixed.

sr=vidur
Whiteboard: [rtm need info] NEEDS R=, NEED SR= → [rtm need info] NEEDS R=, sr=vidur
r=nisheeth.  Marking rtm+.  This is important because it prevents us from
displaying an XML error for certain classes of non well formed XML pages.  One
of the major design goals of XML is to avoid the proliferation of erroneous XML
content on the web by ensuring that every XML processor rejects such content
outright.  We will be doing the web and the XML community a disservice if we
don't fix this bug.  Please accept Harish's patch.
Whiteboard: [rtm need info] NEEDS R=, sr=vidur → [rtm+] NEEDS R=, sr=vidur
Updating status whiteboard.
Whiteboard: [rtm+] NEEDS R=, sr=vidur → [rtm+] R=nisheeth, sr=vidur
rtm-, not ship stopper.
Whiteboard: [rtm+] R=nisheeth, sr=vidur → [rtm-] R=nisheeth, sr=vidur
Whiteboard: [rtm-] R=nisheeth, sr=vidur → [rtm-][fix in hand]R=nisheeth, sr=vidur
Target Milestone: --- → mozilla0.8
Fix landed. Marking FIXED.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Fixed in the Feb 26th build.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: