Index: lib/content/snippets.js |
=================================================================== |
--- a/lib/content/snippets.js |
+++ b/lib/content/snippets.js |
@@ -198,17 +198,17 @@ |
// be Firefox or an older version of Chrome. |
if (!originalAttachShadow) |
return; |
// Mutation observers mapped to their corresponding shadow roots and their |
// hosts. |
let shadows = new WeakMap(); |
- function observe(mutations, observer) |
+ function observeShadow(mutations, observer) |
{ |
let {host, root} = shadows.get(observer) || {}; |
// Since it's a weak map, it's possible that either the element or its |
// shadow has been removed. |
if (!host || !root) |
return; |
@@ -234,17 +234,17 @@ |
Object.defineProperty(Element.prototype, "attachShadow", { |
value(...args) |
{ |
// Create the shadow root first. It doesn't matter if it's a closed |
// shadow root, we keep the reference in a weak map. |
let root = originalAttachShadow.apply(this, args); |
// Listen for relevant DOM mutations in the shadow. |
- let observer = new MutationObserver(observe); |
+ let observer = new MutationObserver(observeShadow); |
observer.observe(root, { |
childList: true, |
characterData: true, |
subtree: true |
}); |
// Keep references to the shadow root and its host in a weak map. If |
// either the shadow is detached or the host itself is removed from the |