Skip to content

Commit f475303

Browse files
IE support
1 parent 3bfb687 commit f475303

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/test/getTestDocument.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@
1818

1919
function getTestDocument() {
2020
var iframe = document.createElement('iframe');
21-
iframe.style.cssText = 'position:absolute; visibility:hidden; bottom:100%; right:100%';
22-
iframe.src = 'data:text/html,<!doctype html><meta charset=utf-8><title>test doc</title>';
21+
iframe.style.display = 'none';
2322
document.body.appendChild(iframe);
24-
var testDocument = iframe.contentDocument;
23+
24+
var testDocument = iframe.contentDocument || iframe.contentWindow.document;
25+
testDocument.open();
26+
testDocument.write('<!doctype html><meta charset=utf-8><title>test doc</title>');
27+
testDocument.close();
28+
2529
iframe.parentNode.removeChild(iframe);
2630
return testDocument;
2731
}

0 commit comments

Comments
 (0)