shadycss icon indicating copy to clipboard operation
shadycss copied to clipboard

ShadyDOM 1.1.3 breaks dynamic-scoping tests

Open TimvdLippe opened this issue 8 years ago • 3 comments

This is likely related to https://github.com/webcomponents/shadydom/commit/ee372361748163b2f9188996b663297a09acf75d The tests on http://localhost:8000/tests/dynamic-scoping.html?wc-shadydom=true fail, but other configurations are fine.

TimvdLippe avatar Sep 19 '18 15:09 TimvdLippe

This is a combination of broken tests in scoping-api.html expecting ShadyDOM to not have implemented the synchronous scoping API, and something else I need to look into.

dfreedm avatar Sep 28 '18 18:09 dfreedm

Ah I see, there is a bug in ShadyDOM related to detecting if unscoping is necessary.

In this table, we assume that getRootNode() will return a Document or ShadowRoot.

However, in disconnected trees, getRootNode() will return the topmost Node, which could be an element, or DocumentFragment, or itself.

In the case where a Node is cloned out of a disconnected tree that was scoped and moved into the Document, we skip removing the scoping. A check for node.isConnected would be the quick fix, but perhaps there is something smarter to do.

dfreedm avatar Sep 28 '18 22:09 dfreedm

Fixed in https://github.com/webcomponents/shadydom/pull/285

dfreedm avatar Oct 01 '18 22:10 dfreedm