https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 8c186f666b8dc656b2e7e068046354cc4db79c87 authored by Geoffrey Sneddon on 09 April 2018, 08:12:20 UTC
In HTML documents, always make sure we a body
Tip revision: 8c186f6
document-method-changes.html
<!DOCTYPE html>
<html>
<head>
<title>The import attribute</title>
<link rel="help" href="http://w3c.github.io/webcomponents/spec/imports/#interface-import">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<link id="importLink" rel="import" href="resources/body-only.html">
<link                 rel="import" href="resources/test-in-import.html">
</head>
<body>
<div id="log"></div>
<script>
test(function() {
   assert_throws('INVALID_STATE_ERR', function() { importLink.import.open(); }, 'document.open()');
   assert_throws('INVALID_STATE_ERR', function() { importLink.import.write('Hello'); }, 'document.write()');
   assert_throws('INVALID_STATE_ERR', function() { importLink.import.open(); }, 'document.close()');
}, 'Throws an InvalidStateError exception if the Document is an import: From the master document');
</script>
</body>
</html>
back to top