min-document
Advanced tools
Comparing version 2.1.0 to 2.2.0
12
index.js
@@ -29,12 +29,17 @@ var DOMText = require("./dom-text.js") | ||
function ownerDocument(that, node) { | ||
node.ownerDocument = that | ||
return node | ||
} | ||
function createTextNode(value) { | ||
return new DOMText(value) | ||
return ownerDocument(this, new DOMText(value)) | ||
} | ||
function createElement(tagName) { | ||
return new DOMElement(tagName) | ||
return ownerDocument(this, new DOMElement(tagName)) | ||
} | ||
function createDocumentFragment() { | ||
return new DocumentFragment() | ||
return ownerDocument(this, new DocumentFragment()) | ||
} | ||
@@ -46,2 +51,3 @@ | ||
/* | ||
@@ -48,0 +54,0 @@ * getElementById returns the Element whose ID is given by elementId. |
{ | ||
"name": "min-document", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "A minimal DOM implementation", | ||
@@ -23,3 +23,3 @@ "keywords": [], | ||
"devDependencies": { | ||
"tape": "~1.0.2" | ||
"tape": "^2.12.1" | ||
}, | ||
@@ -26,0 +26,0 @@ "licenses": [ |
@@ -107,2 +107,14 @@ var test = require("tape") | ||
assert.end() | ||
}) | ||
test("owner document is set", function (assert) { | ||
var textnode = document.createTextNode("hello") | ||
var domnode = document.createElement("div") | ||
var fragment = document.createDocumentFragment() | ||
assert.equal(textnode.ownerDocument, document) | ||
assert.equal(domnode.ownerDocument, document) | ||
assert.equal(fragment.ownerDocument, document) | ||
assert.end() | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17893
383