Closed
Bug 50497
Opened 24 years ago
Closed 24 years ago
Missing newlines in TXT output
Categories
(Core :: DOM: Serializers, defect, P3)
Core
DOM: Serializers
Tracking
()
VERIFIED
FIXED
mozilla0.9
People
(Reporter: BenB, Assigned: mozeditor)
Details
(Keywords: helpwanted, Whiteboard: (#nsid))
Attachments
(6 files)
9.50 KB,
patch
|
Details | Diff | Splinter Review | |
1.04 KB,
text/plain
|
Details | |
5.48 KB,
text/plain
|
Details | |
8.98 KB,
patch
|
Details | Diff | Splinter Review | |
5.32 KB,
text/plain
|
Details | |
1.06 KB,
text/plain
|
Details |
Reproduce: 1. Open new html msg 2. Enter 5 lines of text 3. mark (parts of) lines 2-4 4. ul 5. goto end of line 4 6. hit return twice 7. enter some text 8. Debug|OutputText Actual result: zuitzuitzuizui * tzu7izuizui * tzuitzuitzui * tzuitzuizui zuitzuitzuitzui Expected result: zuitzuitzuizui * tzu7izuizui * tzuitzuitzui * tzuitzuizui zuitzuit zuitzui Additionoal comments: Debug->OutpufXIF shows: <content>zuitzuit</content> <leaf isa="br"> <attr name="_moz_dirty" value=""/> <attr name="type" value="_moz"/> </leaf><!--br--> <content>zuitzui</content> <leaf isa="br"> <attr name="_moz_dirty" value=""/> </leaf><!--br--> Note the "type=_moz". What's that??? It seems that this won't output in the TXT sink, but the HTML sink. WHo I found this: I just sent a mail with an ul and a line directly after it (created similar to above), but out came * foo * bar baz (note the indention of the last line).
Comment 1•24 years ago
|
||
If there's a br type=_moz being inserted where it shouldn't be, that would be Joe's domain (but I'm staying on the cc list in case I misunderstood something).
Assignee: akkana → jfrancis
Reporter | ||
Updated•24 years ago
|
Keywords: correctness,
nsbeta3
Reporter | ||
Comment 4•24 years ago
|
||
Beppe, this is data corruption, and not even hard to run in.
Severity: normal → major
Whiteboard: [nsbeta3-]
Comment 5•24 years ago
|
||
there isn't loss of data, there is a workaround (as painful as it may be) and joe is just too overloaded for b3, if we can get help -- great. i did put this to m19 and not future
Whiteboard: [nsbeta3-]
Reporter | ||
Comment 6•24 years ago
|
||
beppe, the problem is that you won't see that anything is wrong until you sent it.
Comment 7•24 years ago
|
||
The Debug->OutputXIF stuff is internal, don't worry about the _moz_xxx stuff. BenB: The problem is that HTML->Text conversion is failing to render newlines correctly? Does this happen with all newlines? What is the exact pattern?
Whiteboard: [nsbeta3-] → [nsbeta3-] (#nsid)
Updated•24 years ago
|
Keywords: helpwanted
Reporter | ||
Comment 8•24 years ago
|
||
Ian, the HTML->TXT converter is correct, I checked it.
Assignee | ||
Comment 9•24 years ago
|
||
I'll try to look at this when I get the chance...
Status: NEW → ASSIGNED
Comment 10•24 years ago
|
||
marking as future, this is not a pull-it-off-the-wire bug
Target Milestone: M19 → Future
Reporter | ||
Updated•24 years ago
|
Keywords: mozilla0.9
Assignee | ||
Comment 12•24 years ago
|
||
Assignee | ||
Comment 13•24 years ago
|
||
Assignee | ||
Comment 14•24 years ago
|
||
Assignee | ||
Comment 15•24 years ago
|
||
attached patch + new files is the fix. New files are because I took this august occassion to factor the redundant copy code out of nsPresShell.cpp and nsAutoCopy.cpp and put it in one place. Only there wasn't a good place, so I created a new source file that implements an nsCopySupport class (very simple class: one static method). The fix is to make sure that we query the encoder for what mime type is REALLY used, since it may change it to plaintext out from under you. requesting review and sr. akkana? simon?
Whiteboard: [nsbeta3-] (#nsid) → fix in hand; need review (#nsid)
Comment 16•24 years ago
|
||
You could replace rv = nsComponentManager::CreateInstance(kCTransferableCID, nsnull, NS_GET_IID(nsITransferable), getter_AddRefs(trans)); with trans = do_CreateInstance(kCTransferableCID, &rv); Otherwise, it looks fine. sr=sfraser.
Comment 17•24 years ago
|
||
Should kHTMLContext and kHTMLInfo be defined in a more global place in case anyone else might want to try using them? In nsAutoCopy, you don't need to do if (NS_FAILED(rv)) return rv; return rv; you can just return rv, or return nsCopySupport::HTMLCopy(aSel, doc). Uh-oh -- I'm getting asserts every time I mouse over the window: ###!!! ASSERTION: NS_ENSURE_TRUE(NS_SUCCEEDED(rv)) failed: '(!((rv) & 0x80000000))', file nsDocumentEncoder.cpp, line 908 Sorry, I told Joe earlier that the patch was working fine in my tree, but it turns out that I had backed it out and hadn't re-applied it. This assert is complaining that it didn't get the unicode encoder; what that has to do with Joe's code I don't see, but it was the only change I made this time. I'll poke around and try to figure out what's going on.
Comment 18•24 years ago
|
||
I bet the asserts are because I didn't rebuild outside layout, so all the other libraries are confused about the atom definitions due to the new atoms that were added. I'm rebuilding from the top.
Comment 19•24 years ago
|
||
Rebuilt, the assert is gone, but copy can no longer paste to external apps. Paste to editors inside mozilla still works.
Comment 20•24 years ago
|
||
Autocopy broke because autocopy used to do mClipboard->SetData(trans, nsnull, nsIClipboard::kSelectionClipboard); while now it calls nsCopySupport::HTMLCopy() which does: clipboard->SetData(trans, nsnull, nsIClipboard::kGlobalClipboard); It's copying to the wrong clipboard. Looks like HTMLCopy() needs to take an argument indicating which of the two clipboards to copy to, and then nsAutoCopy can pass in nsIClipboard::kSelectionClipboard while nsPresShell can pass nsIClipboard::kGlobalClipboard.
Assignee | ||
Comment 21•24 years ago
|
||
ok, so maybe that common code wasslightly less common than I thought. Here is a tweaked set of diffs/new files.
Assignee | ||
Comment 22•24 years ago
|
||
Assignee | ||
Comment 23•24 years ago
|
||
Assignee | ||
Comment 24•24 years ago
|
||
Comment 25•24 years ago
|
||
I'm having trouble getting the patch to compile, because I think it's dependant on my having patches for some of the other bugs Joe is working on, and I just deleted some of those so that I could re-apply this one. So I can't test it, but it looks like exactly the right thing. r=akkana (but if you can mail me a copy of nsDocumentEncoder.cpp I can probably test it -- I think I probably have the rest).
Assignee | ||
Comment 26•24 years ago
|
||
fixed
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Whiteboard: fix in hand; need review (#nsid) → (#nsid)
Comment 27•24 years ago
|
||
nsCopySupport.h:33: warning: file does not end in newline
Reporter | ||
Comment 28•23 years ago
|
||
Using the reproduction steps mentioned in the description, this is fixed for me (i.e. "vrfyed"). Tested with Mozilla 0.8 Linux build.
You need to log in
before you can comment on or make changes to this bug.
Description
•