Permalink
Browse files

Override document.write too

  • Loading branch information...
arv committed Apr 26, 2013
1 parent 07be1f3 commit 733b350e15ea800f95efab2caae0a4c008d07ca0
Showing with 6 additions and 2 deletions.
  1. +1 −0 src/wrappers/Document.js
  2. +5 −2 test/document-write.html
View
@@ -109,6 +109,7 @@
'createTextNode',
'elementFromPoint',
'getElementById',
+ 'write',
]);
mixin(Document.prototype, GetElementsByInterface);
View
@@ -4,11 +4,14 @@
<script src="../shadowdom.js"></script>
<a></a><script>
var assert = chai.assert;
+var wrap = ShadowDOMPolyfill.wrap;
var a = document.querySelector('a');
-document.write('<b></b>');
+document.write('<script><' + '/script>');
+wrap(document).write('<b></b>');
assert.equal(a.nextSibling.localName, 'script');
-assert.equal(a.nextSibling.nextSibling.localName, 'b');
+assert.equal(a.nextSibling.nextSibling.localName, 'script');
+assert.equal(a.nextSibling.nextSibling.nextSibling.localName, 'b');
var all = document.querySelectorAll('*');
var last = all[all.length - 1];

0 comments on commit 733b350

Please sign in to comment.