Closed
Bug 9033
Opened 27 years ago
Closed 27 years ago
[PP] Getting selection as text does not work properly
Categories
(Core :: DOM: Editor, defect, P3)
Tracking
()
VERIFIED
WORKSFORME
M9
People
(Reporter: sfraser_bugs, Assigned: akkzilla)
Details
Outputting the selection as text via the nsIDocumentEncoder does not work
properly; it misses parts of the selected text nodes, and sometimes inluces bits
of nodes that are not selected.
To test this, use the 'Test Selection' item on the editor debug menu, and
note that the output under where is says 'Selection as text'.
| Assignee | ||
Updated•27 years ago
|
Status: NEW → ASSIGNED
Target Milestone: M8
| Assignee | ||
Comment 1•27 years ago
|
||
Will investigate for M8.
| Assignee | ||
Comment 2•27 years ago
|
||
I have a fix for one part of this -- nsDocument::IsInRange returns false for the
parent of the endpoint of the range, so the <p> tag around the final paragraph
in the selection doesn't make it into the XIF.
I have a fix for this in my tree -- but meanwhile, I can't reproduce the
original problem of text getting dropped or extra text getting added when doing
a Test Selection. Simon, do you still see this problem with Selection As Text?
I'm trying to decide whether checking in the fix for M8 is the right thing,
since it has the side effect of adding higher-up parent tags (like <body>)
around the selection when it's gotten as html.
| Assignee | ||
Updated•27 years ago
|
Summary: Getting selection as text does not work properly → [PP] Getting selection as text does not work properly
Target Milestone: M8 → M9
| Assignee | ||
Comment 3•27 years ago
|
||
This seems only to happen on the Mac; I can't reproduce it on Linux or NT. I
have code in my tree which will make this easier to debug, which will go in
post-M8, and then we can look at it on a Mac and figure out what's going wrong;
Simon and I agreed that this could wait until then.
| Assignee | ||
Updated•27 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 27 years ago
Resolution: --- → WORKSFORME
| Assignee | ||
Comment 4•27 years ago
|
||
Simon and I just spent some time looking at this in the Mac debugger. We came
to the conclusion that the string is actually correct, but the console window is
running in the wrong newline compability mode and so the output of Test
Selection isn't displaying correctly. (The html to text sink uses NS_LINEBREAK,
which is \015 for mac.) Copied/pasted plaintext seemed correct, as did the
string displayed in the debugger just prior to printing the output.
Simon and Mike (and Mac QA people), please keep an eye on this and don't
hesitate to reopen the bug if you have a reproducible case and are sure this
isn't a console display issue. In particular, keep an eye on copy/paste and
make sure that the text being pasted corresponds to what was copied.
You need to log in
before you can comment on or make changes to this bug.
Description
•