Re: [dom] MutationObserver with querySelector for elements (#77)

I instrumented Firefox OS localization framework that localizes nodes registered with `data-l10n-id` to record numbers.

Launching the app in en-US gave me:
 - 117 mutations
 - 254 added nodes
 - 5 removed nodes
 - 67 nodes that contain `data-l10n-id`

Navigating around the app (between 5 panels) gave me:
 - 427 mutations
 - 1264 added nodes
 - 36 removed nodes
 - 231 nodes that contain `data-l10n-id`

The additional problem we face is that the addedNode may be in fact a DOMFragment and we have to find nodes with `data-l10n-id` inside it, so we use... querySelector.

I just started working on a counter part to that API that brings Intl capabilities for elements. It will use `data-intl-format` attribute and will require pretty much the same MutationObserver heuristics.
The only problem is that the signal/noise ratio will be even lower.

And we have a shim for a color picker that only wants to register input[type=color], but has to listen to all mutations.

Does it bring an examples you've been looking for @domenic ?
If not, can you provide more information on what you are looking for? I'll try to get it.

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/77#issuecomment-147454227

Received on Monday, 12 October 2015 16:35:28 UTC