gecko-dev/extensions
Jan-Niklas Jaeschke 2243494a74 Bug 1810403: Allow `nsRange`s to be in multiple `Selection`s. r=masayuki
The Custom Highlight API allows a use case where a `Range` of a `Highlight`
is also used as `Selection`. Due to the decision to use the `Selection` mechanism
to display `Highlight`s, a `Range` can be part of several `Selection`s.
Since the `Range` has a pointer to its associated `Selection`
to notify about changes, this must be adapted to allow several `Selections`.

As a tradeoff of performance and memory usage, the `Selection`s are stored
as `mozilla::LinkedList`. A helper class `mozilla::SelectionListWrapper`
was implemented to allow `Selection`s to be in multiple of these lists
and without having to be derived from `LinkedListElement<T>`.

To simplify usage of the list, the use case  "does this range belong to Selection x?"
is wrapped into the convenience method`IsInSelection(Selection&)`;
The method previously named like this was renamed to `IsInAnySelection()`
to be named more precisely.

Registering and unregistering of the closest common inclusive ancestor
of the `Range` is done when the first `Selection` is registered and
the last `Selection` is unregistered.

Differential Revision: https://phabricator.services.mozilla.com/D169597
2023-02-21 12:25:28 +00:00
..
auth Bug 1519636 - Reformat recent changes to the Google coding style. r=glandium 2023-02-13 15:02:07 +00:00
permissions Bug 1816191 - Skip tests in order to keep win7 running @ azure. r=gbrown,necko-reviewers,settings-reviewers,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,nalexander,sgalich,alwu 2023-02-14 23:44:12 +00:00
pref Bug 1807926: disable autoconfig tests for tests against MSIX builds r=mkaply 2023-01-09 18:01:10 +00:00
spellcheck Bug 1810403: Allow `nsRange`s to be in multiple `Selection`s. r=masayuki 2023-02-21 12:25:28 +00:00
universalchardet Bug 1782008 - Remove now unnecessary .eslintrc.js files. r=webcompat-reviewers,extension-reviewers,media-playback-reviewers,pip-reviewers,denschub,rpl,alwu,mossop 2022-08-03 11:16:20 +00:00