Closed
Bug 321484
Opened 19 years ago
Closed 15 years ago
CRs (\r) in HTML comments should be removed by the parser
Categories
(Core :: DOM: HTML Parser, defect, P3)
Core
DOM: HTML Parser
Tracking
()
RESOLVED
FIXED
People
(Reporter: uriber, Unassigned)
References
Details
(Whiteboard: [fixed by the HTML5 parser])
Attachments
(1 file)
109 bytes,
text/html
|
Details |
Currently, Carriage Returns (0x0d, \r) inside HTML comments are left intact by the HTML parser, and therefore may appear in comment nodes in the DOM.
According to bz (bug 319705 comment #12): "The DOM newline character is LF. All CRs should be removed or converted to LFs by the parser."
Reporter | ||
Updated•19 years ago
|
Summary: CRs (\r) in HTML comments should be removed when parsing → CRs (\r) in HTML comments should be removed by the parser
Reporter | ||
Comment 1•19 years ago
|
||
This testcase has comment lines ending with CRLF, CR, and LF. The content dump from this testcase is:
html@0x2220b2a0 refcount=5<
head@0x206ea020 refcount=2<
Text@0x206ee970 refcount=1<\n\n>
Comment@0x206ee9f0 refcount=1<!--\nline with CRLF\r\nline with CR\rline with LF\nAnother line\n-->
>
body@0x206eea80 refcount=3<
Text@0x206f23c0 refcount=2<\n\n>
>
>
Notice the \r\n, \r, and \n.
![]() |
||
Comment 2•19 years ago
|
||
Yeah, compare CTextToken::Consume and ConsumeUntil in nsHTMLTokens.cpp (both of which do the right thing with CR) with CCommentToken::Consume (which does not).
Perhaps we should push the CR handling up to a higher level in the scanner so that individual tokens don't have to deal with it (that is, so they only ever see LF)?
Comment 3•19 years ago
|
||
What's the proper content model for something like <a title=" ">? That is, should we be converting newline entities as well?
Converting newlines in the scanner does sound like the right thing to do. I think we have this problem with PIs, doctype decls, and some other tokens as well.
![]() |
||
Comment 4•19 years ago
|
||
> That is, should we be converting newline entities as well?
See bug 197075. So "probably yes".
Comment 5•19 years ago
|
||
Sounds like a plan, then.
Priority: -- → P3
Target Milestone: --- → mozilla1.9alpha
Reporter | ||
Updated•17 years ago
|
Target Milestone: mozilla1.9alpha1 → ---
Updated•16 years ago
|
Assignee: mrbkap → nobody
Updated•16 years ago
|
Depends on: html5-parsing
Comment 6•15 years ago
|
||
See bug 557197 about .
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Whiteboard: [fixed by the HTML5 parser]
You need to log in
before you can comment on or make changes to this bug.
Description
•