Closed
Bug 1386342
Opened 7 years ago
Closed 7 years ago
Add a special case to Selection::Collapse() to detect the no-op case where a selection is being collapsed onto itself and do nothing in that case
Categories
(Core :: DOM: Core & HTML, enhancement)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
INVALID
People
(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
No description provided.
Assignee | ||
Comment 1•7 years ago
|
||
Attachment #8892545 -
Flags: review?(bzbarsky)
Comment 2•7 years ago
|
||
Comment on attachment 8892545 [details] [diff] [review]
Add a special case to Selection::Collapse() to detect the no-op case where a selection is being collapsed onto itself and do nothing in that case
r=me
Attachment #8892545 -
Flags: review?(bzbarsky) → review+
Comment 3•7 years ago
|
||
Why is the patch right when there are several ranges in selection?
And isn't collapse suppose to replace the range object from JS point of view.
See "// we should reuse it for reducing the recreation cost."
Updated•7 years ago
|
Flags: needinfo?(ehsan)
Assignee | ||
Comment 4•7 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #3)
> Why is the patch right when there are several ranges in selection?
Oh yeah, that's a bug. We don't have a test to catch it unfortunately. :-/
> And isn't collapse suppose to replace the range object from JS point of view.
> See "// we should reuse it for reducing the recreation cost."
Does this matter for nsFrameSelection objects we create for nsTextEditorState? The selection objects inside those aren't exposed to content JS.
Assignee | ||
Updated•7 years ago
|
Flags: needinfo?(ehsan) → needinfo?(bugs)
Comment 5•7 years ago
|
||
It probably doesn't matter for internal frame selection objects. But then, I'd expect refcnt to be 1 usually in that case.
Flags: needinfo?(bugs)
Assignee | ||
Comment 6•7 years ago
|
||
I don't think the patch here is much useful after all, I'm going to close this bug.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•