Closed
Bug 91240
Opened 23 years ago
Closed 20 years ago
In view source, XML processing instructions end at the first > instead of at ?>
Categories
(Core :: DOM: HTML Parser, defect)
Core
DOM: HTML Parser
Tracking
()
RESOLVED
FIXED
People
(Reporter: WeirdAl, Assigned: mrbkap)
References
Details
(Keywords: testcase)
Attachments
(7 files, 1 obsolete file)
From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Win95; en-US; rv:0.9.2) Gecko/20010628 BuildID: Mozilla/5.0 (Windows; U; Win95; en-US; rv:0.9.2) Gecko/20010628 I created a valid XHTML 1.0 Transitional document with a PHP processing instruction. The PHP contained HTML tags which it would echo to the client. I had my Apache test server off, and PHP was thusly disabled. The page rendered as if all the tags except the first one were active XHTML tags, instead of being inactive as they should have been within the processing instruction. The view-source was particularly interesting. Some other minor glitches as well, which you will see in the first attachment I post to this bug. In the attachment, I have changed the <?php ?> to <?test ?>, on the assumption Bugzilla supports PHP. Reproducible: Always Steps to Reproduce: 1. Make sure any test servers you have for this are OFF. (Hopefully, Bugzilla doesn't run PHP. 2. View the first attachment, changeLog.xml. (Identical results as changeLog.htm) Actual Results: Mozilla renders all XHTML tags except the first within the processing instruction. Expected Results: Mozilla ignores the XHTML tags within the processing instruction. First attachment: the testcase Second attachment: screenshot of the testcase rendered Third attachment: screenshot of the view-source for the testcase.
Reporter | ||
Comment 1•23 years ago
|
||
Reporter | ||
Comment 2•23 years ago
|
||
Reporter | ||
Comment 3•23 years ago
|
||
Comment 4•23 years ago
|
||
The rendering wfm, win98 mozilla trunk build 2001071604. I believe what you are seeing is bug 88354, fixed on the trunk 2001-07-04. View Source, on the other hand, colors the syntax wrong, as shown in screenshot. Updating summary to that.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Moz attempts to render second XHTML tag inside PI → View source doesn't color PI completely
heh, bugzilla doesn't do php (yet), sometimes I wish it did though. Anyways, I think the problem is either multiline <? ?> is not handled properly or <? ?> is not handled at all but is treated as a normal tag like <test>, so <?test> and <?test <test> would be considered a tag by view source. Need better testcase.
Reporter | ||
Comment 6•23 years ago
|
||
Better testcase (found something more specific) <?xml version="1.0" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head><title></title> </head> <body> <p> <?test echo "3 > 2"; ?> </p> </body> </html> What the browser should output: What the browser outputs: 2"; ?> If the above isn't a dup, we have two bugs in this report.
Reporter | ||
Comment 7•23 years ago
|
||
Reporter | ||
Comment 8•23 years ago
|
||
Something very funny is going on here. The first testcase, when I looked at it offline, rendered. When I looked at the same case from Bugzilla, I got nothing on the screen at all. The fourth attachment, though, renders identically from my client and from Bugzilla. No idea why. Another thing I should note for the above testcase: It shows Moz in violation of XML 1.0 Second Edition, Section 2.6. A PI must end with "?>"; Moz is ending it at ">". I couldn't make much sense of the fixed bug above, but from the context it looks like this is a separate issue. I think the view-source is telling us the browser is ending the PI at the ">", and the bug may come before it gets to view-source.
Reporter | ||
Comment 10•23 years ago
|
||
See which, the miscoloring or the PI ending at > ??? I don't want to file another bug report or change the summary report on this one yet without knowing what we're looking at here. Is the view-source issue coming from within the view-source routines? Is the PI bug I've just found a dup or a new issue? Are the two related?
Comment 11•23 years ago
|
||
seeing both, with the "abbreviated" testcase. View source uses the parser for its syntax highlighting, so an error in the parser would affect both.
Comment 12•23 years ago
|
||
If I view the original testcase attachment 42670 [details] from bugzilla (text/xml) it renders right. The second testcase attachment 42684 [details] (text/html) renders "wrong" from bugzilla. Both testcases, saved locally as .xml or .xhtml render right.... saved as .html render "wrong". The mimetype (decided by file extension for local files) decides whether the document is treated as xml ( http://www.w3.org/TR/REC-xml#sec-pi ), or as html ( http://www.w3.org/TR/html401/appendix/notes.html#h-B.3.6 ) Messing with the summary again. The rendering is correct, view source is wrong.
Summary: View source doesn't color PI completely → view source should not treat xml files as html
Comment 13•23 years ago
|
||
Whoops. That's "the original testcase attachment 42668 [details] from bugzilla (text/xml)"
^^^^^
Reporter | ||
Comment 14•23 years ago
|
||
I'm willing to concede there's a bug in the way view-source shows up, but my second testcase, 42684, says there's a bug in how Moz handles processing instructions in the first place. The rendering is not correct as far as the processing instruction is concerned. Times like this, I wish Bugzilla would let us look at a particular file from multiple mime-types... ;) something like bugzilla.mozilla.org/showattachment.cgi?attach_id=42668&mime_type=text/html
Comment 15•23 years ago
|
||
Comment 16•23 years ago
|
||
OK. Looks like Tuuka is right based on that last testcase.
Reporter | ||
Comment 17•23 years ago
|
||
Verified -- ouch. :)
Comment 18•23 years ago
|
||
AIUI, PIs end with a single '>' in SGML/HTML, but with "?>" in XML. My fix for bug 57724 will handle both cases. *** This bug has been marked as a duplicate of 57724 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
Comment 19•23 years ago
|
||
Reopening 57724 dependencies for independent resolution.
Comment 21•22 years ago
|
||
*** Bug 179786 has been marked as a duplicate of this bug. ***
Comment 22•22 years ago
|
||
*** Bug 190330 has been marked as a duplicate of this bug. ***
Comment 23•22 years ago
|
||
Trying to view www.amazon.com.
Comment 24•21 years ago
|
||
*** Bug 226099 has been marked as a duplicate of this bug. ***
Comment 25•21 years ago
|
||
*** Bug 231590 has been marked as a duplicate of this bug. ***
Comment 26•20 years ago
|
||
*** Bug 189202 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 27•20 years ago
|
||
--> me. I have a patch for this. I'll attach it when I get a chance.
Assignee: c → mrbkap
Assignee | ||
Comment 28•20 years ago
|
||
I'm not entirely sure what the scope of this bug is. This patch ensures that all PIs are actually ended by a ?>. If there are SGML PIs that end with >, please let me know. If there are more issues with this, please open new bugs.
Assignee | ||
Comment 29•20 years ago
|
||
Comment on attachment 161115 [details] [diff] [review] patch v1 This ignores HTML PIs (http://w3.org/TR/html4/appendix/notes.html#h-B.3.6). I'll have a patch sometime later this week that accounts for these (note: this is a trivial change to this patch).
Attachment #161115 -
Attachment is obsolete: true
Assignee | ||
Comment 30•20 years ago
|
||
Changing summary to reflect what this bug is actually covering now.
Summary: view source should not treat xml files as html → In view source, XML processing instructions end at the first > instead of at ?>
Assignee | ||
Comment 31•20 years ago
|
||
This makes us correctly parse processing instructions in both HTML and XML.
Assignee | ||
Comment 32•20 years ago
|
||
Comment on attachment 161210 [details] [diff] [review] patch v2 Since bug 261503 is checked in, asking for reviews on this patch. (note: the patch may not apply completely cleanly, it may be off by 1 line).
Attachment #161210 -
Flags: review?(bzbarsky)
Assignee | ||
Updated•20 years ago
|
Attachment #161210 -
Flags: review?(bzbarsky) → review?(rbs)
Comment 33•20 years ago
|
||
Comment on attachment 161210 [details] [diff] [review] patch v2 r=rbs
Attachment #161210 -
Flags: review?(rbs) → review+
Assignee | ||
Comment 34•20 years ago
|
||
Comment on attachment 161210 [details] [diff] [review] patch v2 jst, could you give this sr= and check this in please?
Attachment #161210 -
Flags: superreview?(jst)
Comment 35•20 years ago
|
||
Comment on attachment 161210 [details] [diff] [review] patch v2 sr=jst
Attachment #161210 -
Flags: superreview?(jst) → superreview+
Assignee | ||
Comment 36•20 years ago
|
||
bz checked this in, marking FIXED.
Status: NEW → RESOLVED
Closed: 23 years ago → 20 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•