jsdom
Advanced tools
Comparing version 16.6.0 to 16.7.0
@@ -82,2 +82,7 @@ { | ||
}, | ||
"AggregateError": { | ||
"writable": true, | ||
"enumerable": false, | ||
"configurable": true | ||
}, | ||
"EvalError": { | ||
@@ -233,2 +238,12 @@ "writable": true, | ||
}, | ||
"FinalizationRegistry": { | ||
"writable": true, | ||
"enumerable": false, | ||
"configurable": true | ||
}, | ||
"WeakRef": { | ||
"writable": true, | ||
"enumerable": false, | ||
"configurable": true | ||
}, | ||
"decodeURI": { | ||
@@ -289,17 +304,2 @@ "writable": true, | ||
}, | ||
"AggregateError": { | ||
"writable": true, | ||
"enumerable": false, | ||
"configurable": true | ||
}, | ||
"FinalizationRegistry": { | ||
"writable": true, | ||
"enumerable": false, | ||
"configurable": true | ||
}, | ||
"WeakRef": { | ||
"writable": true, | ||
"enumerable": false, | ||
"configurable": true | ||
}, | ||
"WebAssembly": { | ||
@@ -306,0 +306,0 @@ "writable": true, |
@@ -6,2 +6,3 @@ "use strict"; | ||
const EventTargetImpl = require("../events/EventTarget-impl").implementation; | ||
const AbortSignal = require("../generated/AbortSignal"); | ||
@@ -19,2 +20,8 @@ class AbortSignalImpl extends EventTargetImpl { | ||
static abort(globalObject) { | ||
const abortSignal = AbortSignal.createImpl(globalObject, []); | ||
abortSignal.aborted = true; | ||
return abortSignal; | ||
} | ||
_signalAbort() { | ||
@@ -21,0 +28,0 @@ if (this.aborted) { |
@@ -136,2 +136,6 @@ "use strict"; | ||
} | ||
static abort() { | ||
return utils.tryWrapperForImpl(Impl.implementation.abort(globalObject)); | ||
} | ||
} | ||
@@ -143,2 +147,3 @@ Object.defineProperties(AbortSignal.prototype, { | ||
}); | ||
Object.defineProperties(AbortSignal, { abort: { enumerable: true } }); | ||
if (globalObject[ctorRegistrySymbol] === undefined) { | ||
@@ -145,0 +150,0 @@ globalObject[ctorRegistrySymbol] = Object.create(null); |
@@ -76,9 +76,2 @@ "use strict"; | ||
exports.normalizeToCRLF = string => { | ||
return string.replace(/\r([^\n])/g, "\r\n$1") | ||
.replace(/\r$/, "\r\n") | ||
.replace(/([^\r])\n/g, "$1\r\n") | ||
.replace(/^\n/, "\r\n"); | ||
}; | ||
// https://html.spec.whatwg.org/multipage/dom.html#interactive-content-2 | ||
@@ -85,0 +78,0 @@ exports.isInteractiveContent = node => { |
@@ -63,3 +63,7 @@ "use strict"; | ||
exports.forEachMatchingSheetRuleOfElement(element, rule => { | ||
value = rule.style.getPropertyValue(property); | ||
const propertyValue = rule.style.getPropertyValue(property); | ||
// getPropertyValue returns "" if the property is not found | ||
if (propertyValue !== "") { | ||
value = propertyValue; | ||
} | ||
}); | ||
@@ -66,0 +70,0 @@ |
@@ -346,2 +346,4 @@ "use strict"; | ||
return { | ||
x: 0, | ||
y: 0, | ||
bottom: 0, | ||
@@ -348,0 +350,0 @@ height: 0, |
@@ -12,3 +12,3 @@ "use strict"; | ||
const { cloningSteps } = require("../helpers/internal-constants"); | ||
const { isDisabled, normalizeToCRLF, getLabelsForLabelable, formOwner } = require("../helpers/form-controls"); | ||
const { isDisabled, getLabelsForLabelable, formOwner } = require("../helpers/form-controls"); | ||
const { childTextContent } = require("../helpers/text"); | ||
@@ -42,4 +42,7 @@ const { fireAnEvent } = require("../helpers/events"); | ||
_getValue() { | ||
// Hard-wrapping omitted, for now. | ||
return normalizeToCRLF(this._rawValue); | ||
const apiValue = this._getAPIValue(); | ||
const wrap = this.getAttributeNS(null, "wrap"); | ||
return wrap === "hard" ? | ||
textareaWrappingTransformation(apiValue, this.cols) : | ||
apiValue; | ||
} | ||
@@ -247,1 +250,26 @@ | ||
}; | ||
function textareaWrappingTransformation(text, cols) { | ||
let lineStart = 0; | ||
let lineEnd = text.indexOf("\n"); | ||
if (lineEnd === -1) { | ||
lineEnd = text.length; | ||
} | ||
while (lineStart < text.length) { | ||
const lineLength = lineEnd - lineStart; | ||
if (lineLength > cols) { | ||
// split the line | ||
lineEnd = lineStart + cols; | ||
text = text.slice(0, lineEnd) + "\n" + text.slice(lineEnd); | ||
} | ||
// move to next line | ||
lineStart = lineEnd + 1; // step over the newline | ||
lineEnd = text.indexOf("\n", lineStart); | ||
if (lineEnd === -1) { | ||
lineEnd = text.length; | ||
} | ||
} | ||
return text; | ||
} |
"use strict"; | ||
const idlUtils = require("../generated/utils"); | ||
const { closest } = require("../helpers/traversal"); | ||
const { isDisabled, isSubmittable, isButton, normalizeToCRLF } = require("../helpers/form-controls"); | ||
const { isDisabled, isSubmittable, isButton } = require("../helpers/form-controls"); | ||
const Blob = require("../generated/Blob.js"); | ||
@@ -148,4 +148,2 @@ const File = require("../generated/File.js"); | ||
} | ||
} /* skip plugins. TODO: _charset_ */ else if (field.localName === "textarea") { | ||
appendAnEntry(entryList, name, field._getValue(), true); | ||
} else { | ||
@@ -167,8 +165,5 @@ appendAnEntry(entryList, name, field._getValue()); | ||
function appendAnEntry(entryList, name, value, preventLineBreakNormalization = false) { | ||
name = conversions.USVString(normalizeToCRLF(name)); | ||
function appendAnEntry(entryList, name, value) { | ||
name = conversions.USVString(name); | ||
if (!File.isImpl(value)) { | ||
if (!preventLineBreakNormalization) { | ||
value = normalizeToCRLF(value); | ||
} | ||
value = conversions.USVString(value); | ||
@@ -175,0 +170,0 @@ } |
{ | ||
"name": "jsdom", | ||
"version": "16.6.0", | ||
"version": "16.7.0", | ||
"description": "A JavaScript implementation of many web standards", | ||
@@ -48,3 +48,3 @@ "keywords": [ | ||
"whatwg-url": "^8.5.0", | ||
"ws": "^7.4.5", | ||
"ws": "^7.4.6", | ||
"xml-name-validator": "^3.0.0" | ||
@@ -51,0 +51,0 @@ }, |
@@ -58,3 +58,3 @@ <h1 align="center"> | ||
Note that both `url` and `referrer` are canonicalized before they're used, so e.g. if you pass in `"https:example.com"`, jsdom will interpret that as if you had given `"https://example.com/"`. If you pass an unparseable URL, the call will throw. (URLs are parsed and serialized according to the [URL Standard](http://url.spec.whatwg.org/).) | ||
Note that both `url` and `referrer` are canonicalized before they're used, so e.g. if you pass in `"https:example.com"`, jsdom will interpret that as if you had given `"https://example.com/"`. If you pass an unparseable URL, the call will throw. (URLs are parsed and serialized according to the [URL Standard](https://url.spec.whatwg.org/).) | ||
@@ -521,4 +521,4 @@ ### Executing scripts | ||
- The [mailing list](http://groups.google.com/group/jsdom) (best for "how do I" questions) | ||
- The [mailing list](https://groups.google.com/group/jsdom) (best for "how do I" questions) | ||
- The [issue tracker](https://github.com/jsdom/jsdom/issues) (best for bug reports) | ||
- The IRC channel: [#jsdom on freenode](irc://irc.freenode.net/jsdom) | ||
- The Matrix room: [#jsdom:matrix.org](https://matrix.to/#/#jsdom:matrix.org) |
72010
2769471
463
Updatedws@^7.4.6