1 CONSOLE WARNING: Calling Element.createShadowRoot() for an element which already hosts a shadow root is deprecated. See https://www.chromestatus.com/features/4668884095336448 for more details.
2 In this test, we create a complex Shadow DOM and try to drag from a div in nested shadow root of older shadow root to a div in nested shadow root of younger shadow root. Then we get selection from the following TreeScopes:
3 * treeScopes[0] = document
4 * treeScopes[1] = OLDER SHADOW ROOT
5 * treeScopes[2] = YOUNGER SHADOW ROOT
6 * treeScopes[3] = NESTED SHADOW ROOT IN OLDER SHADOW ROOT
7 * treeScopes[4] = NESTED SHADOW ROOT IN YOUNGER SHADOW ROOT
8 and check selection.anchorNode, selection.focusNode, selection.baseNode, and selection.extentNode are null or in the same treescope.
10 Dragged from (DIV 2 IN NESTED SHADOW DOM OF OLDER SHADOW ROOT) to (DIV 2 IN NESTED SHADOW DOM OF YOUNGER SHADOW ROOT)
12 treeScopes[0] is document
13 PASS internals.treeScopeRootNode(treeScopes[0].getSelection().anchorNode) is document
14 PASS internals.treeScopeRootNode(treeScopes[0].getSelection().focusNode) is document
15 PASS internals.treeScopeRootNode(treeScopes[0].getSelection().baseNode) is document
16 PASS internals.treeScopeRootNode(treeScopes[0].getSelection().extentNode) is document
18 treeScopes[1] is OLDER SHADOW ROOT
19 PASS internals.treeScopeRootNode(treeScopes[1].getSelection().anchorNode) is treeScopes[1]
20 PASS internals.treeScopeRootNode(treeScopes[1].getSelection().focusNode) is treeScopes[1]
21 PASS internals.treeScopeRootNode(treeScopes[1].getSelection().baseNode) is treeScopes[1]
22 PASS internals.treeScopeRootNode(treeScopes[1].getSelection().extentNode) is treeScopes[1]
24 treeScopes[2] is YOUNGER SHADOW ROOT
25 Since treeScope[2] is outside of selection start point, no node should not be taken.
26 PASS treeScopes[2].getSelection().anchorNode is null
27 PASS treeScopes[2].getSelection().focusNode is null
28 PASS treeScopes[2].getSelection().baseNode is null
29 PASS treeScopes[2].getSelection().extentNode is null
31 treeScopes[3] is NESTED SHADOW ROOT IN OLDER SHADOW ROOT
32 PASS internals.treeScopeRootNode(treeScopes[3].getSelection().anchorNode) is treeScopes[3]
33 PASS internals.treeScopeRootNode(treeScopes[3].getSelection().focusNode) is treeScopes[3]
34 PASS internals.treeScopeRootNode(treeScopes[3].getSelection().baseNode) is treeScopes[3]
35 PASS internals.treeScopeRootNode(treeScopes[3].getSelection().extentNode) is treeScopes[3]
37 treeScopes[4] is NESTED SHADOW ROOT IN YOUNGER SHADOW ROOT
38 Since treeScope[4] is outside of selection start point, no node should not be taken.
39 PASS treeScopes[4].getSelection().anchorNode is null
40 PASS treeScopes[4].getSelection().focusNode is null
41 PASS treeScopes[4].getSelection().baseNode is null
42 PASS treeScopes[4].getSelection().extentNode is null
44 PASS successfullyParsed is true