Comparing version 25.0.1 to 26.0.0
@@ -142,7 +142,2 @@ { | ||
}, | ||
"Atomics": { | ||
"writable": true, | ||
"enumerable": false, | ||
"configurable": true | ||
}, | ||
"Uint8Array": { | ||
@@ -298,3 +293,3 @@ "writable": true, | ||
}, | ||
"Iterator": { | ||
"SharedArrayBuffer": { | ||
"writable": true, | ||
@@ -304,3 +299,3 @@ "enumerable": false, | ||
}, | ||
"SharedArrayBuffer": { | ||
"Atomics": { | ||
"writable": true, | ||
@@ -307,0 +302,0 @@ "enumerable": false, |
@@ -18,2 +18,5 @@ "use strict"; | ||
this.abortAlgorithms = new Set(); | ||
this._dependent = false; | ||
this._sourceSignals = new Set(); | ||
this._dependentSignals = new Set(); | ||
} | ||
@@ -41,2 +44,29 @@ | ||
// https://dom.spec.whatwg.org/#abortsignal-dependent | ||
static any(globalObject, signals) { | ||
const resultSignal = AbortSignal.createImpl(globalObject, []); | ||
for (const signal of signals) { | ||
if (signal.aborted) { | ||
resultSignal.reason = signal.reason; | ||
return resultSignal; | ||
} | ||
} | ||
resultSignal.dependent = true; | ||
for (const signal of signals) { | ||
if (!signal.dependent) { | ||
resultSignal._sourceSignals.add(signal); | ||
signal._dependentSignals.add(resultSignal); | ||
} else { | ||
for (const sourceSignal of signal._sourceSignals) { | ||
if (!sourceSignal.aborted && !sourceSignal.dependent) { | ||
resultSignal._sourceSignals.add(sourceSignal); | ||
sourceSignal._dependentSignals.add(resultSignal); | ||
} | ||
} | ||
} | ||
} | ||
return resultSignal; | ||
} | ||
static timeout(globalObject, milliseconds) { | ||
@@ -51,2 +81,3 @@ const signal = AbortSignal.createImpl(globalObject, []); | ||
// https://dom.spec.whatwg.org/#abortsignal-signal-abort | ||
_signalAbort(reason) { | ||
@@ -63,2 +94,18 @@ if (this.aborted) { | ||
const dependentSignalsToAbort = []; | ||
for (const dependentSignal of this._dependentSignals) { | ||
if (!dependentSignal.aborted) { | ||
dependentSignal.reason = this.reason; | ||
dependentSignalsToAbort.push(dependentSignal); | ||
} | ||
} | ||
this._runAbortStep(); | ||
for (const dependentSignal of dependentSignalsToAbort) { | ||
dependentSignal._runAbortStep(); | ||
} | ||
} | ||
_runAbortStep() { | ||
for (const algorithm of this.abortAlgorithms) { | ||
@@ -65,0 +112,0 @@ algorithm(); |
@@ -132,2 +132,3 @@ "use strict"; | ||
let observedAttributes = []; | ||
let formAssociated = false; | ||
const lifecycleCallbacks = { | ||
@@ -172,4 +173,7 @@ connectedCallback: null, | ||
const formAssociatedValue = ctor.formAssociated; | ||
disableInternals = disabledFeatures.includes("internals"); | ||
disableShadow = disabledFeatures.includes("shadow"); | ||
formAssociated = webIDLConversions.boolean(formAssociatedValue); | ||
} catch (err) { | ||
@@ -190,2 +194,3 @@ caughtError = err; | ||
objectReference: ctor, | ||
formAssociated, | ||
observedAttributes, | ||
@@ -192,0 +197,0 @@ lifecycleCallbacks, |
"use strict"; | ||
const DOMException = require("../generated/DOMException"); | ||
const { getLabelsForLabelable } = require("../helpers/form-controls"); | ||
class ElementInternalsImpl { | ||
@@ -18,2 +21,13 @@ constructor(globalObject, args, { targetElement }) { | ||
get labels() { | ||
if (!this._targetElement._ceDefinition.formAssociated) { | ||
throw DOMException.create(this._targetElement._globalObject, [ | ||
"Accesing an ElementInternal's labels property is only supported for form-associated custom elements", | ||
"NotSupportedError" | ||
]); | ||
} | ||
return getLabelsForLabelable(this._targetElement); | ||
} | ||
// https://html.spec.whatwg.org/#reflecting-content-attributes-in-idl-attributes | ||
@@ -20,0 +34,0 @@ _reflectGetTheElement() { |
@@ -197,2 +197,32 @@ "use strict"; | ||
} | ||
static any(signals) { | ||
if (arguments.length < 1) { | ||
throw new globalObject.TypeError( | ||
`Failed to execute 'any' on 'AbortSignal': 1 argument required, but only ${arguments.length} present.` | ||
); | ||
} | ||
const args = []; | ||
{ | ||
let curArg = arguments[0]; | ||
if (!utils.isObject(curArg)) { | ||
throw new globalObject.TypeError( | ||
"Failed to execute 'any' on 'AbortSignal': parameter 1" + " is not an iterable object." | ||
); | ||
} else { | ||
const V = []; | ||
const tmp = curArg; | ||
for (let nextItem of tmp) { | ||
nextItem = exports.convert(globalObject, nextItem, { | ||
context: "Failed to execute 'any' on 'AbortSignal': parameter 1" + "'s element" | ||
}); | ||
V.push(nextItem); | ||
} | ||
curArg = V; | ||
} | ||
args.push(curArg); | ||
} | ||
return utils.tryWrapperForImpl(Impl.implementation.any(globalObject, ...args)); | ||
} | ||
} | ||
@@ -206,3 +236,7 @@ Object.defineProperties(AbortSignal.prototype, { | ||
}); | ||
Object.defineProperties(AbortSignal, { abort: { enumerable: true }, timeout: { enumerable: true } }); | ||
Object.defineProperties(AbortSignal, { | ||
abort: { enumerable: true }, | ||
timeout: { enumerable: true }, | ||
any: { enumerable: true } | ||
}); | ||
ctorRegistry[interfaceName] = AbortSignal; | ||
@@ -209,0 +243,0 @@ |
@@ -135,2 +135,5 @@ "use strict"; | ||
} | ||
if (node._ceDefinition?.formAssociated) { | ||
return true; | ||
} | ||
@@ -146,3 +149,3 @@ return false; | ||
const root = labelable.getRootNode({}); | ||
labelable._labels = NodeList.create(root._globalObject, [], { | ||
labelable._labels = NodeList.createImpl(root._globalObject, [], { | ||
element: root, | ||
@@ -149,0 +152,0 @@ query: () => { |
@@ -193,5 +193,10 @@ "use strict"; | ||
if (!resendWithAuth) { | ||
const nextURL = redirectAddress.startsWith("https:") ? | ||
new URL(redirectAddress) : | ||
new URL(redirectAddress, this.currentURL); | ||
let nextURL; | ||
try { | ||
nextURL = new URL(redirectAddress, this.currentURL); | ||
} catch (e) { | ||
this.emit("error", e); | ||
return; | ||
} | ||
if (nextURL.hostname !== previousHostName) { | ||
@@ -198,0 +203,0 @@ this._removeMatchingHeaders(/^authorization$/i); |
@@ -204,3 +204,4 @@ "use strict"; | ||
_defaultView._length = frames.length; | ||
Array.prototype.forEach.call(frames, (frame, i) => { | ||
for (let i = 0; i < frames.length; ++i) { | ||
const frame = frames.item(i); | ||
Object.defineProperty(_defaultView, i, { | ||
@@ -213,3 +214,3 @@ configurable: true, | ||
}); | ||
}); | ||
} | ||
} | ||
@@ -216,0 +217,0 @@ |
@@ -72,6 +72,8 @@ "use strict"; | ||
// Warning for internal users: this returns a NodeList containing IDL wrappers instead of impls | ||
// WARNING FOR INTERNAL USERS: | ||
// This returns a NodeList impl, not a NodeList wrapper. NodeList impls are not iterable and do not have indexed | ||
// properties. To iterate over them, use `for (let i = 0; i < nodeListImpl.length; ++i) { nodeListImpl.item(i) }`. | ||
querySelectorAll(selectors) { | ||
if (shouldAlwaysSelectNothing(this)) { | ||
return NodeList.create(this._globalObject, [], { nodes: [] }); | ||
return NodeList.createImpl(this._globalObject, [], { nodes: [] }); | ||
} | ||
@@ -81,3 +83,3 @@ const matcher = addNwsapi(this); | ||
return NodeList.create(this._globalObject, [], { nodes: list.map(n => idlUtils.tryImplForWrapper(n)) }); | ||
return NodeList.createImpl(this._globalObject, [], { nodes: list.map(n => idlUtils.tryImplForWrapper(n)) }); | ||
} | ||
@@ -84,0 +86,0 @@ } |
{ | ||
"name": "jsdom", | ||
"version": "25.0.1", | ||
"version": "26.0.0", | ||
"description": "A JavaScript implementation of many web standards", | ||
@@ -26,13 +26,13 @@ "keywords": [ | ||
"dependencies": { | ||
"cssstyle": "^4.1.0", | ||
"cssstyle": "^4.2.1", | ||
"data-urls": "^5.0.0", | ||
"decimal.js": "^10.4.3", | ||
"form-data": "^4.0.0", | ||
"form-data": "^4.0.1", | ||
"html-encoding-sniffer": "^4.0.0", | ||
"http-proxy-agent": "^7.0.2", | ||
"https-proxy-agent": "^7.0.5", | ||
"https-proxy-agent": "^7.0.6", | ||
"is-potential-custom-element-name": "^1.0.1", | ||
"nwsapi": "^2.2.12", | ||
"parse5": "^7.1.2", | ||
"rrweb-cssom": "^0.7.1", | ||
"nwsapi": "^2.2.16", | ||
"parse5": "^7.2.1", | ||
"rrweb-cssom": "^0.8.0", | ||
"saxes": "^6.0.0", | ||
@@ -45,3 +45,3 @@ "symbol-tree": "^3.2.4", | ||
"whatwg-mimetype": "^4.0.0", | ||
"whatwg-url": "^14.0.0", | ||
"whatwg-url": "^14.1.0", | ||
"ws": "^8.18.0", | ||
@@ -51,3 +51,3 @@ "xml-name-validator": "^5.0.0" | ||
"peerDependencies": { | ||
"canvas": "^2.11.2" | ||
"canvas": "^3.0.0" | ||
}, | ||
@@ -62,8 +62,8 @@ "peerDependenciesMeta": { | ||
"benchmark": "^2.1.4", | ||
"eslint": "^9.11.0", | ||
"eslint": "^9.17.0", | ||
"eslint-plugin-html": "^8.1.2", | ||
"globals": "^15.9.0", | ||
"globals": "^15.14.0", | ||
"js-yaml": "^4.1.0", | ||
"minimatch": "^9.0.5", | ||
"mocha": "^10.7.3", | ||
"mocha": "^11.0.1", | ||
"mocha-sugar-free": "^1.4.0", | ||
@@ -70,0 +70,0 @@ "pngjs": "^7.0.0", |
Sorry, the diff of this file is too big to display
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
3114903
83080
+ Added@asamuzakjp/css-color@2.8.2(transitive)
+ Added@csstools/color-helpers@5.0.1(transitive)
+ Added@csstools/css-calc@2.1.1(transitive)
+ Added@csstools/css-color-parser@3.0.7(transitive)
+ Added@csstools/css-parser-algorithms@3.0.4(transitive)
+ Added@csstools/css-tokenizer@3.0.3(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbl@4.1.0(transitive)
+ Addedbuffer@5.7.1(transitive)
+ Addedcanvas@3.0.1(transitive)
+ Addedchownr@1.1.4(transitive)
+ Addedcssstyle@4.2.1(transitive)
+ Addeddecompress-response@6.0.0(transitive)
+ Addeddeep-extend@0.6.0(transitive)
+ Addedend-of-stream@1.4.4(transitive)
+ Addedexpand-template@2.0.3(transitive)
+ Addedfs-constants@1.0.0(transitive)
+ Addedgithub-from-package@0.0.0(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedini@1.3.8(transitive)
+ Addedlru-cache@11.0.2(transitive)
+ Addedmimic-response@3.1.0(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmkdirp-classic@0.5.3(transitive)
+ Addednapi-build-utils@1.0.2(transitive)
+ Addednode-abi@3.71.0(transitive)
+ Addednode-addon-api@7.1.1(transitive)
+ Addedprebuild-install@7.1.2(transitive)
+ Addedpump@3.0.2(transitive)
+ Addedrc@1.2.8(transitive)
+ Addedrrweb-cssom@0.8.0(transitive)
+ Addedsimple-get@4.0.1(transitive)
+ Addedstrip-json-comments@2.0.1(transitive)
+ Addedtar-fs@2.1.1(transitive)
+ Addedtar-stream@2.2.0(transitive)
+ Addedtough-cookie@5.1.0(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
- Removed@mapbox/node-pre-gyp@1.0.11(transitive)
- Removedabbrev@1.1.1(transitive)
- Removedagent-base@6.0.2(transitive)
- Removedansi-regex@5.0.1(transitive)
- Removedaproba@2.0.0(transitive)
- Removedare-we-there-yet@2.0.0(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedcanvas@2.11.2(transitive)
- Removedchownr@2.0.0(transitive)
- Removedcolor-support@1.1.3(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedconsole-control-strings@1.1.0(transitive)
- Removedcssstyle@4.1.0(transitive)
- Removeddelegates@1.0.0(transitive)
- Removedemoji-regex@8.0.0(transitive)
- Removedfs-minipass@2.1.0(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedgauge@3.0.2(transitive)
- Removedglob@7.2.3(transitive)
- Removedhas-unicode@2.0.1(transitive)
- Removedhttps-proxy-agent@5.0.1(transitive)
- Removedinflight@1.0.6(transitive)
- Removedis-fullwidth-code-point@3.0.0(transitive)
- Removedmake-dir@3.1.0(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedminipass@3.3.65.0.0(transitive)
- Removedminizlib@2.1.2(transitive)
- Removedmkdirp@1.0.4(transitive)
- Removednan@2.22.0(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removednopt@5.0.0(transitive)
- Removednpmlog@5.0.1(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedrimraf@3.0.2(transitive)
- Removedrrweb-cssom@0.7.1(transitive)
- Removedsemver@6.3.1(transitive)
- Removedset-blocking@2.0.0(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedstring-width@4.2.3(transitive)
- Removedstrip-ansi@6.0.1(transitive)
- Removedtar@6.2.1(transitive)
- Removedtough-cookie@5.0.0(transitive)
- Removedtr46@0.0.3(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)
- Removedwide-align@1.1.5(transitive)
- Removedyallist@4.0.0(transitive)
Updatedcssstyle@^4.2.1
Updatedform-data@^4.0.1
Updatedhttps-proxy-agent@^7.0.6
Updatednwsapi@^2.2.16
Updatedparse5@^7.2.1
Updatedrrweb-cssom@^0.8.0
Updatedwhatwg-url@^14.1.0