Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /dom/nodes/Document-contentType/contentType/contenttype_javascripturi.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>Javascript URI document.contentType === 'text/html'</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
async_test(function() {
var iframe = document.createElement('iframe');
iframe.addEventListener('load', this.step_func_done(function() {
assert_equals(iframe.contentDocument.contentType, "text/html");
assert_equals(iframe.contentDocument.documentElement.textContent, "text/html");
}), false);
iframe.src = "javascript:document.contentType";
document.body.appendChild(iframe);
});
</script>