[dom] Only run "adopting steps" if oldDocument !== document (#146)

https://dom.spec.whatwg.org/#example-04d99d7d

> For each descendant in node’s inclusive descendants, in tree order, run the adopting steps with descendant and oldDocument\.

@jdm found in https://github.com/w3c/web-platform-tests/issues/2466 that this doesn't have the intended behavior for `img` -- it's intended to rerun "update the image data" when the `img` changes node document, but not when it's moved around in the same document (except when moved into or out of a `picture`).

https://html.spec.whatwg.org/multipage/embedded-content.html#relevant-mutations

@annevk suggested in \#whatwg

> perhaps the "adopting steps" should only run if the document actually changes (and otherwise you just get the removal notification)

This would fix `img` and wouldn't regress `template`, AFAICT.

Thoughts?

cc @yoavweiss @smaug---- @domenic 

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

Received on Tuesday, 12 January 2016 08:05:44 UTC