Closed
Bug 265814
Opened 20 years ago
Closed 20 years ago
The output of document.write() is always (first) parsed in quirks mode
Categories
(Core :: DOM: HTML Parser, defect)
Core
DOM: HTML Parser
Tracking
()
RESOLVED
FIXED
People
(Reporter: mrbkap, Assigned: mrbkap)
Details
Attachments
(3 files, 1 obsolete file)
|
334 bytes,
text/html
|
Details | |
|
1016 bytes,
patch
|
bzbarsky
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
|
979 bytes,
patch
|
Details | Diff | Splinter Review |
I came across this when investigating bug 165323. Basically, when we come across a document.write() in the body, we try to parse just the contents of that write() as their own block. That parse is always performed in quirks mode in the parser. If the parse fails for any reason (such as an unclosed comment) the data is then inserted into the regular input stream, and parsed in standards mode. I'll attach a testcase shortly.
| Assignee | ||
Comment 1•20 years ago
|
||
| Assignee | ||
Comment 2•20 years ago
|
||
The last testcase was sort of unclear (it showed the problem, but in a roundabout way). This one is much more self-explanatory.
Attachment #163181 -
Attachment is obsolete: true
| Assignee | ||
Comment 3•20 years ago
|
||
This patch ensures that we bring over the DTD mode from the last context (since nsHTMLDocument::WriteCommon() doesn't send one in). I'm not sure if we can get here without a mPrevContext for the new parsercontect, so I'm not sure if the else clause is strictly necessary, but I thought it wouldn't hurt to be defensive.
| Assignee | ||
Comment 4•20 years ago
|
||
Comment on attachment 163184 [details] [diff] [review] patch v1 bz, since you know about this, I'll ping you for r (and maybe sr?)=.
Attachment #163184 -
Flags: review?(bzbarsky)
Comment 5•20 years ago
|
||
Comment on attachment 163184 [details] [diff] [review] patch v1 r=bzbarsky if you only do the preservation thing when |aMode == eDTDMode_autodetect|. jst, would you sr?
Attachment #163184 -
Flags: superreview?(jst)
Attachment #163184 -
Flags: review?(bzbarsky)
Attachment #163184 -
Flags: review+
| Assignee | ||
Comment 6•20 years ago
|
||
Comment 7•20 years ago
|
||
Comment on attachment 163184 [details] [diff] [review] patch v1 sr=jst
Attachment #163184 -
Flags: superreview?(jst) → superreview+
| Assignee | ||
Comment 8•20 years ago
|
||
Checked in.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•