Closed
Bug 620267
Opened 14 years ago
Closed 14 years ago
All newlines immediately following a start <pre> tag get stripped
Categories
(Core :: DOM: HTML Parser, defect)
Core
DOM: HTML Parser
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
blocking2.0 | --- | betaN+ |
People
(Reporter: stanio, Assigned: neil)
References
Details
(Keywords: regression)
Attachments
(4 files)
580 bytes,
text/html
|
Details | |
1.40 KB,
patch
|
hsivonen
:
review+
|
Details | Diff | Splinter Review |
1.87 KB,
patch
|
jgriffin
:
review+
|
Details | Diff | Splinter Review |
386 bytes,
text/plain
|
Details |
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b9pre) Gecko/20101219 Firefox/4.0b9pre
Build Identifier: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b9pre) Gecko/20101219 Firefox/4.0b9pre
All newlines immediately following a start <pre> tag get ignored in HTML documents:
<pre>
Foo Bar</pre>
As far as I understand just the first newline following the start <pre> tag should be ignored <http://www.w3.org/TR/html5/grouping-content.html#the-pre-element>:
> In the HTML syntax, a leading newline character immediately following
> the pre element start tag is stripped.
Reproducible: Always
Reporter | ||
Comment 1•14 years ago
|
||
Renders:
foo
There should be three blank lines just before this line.
bar
[ Test ]
Hitting the "Test" (DOM value) button gives:
"There should be three blank lines just before this line.
"
Reporter | ||
Updated•14 years ago
|
Version: unspecified → Trunk
Updated•14 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression,
regressionwindow-wanted
OS: Windows 7 → All
Hardware: x86 → All
Regression range from Linux x86-64 nightlies is:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=83c887dff0da&tochange=d6bb0f9e9519
which is almost certainly the change to enable the HTML5 parser by default.
Keywords: regressionwindow-wanted
Comment 3•14 years ago
|
||
I'm surprised we didn't have test coverage for this. :-(
Assignee: nobody → hsivonen
Status: NEW → ASSIGNED
Comment 4•14 years ago
|
||
It's not actually all that surprising, given the nature of the bug.
I just tried to reproduce this by copy/pasting the source of the attachment and could not reproduce. Then I tried downloading the attachment from Bugzilla, and that does reproduce the bug.
The key seems to be the CR characters. If I change the file to just use Unix newlines (LF only), everything works fine. I would expect that's what our tests test....
When you do add a test for this, make sure to comment that it depends on the windows newlines?
blocking2.0: --- → ?
Reporter | ||
Comment 5•14 years ago
|
||
Sorry to spam the issue, but this was my source of finding the problem - does the text source from mail/news messages always contain CRLF line-endings, or it just happens to be on Windows?
Reporter | ||
Comment 6•14 years ago
|
||
> text source from mail/news messages
I mean with Thunderbird and SeaMonkey.
Comment 7•14 years ago
|
||
No idea what gunk mailnews generates!
Assignee | ||
Comment 8•14 years ago
|
||
The bug affects <textarea> too, of course. It's really weird; a textarea with N LFs before the first text (N >= 3) shows the text on the Nth line as expected; with a CR before the LFs you get the text on the N-1st line; with a CR after the first LF you get the text on the N-2nd line; with a CR after all the LFs you get the text on the N+1th line!
Assignee | ||
Updated•14 years ago
|
See Also: → http://bugzilla.validator.nu/show_bug.cgi?id=806
Assignee | ||
Comment 9•14 years ago
|
||
Assignee: hsivonen → neil
Attachment #499503 -
Flags: review?(hsivonen)
Updated•14 years ago
|
Attachment #499503 -
Flags: review?(hsivonen) → review+
Reporter | ||
Comment 10•14 years ago
|
||
See Bug 623288 for a similar (if not the same) problem.
Comment 12•14 years ago
|
||
I think it's pretty clear that this needs to block. Please land this?
blocking2.0: ? → betaN+
Assignee | ||
Comment 13•14 years ago
|
||
Pushed changeset 6f18c950b3b6 to mozilla-central.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•14 years ago
|
Flags: in-testsuite?
Comment 14•14 years ago
|
||
The bit binary patch is useless for review. I'll attach a more reviewable copy of those bits.
Attachment #501620 -
Flags: review?(jgriffin)
Comment 15•14 years ago
|
||
To see what's going on, you need to view this in a hex editor. :-(
Updated•14 years ago
|
Attachment #501620 -
Flags: review?(jgriffin) → review+
Comment 16•14 years ago
|
||
Flags: in-testsuite? → in-testsuite+
You need to log in
before you can comment on or make changes to this bug.
Description
•