mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
4265f72859
Deletion of mutation observers from a list resulted in O(n^2) behavior and could lead to massive freezes. This is resolved by using a LinkedList instead, reducing complexity to O(n). A safely iterable doubly linked list was implemented based on `mozilla::DoublyLinkedList`, allowing to insert and remove elements while iterating the list. Due to the nature of `mozilla::DoublyLinkedList`, every Mutation Observer now inherits `mozilla::DoublyLinkedListElement<T>`. This implies that a Mutation Observer can only be part of one DoublyLinkedList. This conflicts with some Mutation Observers, which are being added to multiple `nsINode`s. To continue supporting this, new MutationObserver base classes `nsMultiMutationObserver` and `nsStubMultiMutationObserver` are introduced, which create `MutationObserverWrapper` objects each time they are added to a `nsINode`. The wrapper objects forward every call to the actual observer. Differential Revision: https://phabricator.services.mozilla.com/D157031 |
||
---|---|---|
.. | ||
tests | ||
components.conf | ||
DocumentL10n.cpp | ||
DocumentL10n.h | ||
DOMLocalization.cpp | ||
DOMLocalization.h | ||
L10nMutations.cpp | ||
L10nMutations.h | ||
L10nOverlays.cpp | ||
L10nOverlays.h | ||
moz.build |