Make some `nsFrameSelection` methods which consider next/previous position from a point static
Categories
(Core :: DOM: Selection, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox123 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
(Blocks 1 open bug)
Details
Attachments
(6 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
Currently, nsFrameSelection::CreateRangeExtendedToSomewhere<RangeType>
, nsFrameSeleciton::MoveCaret
and their helper methods computes new position with instance members. Therefore, it's hard to use them without changing Selection
. I think that they should be in new SelectionModifyUtils
and split the methods to computing part and modifying part.
Assignee | ||
Comment 1•2 years ago
|
||
Oh, this requires bigger patch than I've expected.
nsFrameSelection::PeekOffsetForCaretMove()
depends on nsCaretFrame::GetCaretFrameForNodeOffset
via Selection::GetPrimaryFrameForFocusNode
. I'll put off to work on this for a while.
Assignee | ||
Comment 2•11 months ago
|
||
For forward-decl-able.
Updated•11 months ago
|
Assignee | ||
Comment 3•11 months ago
|
||
Oddly, it updates nsFrameSelection
instance and some root callers may depend
on that. Therefore, this patch keep updating nsFrameSelection
in the callers.
Depends on D197283
Assignee | ||
Comment 4•11 months ago
|
||
Depends on D197284
Assignee | ||
Comment 5•11 months ago
|
||
Its name sounds a getter, but it updates the caret association hint of
nsFrameSelection
, but at least, one of its callers,
nsFrameSelection::PeekOffsetForCaretMove
shouldn't update it because it
just scans the previous or next position for caret.
Then, Selection::GetPrimaryFrameForFocusNode
can be implemented with a
new static method which is useful for PeekOffsetForCaretMove
when it becomes
a static method.
Depends on D197285
Assignee | ||
Comment 6•11 months ago
|
||
A caller of it should be independent from nsFrameSelection
instance.
Therefore, I'd like to separate it to static method part and instance method
part.
Depends on D197286
Assignee | ||
Comment 7•11 months ago
|
||
The methods are in nsCaret
, nsFrameSelection
and dom::Selection
. That
makes harder to read, and they are called each other, so, they are reused for
different purpose. Therefore, it must be better to move them into a new class.
Then, the name differences may become more unclear. If you think so, feel free
to request renaming some methods of them.
Depends on D197287
Comment 9•11 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d3ae22226f4d
https://hg.mozilla.org/mozilla-central/rev/b3408c9797ac
https://hg.mozilla.org/mozilla-central/rev/30647b4ef128
https://hg.mozilla.org/mozilla-central/rev/de056271d777
https://hg.mozilla.org/mozilla-central/rev/51faef0a512a
https://hg.mozilla.org/mozilla-central/rev/2a86b8379416
Description
•