blob: 0431b5c6039b6500de6b3b4319825ef3d07a1b6b [file] [log] [blame]
CONSOLE WARNING: line 31: Calling Element.createShadowRoot() for an element which already hosts a shadow root is deprecated and will be removed in M63, around December 2017. See https://www.chromestatus.com/features/4668884095336448 for more details.
This tests multiple shadow roots creation with createShadowRoot and mode parameter.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
createShadowRoot() can still create multiple shadow roots.
PASS internals.shadowRootType(shadow1) is "V0ShadowRoot"
PASS internals.shadowRootType(shadow2) is "V0ShadowRoot"
PASS internals.youngestShadowRoot(div) is shadow2
PASS shadow2.olderShadowRoot is shadow1
Other attempts to create multiple shadow roots should fail
PASS internals.shadowRootType(shadow1) is "V0ShadowRoot"
PASS div.attachShadow({mode: "open"}) threw exception InvalidStateError: Failed to execute 'attachShadow' on 'Element': Shadow root cannot be created on a host which already hosts a shadow tree..
PASS div.attachShadow({mode: "closed"}) threw exception InvalidStateError: Failed to execute 'attachShadow' on 'Element': Shadow root cannot be created on a host which already hosts a shadow tree..
PASS internals.youngestShadowRoot(div) is shadow1
PASS internals.shadowRootType(shadow1) is "OpenShadowRoot"
PASS div.createShadowRoot() threw exception InvalidStateError: Failed to execute 'createShadowRoot' on 'Element': Shadow root cannot be created on a host which already hosts a v1 shadow tree..
PASS div.attachShadow({mode: "open"}) threw exception InvalidStateError: Failed to execute 'attachShadow' on 'Element': Shadow root cannot be created on a host which already hosts a shadow tree..
PASS div.attachShadow({mode: "closed"}) threw exception InvalidStateError: Failed to execute 'attachShadow' on 'Element': Shadow root cannot be created on a host which already hosts a shadow tree..
PASS internals.youngestShadowRoot(div) is shadow1
PASS internals.shadowRootType(shadow1) is "ClosedShadowRoot"
PASS div.createShadowRoot() threw exception InvalidStateError: Failed to execute 'createShadowRoot' on 'Element': Shadow root cannot be created on a host which already hosts a v1 shadow tree..
PASS div.attachShadow({mode: "open"}) threw exception InvalidStateError: Failed to execute 'attachShadow' on 'Element': Shadow root cannot be created on a host which already hosts a shadow tree..
PASS div.attachShadow({mode: "closed"}) threw exception InvalidStateError: Failed to execute 'attachShadow' on 'Element': Shadow root cannot be created on a host which already hosts a shadow tree..
PASS internals.youngestShadowRoot(div) is shadow1
V0 shadow root cannot be created on UA shadow root
PASS internals.shadowRootType(internals.shadowRoot(input)) is "UserAgentShadowRoot"
PASS input.createShadowRoot() threw exception InvalidStateError: Failed to execute 'createShadowRoot' on 'Element': Shadow root cannot be created on a host which already hosts an user-agent shadow tree..
PASS input.attachShadow({mode: "open"}) threw exception NotSupportedError: Failed to execute 'attachShadow' on 'Element': This element does not support attachShadow.
PASS input.attachShadow({mode: "closed"}) threw exception NotSupportedError: Failed to execute 'attachShadow' on 'Element': This element does not support attachShadow.
PASS successfullyParsed is true
TEST COMPLETE