Revision 5f32ba4f5129de8d87c9111d09754820d959ae68 authored by Jonathon Kereliuk on 04 April 2018, 18:16:38 UTC, committed by Jonathon Kereliuk on 04 April 2018, 18:16:38 UTC
1 parent e502344
Document-prototype-importNode.html
<!DOCTYPE html>
<html>
<head>
<title>DOM and Shadow DOM: Document.prototype.importNode</title>
<meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
<meta name="assert" content="The importNode(node, deep) method must throw a NotSupportedError exception if node is a shadow root.">
<link rel="help" href="https://dom.spec.whatwg.org/#dom-document-importnode">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id="log"></div>
<script>
function testImportNode(mode) {
test(function () {
var newDocument = document.implementation.createHTMLDocument();
assert_throws({'name': 'NotSupportedError'}, function () {
var element = document.createElement('div');
var shadowRoot = element.attachShadow({mode: mode});
newDocument.importNode(shadowRoot);
});
}, 'importNode on a shadow root in ' + mode + ' mode must throw a NotSupportedError');
}
testImportNode('open');
testImportNode('closed');
</script>
</body>
</html>
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...