🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

jsdom

Package Overview
Dependencies
Maintainers
6
Versions
285
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsdom - npm Package Compare versions

Comparing version
30.0.0
to
30.0.1
+8
-2
lib/jsdom/living/css/helpers/font-sizes.js

@@ -116,4 +116,10 @@ "use strict";

}
const [, value] = FONT_SIZE_REGEXP.exec(resolvedSize);
return Number(value);
const matchLength = LENGTH_REGEXP.exec(resolvedSize);
if (matchLength) {
const [, value] = matchLength;
return Number(value);
}
// Return as-is as a fallback.
return size;
}

@@ -120,0 +126,0 @@

+1
-20

@@ -84,20 +84,2 @@ "use strict";

// https://dom.spec.whatwg.org/#concept-tree-following
function isFollowing(nodeA, nodeB) {
if (nodeA === nodeB) {
return false;
}
let current = nodeB;
while (current) {
if (current === nodeA) {
return true;
}
current = domSymbolTree.following(current);
}
return false;
}
module.exports = {

@@ -107,4 +89,3 @@ nodeLength,

isInclusiveAncestor,
isFollowing
isInclusiveAncestor
};

@@ -851,5 +851,3 @@ "use strict";

// `@asamuzakjp/dom-selector` calls this method directly for universal selectors, bypassing the Web IDL wrapper
// that supplies the default value.
createTreeWalker(root, whatToShow, filter = null) {
createTreeWalker(root, whatToShow, filter) {
return TreeWalker.createImpl(this._globalObject, [], { root, whatToShow, filter });

@@ -856,0 +854,0 @@ }

"use strict";
const { TreePosition } = require("symbol-tree");
const { domSymbolTree } = require("../helpers/internal-constants");
const { nodeRoot, isFollowing, isInclusiveAncestor } = require("../helpers/node");
// Returns 0 if equal, +1 for after and -1 for before
// https://dom.spec.whatwg.org/#concept-range-bp-after
//
// The relative tree position comes from symbol-tree, which walks the two
// ancestor chains and compares indices within their lowest common ancestor.
// Deriving it from a tree-order scan instead — walking forward from one node
// until the other is found or the tree runs out — costs O(nodes following the
// node) per comparison, and the Range containment tests call this once or twice
// per candidate node.
function compareBoundaryPointsPosition(bpA, bpB) {

@@ -12,6 +19,2 @@ const { node: nodeA, offset: offsetA } = bpA;

if (nodeRoot(nodeA) !== nodeRoot(nodeB)) {
throw new Error(`Internal Error: Boundary points should have the same root!`);
}
if (nodeA === nodeB) {

@@ -27,9 +30,12 @@ if (offsetA === offsetB) {

if (isFollowing(nodeA, nodeB)) {
return compareBoundaryPointsPosition(bpB, bpA) === -1 ? 1 : -1;
const position = domSymbolTree.compareTreePosition(nodeA, nodeB);
if (position & TreePosition.DISCONNECTED) {
throw new Error(`Internal Error: Boundary points should have the same root!`);
}
if (isInclusiveAncestor(nodeA, nodeB)) {
// nodeA is an ancestor of nodeB: the boundary points are ordered by whether
// offsetA is past the child of nodeA that contains nodeB.
if (position & TreePosition.CONTAINED_BY) {
let child = nodeB;
while (domSymbolTree.parent(child) !== nodeA) {

@@ -39,8 +45,18 @@ child = domSymbolTree.parent(child);

if (domSymbolTree.index(child) < offsetA) {
return 1;
return domSymbolTree.index(child) < offsetA ? 1 : -1;
}
// nodeB is an ancestor of nodeA, i.e. the mirror of the above with the
// boundary points swapped, so the result is inverted.
if (position & TreePosition.CONTAINS) {
let child = nodeA;
while (domSymbolTree.parent(child) !== nodeB) {
child = domSymbolTree.parent(child);
}
return domSymbolTree.index(child) < offsetB ? -1 : 1;
}
return -1;
// Disjoint subtrees: tree order alone decides.
return position & TreePosition.PRECEDING ? 1 : -1;
}

@@ -47,0 +63,0 @@

{
"name": "jsdom",
"version": "30.0.0",
"version": "30.0.1",
"description": "A JavaScript implementation of many web standards",

@@ -27,5 +27,5 @@ "keywords": [

"@asamuzakjp/css-color": "^6.0.5",
"@asamuzakjp/dom-selector": "^8.2.5",
"@asamuzakjp/dom-selector": "^8.3.0",
"@bramus/specificity": "^2.4.2",
"@csstools/css-syntax-patches-for-csstree": "^1.1.6",
"@csstools/css-syntax-patches-for-csstree": "^1.1.7",
"@exodus/bytes": "^1.15.1",

@@ -42,3 +42,3 @@ "css-tree": "^3.2.1",

"tough-cookie": "^6.0.2",
"undici": "^8.7.0",
"undici": "^8.9.0",
"w3c-xmlserializer": "^5.0.0",

@@ -61,11 +61,11 @@ "webidl-conversions": "^8.0.1",

"@stylistic/eslint-plugin": "^5.10.0",
"@webref/css": "^8.7.0",
"eslint": "^10.7.0",
"@webref/css": "^8.7.1",
"eslint": "^10.8.0",
"eslint-plugin-html": "^8.1.4",
"eslint-plugin-n": "^18.2.2",
"globals": "^17.7.0",
"js-yaml": "^5.2.1",
"globals": "^17.8.0",
"js-yaml": "^5.2.2",
"mocha": "^11.7.6",
"mocha-sugar-free": "^1.4.0",
"npm-run-all2": "^9.0.2",
"npm-run-all2": "^9.0.3",
"opener": "^1.5.2",

@@ -75,3 +75,3 @@ "pngjs": "^7.0.0",

"server-destroy": "^1.0.1",
"tinybench": "^6.0.2",
"tinybench": "^6.1.2",
"webidl2": "^24.5.0",

@@ -78,0 +78,0 @@ "webidl2js": "^20.1.0",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display