Closed
Bug 90499
Opened 24 years ago
Closed 24 years ago
Can't delete selection if end of selection contains "<br>\n"
Categories
(Core :: DOM: Editor, defect, P2)
Core
DOM: Editor
Tracking
()
VERIFIED
FIXED
mozilla0.9.3
People
(Reporter: kinmoz, Assigned: kinmoz)
Details
(Whiteboard: [PDT+][reviewed][fixed on trunk][nsBranch+])
Attachments
(2 files)
145 bytes,
text/html
|
Details | |
746 bytes,
patch
|
Details | Diff | Splinter Review |
I ran across this little tidbit while looking at a problem file from clayton.
It's very common practice to click before the first character on a line and drag
the selection along the left edge of other lines to select more lines.
I noticed that when I did this in clayton's sample file, that when I hit delete,
none of the lines in the selection were actually deleted!!
What happened was the line below and outside the selection was joined with the
last line in the selection.
I was able to reduce the sample file to the following test case (which I will
attatch to this bug):
<html><body>Line 1<br>
Line 2<br></body></html>
Adding nsBranch keyword as per beppe. Cc jfrancis.
I just attatched a one-liner that fixes the problem. I just need to do some
testing to make sure it doesn't screw something up. :-)
Any testing help would be greatly appreciated.
Whiteboard: FIX IN HAND
Comment 5•24 years ago
|
||
r=brade
Comment 6•24 years ago
|
||
sr=waterson
FYI, the bug happens because nsHTMLEditRules::WillDeleteSelection() calls
nsWSRunObject::PrepareToDeleteRange(), which can generate transactions that
delete the insignificant whitespace at the ends of the selection, before the
actual DeleteSelection is done. These transactions cause the selection to be
collapsed, so when we actually do get around to deleting the selection, it acts
as a backspace. The patch adds an auto variable that tells these transactions
not to reset the selection.
Fix checked into the trunk:
mozilla/editor/base/nsHTMLEditRules.cpp revision 1.186
Fix should appear in the 07/19/01 QA builds.
Keywords: vtrunk
Assignee | ||
Comment 10•24 years ago
|
||
Adding nsBranch+ per beppe.
Whiteboard: FIX IN HAND → [reviewed][fixed on trunk][nsBranch+]
Comment 11•24 years ago
|
||
Kin, pls check into the branch. Thanks.
Whiteboard: [reviewed][fixed on trunk][nsBranch+] → [PDT+][reviewed][fixed on trunk][nsBranch+]
Comment 12•24 years ago
|
||
kin: weren't sure if you were around tonight, so I checked this in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 13•24 years ago
|
||
Thanks blake!
You need to log in
before you can comment on or make changes to this bug.
Description
•