diff --git a/src/ShadowDOM/wrappers/Document.js b/src/ShadowDOM/wrappers/Document.js index 82c4859..6dee221 100644 --- a/src/ShadowDOM/wrappers/Document.js +++ b/src/ShadowDOM/wrappers/Document.js @@ -242,7 +242,13 @@ 'querySelectorAll', 'removeChild', 'replaceChild', - ].concat(matchesNames)); + ]); + + forwardMethodsToWrapper([ + window.HTMLBodyElement, + window.HTMLHeadElement, + window.HTMLHtmlElement, + ], matchesNames); forwardMethodsToWrapper([ window.HTMLDocument || window.Document, // Gecko adds these to HTMLDocument diff --git a/tests/ShadowDOM/js/Document.js b/tests/ShadowDOM/js/Document.js index 0dcbfe4..45f2453 100644 --- a/tests/ShadowDOM/js/Document.js +++ b/tests/ShadowDOM/js/Document.js @@ -53,6 +53,11 @@ htmlSuite('Document', function() { assert.equal(doc.head.parentNode, doc.documentElement); }); + test('document.matches', function() { + var doc = wrap(document); + assert.isTrue(doc.matches === undefined); + }); + test('getElementsByTagName', function() { var elements = document.getElementsByTagName('body'); assert.isTrue(elements instanceof HTMLCollection);