diff --git a/render/render.js b/render/render.js index 209973722..f8ed10363 100644 --- a/render/render.js +++ b/render/render.js @@ -5,8 +5,7 @@ var df = require("../render/domFor") var delayedRemoval = df.delayedRemoval var domFor = df.domFor -module.exports = function($window) { - var $doc = $window && $window.document +module.exports = function() { var nameSpace = { svg: "http://www.w3.org/2000/svg", math: "http://www.w3.org/1998/Math/MathML" @@ -16,7 +15,7 @@ module.exports = function($window) { var currentRender function getDocument(dom) { - return dom.ownerDocument || $doc; + return dom.ownerDocument; } function getNameSpace(vnode) { @@ -919,8 +918,6 @@ module.exports = function($window) { var currentDOM return function(dom, vnodes, redraw) { - $doc = dom.ownerDocument; - if (!dom) throw new TypeError("DOM element being rendered to does not exist.") if (currentDOM != null && dom.contains(currentDOM)) { throw new TypeError("Node is currently being rendered to and thus is locked.") diff --git a/test-utils/domMock.js b/test-utils/domMock.js index 06412e09b..5536b49fd 100644 --- a/test-utils/domMock.js +++ b/test-utils/domMock.js @@ -718,6 +718,7 @@ module.exports = function(options) { }, createDocumentFragment: function() { return { + ownerDocument: $window.document, nodeType: 11, nodeName: "#document-fragment", appendChild: appendChild,