Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/webappapis/dynamic-markup-insertion/opening-the-input-stream/encoding.window.html - WPT Dashboard Interop Dashboard
async_test(t => {
const frame = document.body.appendChild(document.createElement("iframe"));
frame.src = "resources/encoding-frame.html";
frame.onload = t.step_func_done(t => {
// Using toLowerCase() to avoid an Edge bug
assert_equals(frame.contentDocument.characterSet.toLowerCase(), "shift_jis", "precondition");
assert_equals(frame.contentDocument.open(), frame.contentDocument);
assert_equals(frame.contentDocument.characterSet.toLowerCase(), "shift_jis", "actual test");
frame.contentDocument.close();
assert_equals(frame.contentDocument.characterSet.toLowerCase(), "shift_jis", "might as well");
});
}, "doucment.open() and the document's encoding");