Closed
Bug 140690
Opened 24 years ago
Closed 22 years ago
createTextNode turns double newlines into triple newlines (windows-only)
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jruderman, Unassigned)
Details
(Keywords: platform-parity, Whiteboard: [good first bug])
Attachments
(2 files, 1 obsolete file)
|
1.09 KB,
text/html
|
Details | |
|
1.05 KB,
patch
|
jst
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
| Reporter | ||
Comment 1•24 years ago
|
||
| Reporter | ||
Comment 2•24 years ago
|
||
Even though the summary is "createTextNode turns double newlines into triple
newlines", I think something more complicated is going on. When I combine this
with bug 140692 ("script.innerHTML doubles all newlines") in attachment 81357 [details],
createTextNode turns some of bug 140692's double newlines back into normal newlines!
Comment 4•22 years ago
|
||
The three cells in the testcase are in fact identical. Is this still an issue?
| Reporter | ||
Comment 5•22 years ago
|
||
They're not identical for me in Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.8a) Gecko/20040508 Firefox/0.8.0+.
Comment 6•22 years ago
|
||
Oh, I see. innerHTML converts DOM-standard newlines (which happen to be Unix
newlines) into platform-specific ones (this is WRONG) and then createTextNode
doesn't convert them back (this is fine).
innerHTML should not be doing newline conversion.
Adding nsIDocumentEncoder::OutputLFLineBreak to the flags when we init the
serializer in nsGenericHTMLElement::GetInnerHTML should fix this, probably.
Someone with Windows would have to patch and test.
Keywords: pp
Summary: createTextNode turns double newlines into triple newlines → createTextNode turns double newlines into triple newlines (windows-only)
Whiteboard: [good first bug]
Comment 7•22 years ago
|
||
Ok, you mean this? This seems to fix the testcase.
Updated•22 years ago
|
Attachment #150010 -
Flags: review?(jst)
Adding in binary is generally FOO | BAR, not swapping FOO for BAR.
Updated•22 years ago
|
Attachment #150010 -
Flags: review?(jst) → review-
Comment 9•22 years ago
|
||
Yeah, if you'd | in the new flags with the existing flags, I'd sr this patch...
Comment 10•22 years ago
|
||
Ehm, yes, that was stupid of me. I was trying to find out what I broke by
leaving out the original flag (I still don't know), that's why the second,
corrected patch took so long.
Patches from a n00b, but you've probably guessed that already :)
Attachment #150010 -
Attachment is obsolete: true
Updated•22 years ago
|
Attachment #150386 -
Flags: review?(jst)
Comment 11•22 years ago
|
||
Comment on attachment 150386 [details] [diff] [review]
Patch2
r+sr=jst, thanks for fixing this! (let me know if you need help with checking
this into the tree).
Attachment #150386 -
Flags: superreview+
Attachment #150386 -
Flags: review?(jst)
Attachment #150386 -
Flags: review+
Comment 12•22 years ago
|
||
(In reply to comment #11)
> (From update of attachment 150386 [details] [diff] [review])
> r+sr=jst, thanks for fixing this! (let me know if you need help with checking
> this into the tree).
Yes, I need help with that. Thank you!
Comment 13•22 years ago
|
||
Fix checked in, thanks again for the fix!
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Component: DOM: HTML → DOM: Core & HTML
QA Contact: stummala → general
You need to log in
before you can comment on or make changes to this bug.
Description
•