зеркало из https://github.com/mozilla/gecko-dev.git
2243494a74
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 |
||
---|---|---|
.. | ||
auth | ||
permissions | ||
pref | ||
spellcheck | ||
universalchardet |