Open
Bug 278044
Opened 20 years ago
Updated 4 years ago
Selection.deleteFromDocument() should remove selection
Categories
(Core :: DOM: Selection, defect, P5)
Tracking
()
NEW
People
(Reporter: surkov, Unassigned)
Details
(Keywords: testcase)
Attachments
(2 files)
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8a5) Gecko/20041122 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8a5) Gecko/20041122 When I call deleteFromDocument() method then selected nodes are removed but selection remains. Reproducible: Always Steps to Reproduce:
| Reporter | ||
Comment 1•20 years ago
|
||
Note. Sometimes deleting of selected nodes may come to crach (see https://bugzilla.mozilla.org/show_bug.cgi?id=278042). Better to see the test case in previous mozilla builds (in instance firefox 1.7.3).
Comment 2•20 years ago
|
||
ccing some people who know something about selection, hopefully...
| Reporter | ||
Comment 3•19 years ago
|
||
You can see a problem when you call nsIRange::deleteContents() (nsISelection::deleteFromDocument() called nsIRange::deleteContents()). Actually selection is removed when range content is removed because window.selection.rangeCounts is equal 1 and selection.getRangeAt(0) is collapsed. But selection track is displayed.
| Reporter | ||
Comment 4•19 years ago
|
||
It seems the bug is lying in nsRange::CollapseRangeAfterDelete() method. Such behaviour you can get by using methods nsIRange::setStart() and nsIRange::setEnd(), in instance, if you set selection after removing charackter of textnode (see a testcase2). I'm not sure it is the same bug or not. ogub fi
| Reporter | ||
Comment 5•19 years ago
|
||
I'm not sure what component ('selection' or 'DOM: Traversal-Range') is right
component for this bug. Please move bug to more appropriate component. ro
Comment 6•19 years ago
|
||
This seems to work for me in current trunk build.
| Reporter | ||
Comment 7•19 years ago
|
||
I builded one day old seamonkey (SeaMonkey 1.5a Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a1) Gecko/20060405 SeaMonkey/1.5a). Testcases show a problem as before.
Comment 8•19 years ago
|
||
Yes, now I can see the bug too. It seems more like a painting problem to me. I think the selection is removed all right, but somehow there is still a selection painted. When I move with the caret through the still painted selection (which shouldn't be possible, because when you see a caret, you shouldn't see a selection too), the part where the caret was becomes unpainted.
Updated•15 years ago
|
Assignee: selection → nobody
QA Contact: selection
Comment 9•4 years ago
|
||
Bulk-downgrade of unassigned, >=5 years untouched DOM/Storage bugs' priority.
If you have reason to believe this is wrong (especially for the severity), please write a comment and ni :jstutte.
Severity: normal → S4
Priority: -- → P5
You need to log in
before you can comment on or make changes to this bug.
Description
•