Make `*ExtendForDelete()` of `nsISelectionController` and `nsFrameSelection` just return extended range instead of updating selection ranges
Categories
(Core :: DOM: Selection, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox77 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
Details
Attachments
(2 files)
For bug 1618457, editor needs to compute delete range which is computed by nsFrameSelection
via nsISelectionController
. However, current their APIs always update the selection ranges.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
Currently, EditorBase::ExtendSelectionForDelete()
depends on some
nsISelectionController
methods to compute extended range for deletion
from collapsed selection. They are implemented by
nsFrameSelection::MoveCaret()
and nsFrameSelection::TakeFocus()
.
Ideally, we should split these methods for computation part and performing
part. However, they change selection with updating other selection state,
for example, table selection state and bidi information. Therefore, it's
impossible to split them with simple code. However, I need to change
EditorBase::ExtendSelectionForDelete()
just return extended range.
Therefore, this patch creates nsFrameSelection::PeekOffsetForMoveCaret()
which has the main path in MoveCaret()
for the EditorBase
method.
Then, MoveCaret()
and new nsFrameSelection::GetExtendedRangeCommon()
share the computation code of expanding normal selection.
Finally, this patch wraps nsFrameSelection::GetExtendedRangeCommon()
with
new public inline methods for EditorBase
.
The following patch will remove no-user methods of nsISelectionController
.
Depends on D72294
Assignee | ||
Comment 2•5 years ago
|
||
Even in comm-central and BlueGriffon, nsISelectionController::*ForDelete()
are not used. Therefore, we can remove them safely.
Depends on D72295
Comment 4•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/3baf6ee966a6
https://hg.mozilla.org/mozilla-central/rev/f678ce3e8aa0
Description
•