1
0
Fork 0
firefox/testing/web-platform/tests/quirks/support/test-ref-iframe.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

17 lines
748 B
JavaScript

function setupIframe() {
var iframe = document.querySelector('iframe');
var html = "<style id=style></style><div id=test></div><div id=ref></div><svg><circle id=svg /><circle id=svg_ref /></svg>";
if (iframe.className === "limited-quirks") {
html = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">' + html;
} else if (iframe.className === "no-quirks") {
html = '<!DOCTYPE HTML>' + html;
}
window.quirks = iframe.className === "quirks";
window.win = iframe.contentWindow;
win.document.open();
win.document.write(html);
win.document.close();
['style', 'test', 'ref', 'svg', 'svg_ref'].forEach(function(id) {
win[id] = win.document.getElementById(id);
});
}