You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A-content/domInteracting with the DOM from web contentB-interesting-projectRepresents work that is expected to be interesting in some fashionI-enhancementNo impact; the issue is a missing or proposed feature.
I propose a simple implementation where a mutation_observers vector is added to Node, and they get notified every time Node::insert, Node::replace_all, Node::remove, Element::do_set_attribute, and Element::remove_attribute are called. For subtree observers, this will require checking the ancestors of mutated nodes as well.
A-content/domInteracting with the DOM from web contentB-interesting-projectRepresents work that is expected to be interesting in some fashionI-enhancementNo impact; the issue is a missing or proposed feature.
Activity
Ms2ger commentedon Nov 16, 2014
Blocks #2185.
Note that this will require implementing microtasks (which I have little experience with).
Tests:
dom/nodes/MutationObserver-childList.html,dom/nodes/MutationObserver-attributes.html,dom/nodes/MutationObserver-document.html,dom/nodes/MutationObserver-characterData.html,dom/nodes/MutationObserver-disconnect.html,dom/nodes/MutationObserver-takeRecords.htmlanddom/nodes/MutationObserver-inner-outer.html(requires inner/outerHTML).jdm commentedon Nov 16, 2014
See the notes about microtasks in https://html.spec.whatwg.org/#processing-model-9, in particular:
jdm commentedon Mar 17, 2015
I propose a simple implementation where a
mutation_observersvector is added toNode, and they get notified every timeNode::insert,Node::replace_all,Node::remove,Element::do_set_attribute, andElement::remove_attributeare called. For subtree observers, this will require checking the ancestors of mutated nodes as well.pcwalton commentedon Mar 23, 2015
Now that we have userscripts, this should be the last missing piece blocking integration of canvg for SVG support.
nox commentedon Jun 12, 2015
@jdm Not only nodes will need the mutation observers machinery. I would like to use them between URLSearchParams and URL too, for example.
jdm commentedon Apr 28, 2017
Closing in favour of #6633.