Closed Bug 1656799 Opened 4 years ago Closed 4 years ago

Rewrite `HTMLEditor::HandleDeleteNonCollapsedSelection()` as not using `Selection`

Categories

(Core :: DOM: Editor, task, P2)

task

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

Attachments

(5 files)

After fixing bug 1656430, we can make it free from Selection.

There is only AutoTrackDOMPoint, but
HTMLEditor::HandleDeleteNonCollapsedSelection() requires to tack pairs of
DOM points, i.e., requires to track ranges. For making the code simpler,
we should have range tracker too.

Depends on D85845

It may be faster to use AutoTrackDOMRange directly. Therefore, current
WhiteSpaceVisibilityKeeper::PrepareToDeleteRange() should be renamed to
WhiteSpaceVisibilityKeeper::PrepareToDeleteRangeAndTrackPoints() and
we should make HTMLEditor::HandleDeleteNonCollapsedSelection() track
the range by itself.

Depends on D85846

Creation cost of nsRange is expensive, and it's only user,
HTMLEditor::HandleDeleteNonCollapsedRanges() wants to extend the range.
Therefore, we can make it directly extend the given range.

Depends on D85848

Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/27409fc97733 part 1: Make `HTMLEditor::HandleDeleteNonCollapsedSelection()` store selection ranges with `AutoRangeArray` first r=m_kato https://hg.mozilla.org/integration/autoland/rev/cd8960cc9561 part 2: Create range tracker r=m_kato https://hg.mozilla.org/integration/autoland/rev/5f6940372132 part 3: Make `WhiteSpaceVisibilityKeeper::PrepareToDeleteRange()` not track `EditorDOMPoint`s r=m_kato https://hg.mozilla.org/integration/autoland/rev/ea2f2ca8c778 part 4: Make `HTMLEditor::HandleDeleteNonCollapsedSelection()` take ranges to delete instead of retrieving it via `Selection` r=m_kato https://hg.mozilla.org/integration/autoland/rev/5f6fd01e29a2 part 5: Make `HTMLEditor::GetRangeExtendedToIncludeInvisibleNodes()` directly extend given range r=m_kato
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: