Comparing version 0.8.3 to 0.8.4
@@ -68,3 +68,3 @@ var fs = require('fs'); | ||
require('./jsdom/selectors/index').applyQuerySelector(doc, level); | ||
require('./jsdom/selectors/index').applyQuerySelectorPrototype(level); | ||
@@ -71,0 +71,0 @@ features.applyDocumentFeatures(doc, options.features); |
@@ -288,3 +288,18 @@ var http = require('http'), | ||
}, | ||
Image : NOT_IMPLEMENTED(null, 'window.Image') | ||
Image : NOT_IMPLEMENTED(null, 'window.Image'), | ||
// Note: these will not be necessary for newer Node.js versions, which have | ||
// typed arrays in V8 and thus on every global object. (That is, in newer | ||
// versions we'll get `ArrayBuffer` just as automatically as we get | ||
// `Array`.) But to support older versions, we explicitly set them here. | ||
Int8Array: Int8Array, | ||
Int16Array: Int16Array, | ||
Int32Array: Int32Array, | ||
Float32Array: Float32Array, | ||
Float64Array: Float64Array, | ||
Uint8Array: Uint8Array, | ||
Uint8ClampedArray: Uint8ClampedArray, | ||
Uint16Array: Uint16Array, | ||
Uint32Array: Uint32Array, | ||
ArrayBuffer: ArrayBuffer | ||
}; | ||
@@ -291,0 +306,0 @@ |
@@ -11,29 +11,22 @@ var nwmatcher = require("nwmatcher/src/nwmatcher-noqsa"); | ||
exports.applyQuerySelector = function(doc, dom) { | ||
doc.querySelector = function(selector) { | ||
exports.applyQuerySelectorPrototype = function(dom) { | ||
dom.Document.prototype.querySelector = function(selector) { | ||
return addNwmatcher(this).first(selector, this); | ||
}; | ||
doc.querySelectorAll = function(selector) { | ||
dom.Document.prototype.querySelectorAll = function(selector) { | ||
return new dom.NodeList(addNwmatcher(this).select(selector, this)); | ||
}; | ||
var _createElement = doc.createElement; | ||
doc.createElement = function() { | ||
var element = _createElement.apply(this, arguments); | ||
dom.Element.prototype.querySelector = function(selector) { | ||
return addNwmatcher(this.ownerDocument).first(selector, this); | ||
}; | ||
element.querySelector = function(selector) { | ||
return addNwmatcher(this.ownerDocument).first(selector, this); | ||
}; | ||
dom.Element.prototype.querySelectorAll = function(selector) { | ||
return new dom.NodeList(addNwmatcher(this.ownerDocument).select(selector, this)); | ||
}; | ||
element.querySelectorAll = function(selector) { | ||
return new dom.NodeList(addNwmatcher(this.ownerDocument).select(selector, this)); | ||
}; | ||
element.matchesSelector = function(selector) { | ||
return addNwmatcher(this.ownerDocument).match(this, selector); | ||
}; | ||
return element; | ||
dom.Element.prototype.matchesSelector = function(selector) { | ||
return addNwmatcher(this.ownerDocument).match(this, selector); | ||
}; | ||
}; |
{ | ||
"name": "jsdom", | ||
"version": "0.8.3", | ||
"version": "0.8.4", | ||
"description": "A JavaScript implementation of the W3C DOM", | ||
@@ -5,0 +5,0 @@ "keywords": ["dom", "w3c", "html"], |
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
354874
10301