@depup/jsdom 30.0.0-depup.0 → 30.0.1-depup.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -6
- package/changes.json +6 -10
- package/lib/generated/css-property-definitions.js +45 -3
- package/lib/generated/css-property-descriptors.js +6 -2
- package/lib/generated/css-property-metadata.js +26 -0
- package/lib/generated/idl/CSSStyleProperties.js +164 -0
- package/lib/jsdom/living/css/helpers/font-sizes.js +8 -2
- package/lib/jsdom/living/helpers/node.js +1 -20
- package/lib/jsdom/living/nodes/Document-impl.js +1 -3
- package/lib/jsdom/living/range/boundary-point.js +28 -12
- package/package.json +16 -20
package/README.md
CHANGED
|
@@ -13,18 +13,17 @@ npm install @depup/jsdom
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [jsdom](https://www.npmjs.com/package/jsdom) @ 30.0.
|
|
17
|
-
| Processed | 2026-
|
|
16
|
+
| Original | [jsdom](https://www.npmjs.com/package/jsdom) @ 30.0.1 |
|
|
17
|
+
| Processed | 2026-08-03 |
|
|
18
18
|
| Smoke test | passed |
|
|
19
|
-
| Deps updated |
|
|
19
|
+
| Deps updated | 2 |
|
|
20
20
|
|
|
21
21
|
## Dependency Changes
|
|
22
22
|
|
|
23
23
|
| Dependency | From | To |
|
|
24
24
|
|------------|------|-----|
|
|
25
|
-
| @asamuzakjp/dom-selector | ^8.
|
|
26
|
-
|
|
|
27
|
-
| undici | ^8.7.0 | ^8.9.0 |
|
|
25
|
+
| @asamuzakjp/dom-selector | ^8.3.0 | ^8.3.2 |
|
|
26
|
+
| undici | ^8.9.0 | ^8.10.0 |
|
|
28
27
|
|
|
29
28
|
---
|
|
30
29
|
|
package/changes.json
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"bumped": {
|
|
3
3
|
"@asamuzakjp/dom-selector": {
|
|
4
|
-
"from": "^8.
|
|
5
|
-
"to": "^8.3.
|
|
6
|
-
},
|
|
7
|
-
"@csstools/css-syntax-patches-for-csstree": {
|
|
8
|
-
"from": "^1.1.6",
|
|
9
|
-
"to": "^1.1.7"
|
|
4
|
+
"from": "^8.3.0",
|
|
5
|
+
"to": "^8.3.2"
|
|
10
6
|
},
|
|
11
7
|
"undici": {
|
|
12
|
-
"from": "^8.
|
|
13
|
-
"to": "^8.
|
|
8
|
+
"from": "^8.9.0",
|
|
9
|
+
"to": "^8.10.0"
|
|
14
10
|
}
|
|
15
11
|
},
|
|
16
|
-
"timestamp": "2026-
|
|
17
|
-
"totalUpdated":
|
|
12
|
+
"timestamp": "2026-08-03T16:51:13.613Z",
|
|
13
|
+
"totalUpdated": 2
|
|
18
14
|
}
|
|
@@ -1285,7 +1285,30 @@ module.exports = new Map([
|
|
|
1285
1285
|
"animation-delay",
|
|
1286
1286
|
{
|
|
1287
1287
|
"name": "animation-delay",
|
|
1288
|
-
"href": "https://drafts.csswg.org/css-animations-
|
|
1288
|
+
"href": "https://drafts.csswg.org/css-animations-2/#propdef-animation-delay",
|
|
1289
|
+
"initial": "see individual properties",
|
|
1290
|
+
"appliesTo": "see individual properties",
|
|
1291
|
+
"inherited": "see individual properties",
|
|
1292
|
+
"percentages": "see individual properties",
|
|
1293
|
+
"computedValue": "see individual properties",
|
|
1294
|
+
"animationType": "see individual properties",
|
|
1295
|
+
"canonicalOrder": "per grammar",
|
|
1296
|
+
"styleDeclaration": [
|
|
1297
|
+
"animation-delay",
|
|
1298
|
+
"animationDelay"
|
|
1299
|
+
],
|
|
1300
|
+
"longhands": [
|
|
1301
|
+
"animation-delay-start",
|
|
1302
|
+
"animation-delay-end"
|
|
1303
|
+
],
|
|
1304
|
+
"syntax": "[ <'animation-delay-start'> <'animation-delay-end'>? ]#"
|
|
1305
|
+
}
|
|
1306
|
+
],
|
|
1307
|
+
[
|
|
1308
|
+
"animation-delay-end",
|
|
1309
|
+
{
|
|
1310
|
+
"name": "animation-delay-end",
|
|
1311
|
+
"href": "https://drafts.csswg.org/css-animations-2/#propdef-animation-delay-end",
|
|
1289
1312
|
"initial": "0s",
|
|
1290
1313
|
"appliesTo": "all elements",
|
|
1291
1314
|
"inherited": "no",
|
|
@@ -1294,8 +1317,27 @@ module.exports = new Map([
|
|
|
1294
1317
|
"canonicalOrder": "per grammar",
|
|
1295
1318
|
"animationType": "not animatable",
|
|
1296
1319
|
"styleDeclaration": [
|
|
1297
|
-
"animation-delay",
|
|
1298
|
-
"
|
|
1320
|
+
"animation-delay-end",
|
|
1321
|
+
"animationDelayEnd"
|
|
1322
|
+
],
|
|
1323
|
+
"syntax": "<time [0s,∞]>#"
|
|
1324
|
+
}
|
|
1325
|
+
],
|
|
1326
|
+
[
|
|
1327
|
+
"animation-delay-start",
|
|
1328
|
+
{
|
|
1329
|
+
"name": "animation-delay-start",
|
|
1330
|
+
"href": "https://drafts.csswg.org/css-animations-2/#propdef-animation-delay-start",
|
|
1331
|
+
"initial": "0s",
|
|
1332
|
+
"appliesTo": "all elements",
|
|
1333
|
+
"inherited": "no",
|
|
1334
|
+
"percentages": "N/A",
|
|
1335
|
+
"computedValue": "list, each item a duration",
|
|
1336
|
+
"canonicalOrder": "per grammar",
|
|
1337
|
+
"animationType": "not animatable",
|
|
1338
|
+
"styleDeclaration": [
|
|
1339
|
+
"animation-delay-start",
|
|
1340
|
+
"animationDelayStart"
|
|
1299
1341
|
],
|
|
1300
1342
|
"syntax": "<time>#"
|
|
1301
1343
|
}
|
|
@@ -292,8 +292,12 @@ module.exports = {
|
|
|
292
292
|
"animation": createGenericPropertyDescriptor("animation", {"caseSensitive":true,"dimensionTypes":{"number":{"max":null,"min":0,"type":"number"},"dimension":{"type":"dimension"}}}),
|
|
293
293
|
"animation-composition": createGenericPropertyDescriptor("animation-composition", {"caseSensitive":false}),
|
|
294
294
|
"animationComposition": createGenericPropertyDescriptor("animation-composition", {"caseSensitive":false}),
|
|
295
|
-
"animation-delay": createGenericPropertyDescriptor("animation-delay", {"caseSensitive":false,"dimensionTypes":{"dimension":{"type":"dimension"}}}),
|
|
296
|
-
"animationDelay": createGenericPropertyDescriptor("animation-delay", {"caseSensitive":false,"dimensionTypes":{"dimension":{"type":"dimension"}}}),
|
|
295
|
+
"animation-delay": createGenericPropertyDescriptor("animation-delay", {"caseSensitive":false,"dimensionTypes":{"dimension":{"max":null,"min":"0s","type":"dimension"}}}),
|
|
296
|
+
"animationDelay": createGenericPropertyDescriptor("animation-delay", {"caseSensitive":false,"dimensionTypes":{"dimension":{"max":null,"min":"0s","type":"dimension"}}}),
|
|
297
|
+
"animation-delay-end": createGenericPropertyDescriptor("animation-delay-end", {"caseSensitive":false,"dimensionTypes":{"dimension":{"max":null,"min":"0s","type":"dimension"}}}),
|
|
298
|
+
"animationDelayEnd": createGenericPropertyDescriptor("animation-delay-end", {"caseSensitive":false,"dimensionTypes":{"dimension":{"max":null,"min":"0s","type":"dimension"}}}),
|
|
299
|
+
"animation-delay-start": createGenericPropertyDescriptor("animation-delay-start", {"caseSensitive":false,"dimensionTypes":{"dimension":{"type":"dimension"}}}),
|
|
300
|
+
"animationDelayStart": createGenericPropertyDescriptor("animation-delay-start", {"caseSensitive":false,"dimensionTypes":{"dimension":{"type":"dimension"}}}),
|
|
297
301
|
"animation-direction": createGenericPropertyDescriptor("animation-direction", {"caseSensitive":false}),
|
|
298
302
|
"animationDirection": createGenericPropertyDescriptor("animation-direction", {"caseSensitive":false}),
|
|
299
303
|
"animation-duration": createGenericPropertyDescriptor("animation-duration", {"caseSensitive":false,"dimensionTypes":{"dimension":{"max":null,"min":"0s","type":"dimension"}}}),
|
|
@@ -685,6 +685,32 @@ module.exports = new Map([
|
|
|
685
685
|
],
|
|
686
686
|
[
|
|
687
687
|
"animation-delay",
|
|
688
|
+
{
|
|
689
|
+
"caseSensitive": false,
|
|
690
|
+
"dimensionTypes": {
|
|
691
|
+
"dimension": {
|
|
692
|
+
"max": null,
|
|
693
|
+
"min": "0s",
|
|
694
|
+
"type": "dimension"
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
],
|
|
699
|
+
[
|
|
700
|
+
"animation-delay-end",
|
|
701
|
+
{
|
|
702
|
+
"caseSensitive": false,
|
|
703
|
+
"dimensionTypes": {
|
|
704
|
+
"dimension": {
|
|
705
|
+
"max": null,
|
|
706
|
+
"min": "0s",
|
|
707
|
+
"type": "dimension"
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
],
|
|
712
|
+
[
|
|
713
|
+
"animation-delay-start",
|
|
688
714
|
{
|
|
689
715
|
"caseSensitive": false,
|
|
690
716
|
"dimensionTypes": {
|
|
@@ -9374,6 +9374,166 @@ exports.install = (globalObject, globalNames) => {
|
|
|
9374
9374
|
}
|
|
9375
9375
|
}
|
|
9376
9376
|
|
|
9377
|
+
get "animation-delay-end"() {
|
|
9378
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
9379
|
+
|
|
9380
|
+
if (!exports.is(esValue)) {
|
|
9381
|
+
throw new globalObject.TypeError(
|
|
9382
|
+
"'get animation-delay-end' called on an object that is not a valid instance of CSSStyleProperties."
|
|
9383
|
+
);
|
|
9384
|
+
}
|
|
9385
|
+
|
|
9386
|
+
ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
|
|
9387
|
+
try {
|
|
9388
|
+
return utils.tryWrapperForImpl(esValue[implSymbol]["animation-delay-end"]);
|
|
9389
|
+
} finally {
|
|
9390
|
+
ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
|
|
9391
|
+
}
|
|
9392
|
+
}
|
|
9393
|
+
|
|
9394
|
+
set "animation-delay-end"(V) {
|
|
9395
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
9396
|
+
|
|
9397
|
+
if (!exports.is(esValue)) {
|
|
9398
|
+
throw new globalObject.TypeError(
|
|
9399
|
+
"'set animation-delay-end' called on an object that is not a valid instance of CSSStyleProperties."
|
|
9400
|
+
);
|
|
9401
|
+
}
|
|
9402
|
+
|
|
9403
|
+
V = conversions["DOMString"](V, {
|
|
9404
|
+
context: "Failed to set the 'animation-delay-end' property on 'CSSStyleProperties': The provided value",
|
|
9405
|
+
globals: globalObject,
|
|
9406
|
+
treatNullAsEmptyString: true
|
|
9407
|
+
});
|
|
9408
|
+
|
|
9409
|
+
ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
|
|
9410
|
+
try {
|
|
9411
|
+
esValue[implSymbol]["animation-delay-end"] = V;
|
|
9412
|
+
} finally {
|
|
9413
|
+
ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
|
|
9414
|
+
}
|
|
9415
|
+
}
|
|
9416
|
+
|
|
9417
|
+
get animationDelayEnd() {
|
|
9418
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
9419
|
+
|
|
9420
|
+
if (!exports.is(esValue)) {
|
|
9421
|
+
throw new globalObject.TypeError(
|
|
9422
|
+
"'get animationDelayEnd' called on an object that is not a valid instance of CSSStyleProperties."
|
|
9423
|
+
);
|
|
9424
|
+
}
|
|
9425
|
+
|
|
9426
|
+
ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
|
|
9427
|
+
try {
|
|
9428
|
+
return utils.tryWrapperForImpl(esValue[implSymbol]["animationDelayEnd"]);
|
|
9429
|
+
} finally {
|
|
9430
|
+
ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
|
|
9431
|
+
}
|
|
9432
|
+
}
|
|
9433
|
+
|
|
9434
|
+
set animationDelayEnd(V) {
|
|
9435
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
9436
|
+
|
|
9437
|
+
if (!exports.is(esValue)) {
|
|
9438
|
+
throw new globalObject.TypeError(
|
|
9439
|
+
"'set animationDelayEnd' called on an object that is not a valid instance of CSSStyleProperties."
|
|
9440
|
+
);
|
|
9441
|
+
}
|
|
9442
|
+
|
|
9443
|
+
V = conversions["DOMString"](V, {
|
|
9444
|
+
context: "Failed to set the 'animationDelayEnd' property on 'CSSStyleProperties': The provided value",
|
|
9445
|
+
globals: globalObject,
|
|
9446
|
+
treatNullAsEmptyString: true
|
|
9447
|
+
});
|
|
9448
|
+
|
|
9449
|
+
ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
|
|
9450
|
+
try {
|
|
9451
|
+
esValue[implSymbol]["animationDelayEnd"] = V;
|
|
9452
|
+
} finally {
|
|
9453
|
+
ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
|
|
9454
|
+
}
|
|
9455
|
+
}
|
|
9456
|
+
|
|
9457
|
+
get "animation-delay-start"() {
|
|
9458
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
9459
|
+
|
|
9460
|
+
if (!exports.is(esValue)) {
|
|
9461
|
+
throw new globalObject.TypeError(
|
|
9462
|
+
"'get animation-delay-start' called on an object that is not a valid instance of CSSStyleProperties."
|
|
9463
|
+
);
|
|
9464
|
+
}
|
|
9465
|
+
|
|
9466
|
+
ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
|
|
9467
|
+
try {
|
|
9468
|
+
return utils.tryWrapperForImpl(esValue[implSymbol]["animation-delay-start"]);
|
|
9469
|
+
} finally {
|
|
9470
|
+
ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
|
|
9471
|
+
}
|
|
9472
|
+
}
|
|
9473
|
+
|
|
9474
|
+
set "animation-delay-start"(V) {
|
|
9475
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
9476
|
+
|
|
9477
|
+
if (!exports.is(esValue)) {
|
|
9478
|
+
throw new globalObject.TypeError(
|
|
9479
|
+
"'set animation-delay-start' called on an object that is not a valid instance of CSSStyleProperties."
|
|
9480
|
+
);
|
|
9481
|
+
}
|
|
9482
|
+
|
|
9483
|
+
V = conversions["DOMString"](V, {
|
|
9484
|
+
context: "Failed to set the 'animation-delay-start' property on 'CSSStyleProperties': The provided value",
|
|
9485
|
+
globals: globalObject,
|
|
9486
|
+
treatNullAsEmptyString: true
|
|
9487
|
+
});
|
|
9488
|
+
|
|
9489
|
+
ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
|
|
9490
|
+
try {
|
|
9491
|
+
esValue[implSymbol]["animation-delay-start"] = V;
|
|
9492
|
+
} finally {
|
|
9493
|
+
ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
|
|
9494
|
+
}
|
|
9495
|
+
}
|
|
9496
|
+
|
|
9497
|
+
get animationDelayStart() {
|
|
9498
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
9499
|
+
|
|
9500
|
+
if (!exports.is(esValue)) {
|
|
9501
|
+
throw new globalObject.TypeError(
|
|
9502
|
+
"'get animationDelayStart' called on an object that is not a valid instance of CSSStyleProperties."
|
|
9503
|
+
);
|
|
9504
|
+
}
|
|
9505
|
+
|
|
9506
|
+
ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
|
|
9507
|
+
try {
|
|
9508
|
+
return utils.tryWrapperForImpl(esValue[implSymbol]["animationDelayStart"]);
|
|
9509
|
+
} finally {
|
|
9510
|
+
ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
|
|
9511
|
+
}
|
|
9512
|
+
}
|
|
9513
|
+
|
|
9514
|
+
set animationDelayStart(V) {
|
|
9515
|
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
9516
|
+
|
|
9517
|
+
if (!exports.is(esValue)) {
|
|
9518
|
+
throw new globalObject.TypeError(
|
|
9519
|
+
"'set animationDelayStart' called on an object that is not a valid instance of CSSStyleProperties."
|
|
9520
|
+
);
|
|
9521
|
+
}
|
|
9522
|
+
|
|
9523
|
+
V = conversions["DOMString"](V, {
|
|
9524
|
+
context: "Failed to set the 'animationDelayStart' property on 'CSSStyleProperties': The provided value",
|
|
9525
|
+
globals: globalObject,
|
|
9526
|
+
treatNullAsEmptyString: true
|
|
9527
|
+
});
|
|
9528
|
+
|
|
9529
|
+
ceReactionsPreSteps_jsdom_living_helpers_custom_elements(globalObject);
|
|
9530
|
+
try {
|
|
9531
|
+
esValue[implSymbol]["animationDelayStart"] = V;
|
|
9532
|
+
} finally {
|
|
9533
|
+
ceReactionsPostSteps_jsdom_living_helpers_custom_elements(globalObject);
|
|
9534
|
+
}
|
|
9535
|
+
}
|
|
9536
|
+
|
|
9377
9537
|
get "animation-direction"() {
|
|
9378
9538
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
9379
9539
|
|
|
@@ -65510,6 +65670,10 @@ exports.install = (globalObject, globalNames) => {
|
|
|
65510
65670
|
animationComposition: { enumerable: true },
|
|
65511
65671
|
"animation-delay": { enumerable: true },
|
|
65512
65672
|
animationDelay: { enumerable: true },
|
|
65673
|
+
"animation-delay-end": { enumerable: true },
|
|
65674
|
+
animationDelayEnd: { enumerable: true },
|
|
65675
|
+
"animation-delay-start": { enumerable: true },
|
|
65676
|
+
animationDelayStart: { enumerable: true },
|
|
65513
65677
|
"animation-direction": { enumerable: true },
|
|
65514
65678
|
animationDirection: { enumerable: true },
|
|
65515
65679
|
"animation-duration": { enumerable: true },
|
|
@@ -113,8 +113,14 @@ function resolveLengthInPixels(elementImpl, size, dimension, isFontSize) {
|
|
|
113
113
|
format: "computedValue"
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
-
const
|
|
117
|
-
|
|
116
|
+
const matchLength = LENGTH_REGEXP.exec(resolvedSize);
|
|
117
|
+
if (matchLength) {
|
|
118
|
+
const [, value] = matchLength;
|
|
119
|
+
return Number(value);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Return as-is as a fallback.
|
|
123
|
+
return size;
|
|
118
124
|
}
|
|
119
125
|
|
|
120
126
|
const match = LENGTH_REGEXP.exec(size);
|
|
@@ -81,28 +81,9 @@ function isInclusiveAncestor(ancestorNode, node) {
|
|
|
81
81
|
return false;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
// https://dom.spec.whatwg.org/#concept-tree-following
|
|
85
|
-
function isFollowing(nodeA, nodeB) {
|
|
86
|
-
if (nodeA === nodeB) {
|
|
87
|
-
return false;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
let current = nodeB;
|
|
91
|
-
while (current) {
|
|
92
|
-
if (current === nodeA) {
|
|
93
|
-
return true;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
current = domSymbolTree.following(current);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
return false;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
84
|
module.exports = {
|
|
103
85
|
nodeLength,
|
|
104
86
|
nodeRoot,
|
|
105
87
|
|
|
106
|
-
isInclusiveAncestor
|
|
107
|
-
isFollowing
|
|
88
|
+
isInclusiveAncestor
|
|
108
89
|
};
|
|
@@ -848,9 +848,7 @@ class DocumentImpl extends NodeImpl {
|
|
|
848
848
|
});
|
|
849
849
|
}
|
|
850
850
|
|
|
851
|
-
|
|
852
|
-
// that supplies the default value.
|
|
853
|
-
createTreeWalker(root, whatToShow, filter = null) {
|
|
851
|
+
createTreeWalker(root, whatToShow, filter) {
|
|
854
852
|
return TreeWalker.createImpl(this._globalObject, [], { root, whatToShow, filter });
|
|
855
853
|
}
|
|
856
854
|
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
const { TreePosition } = require("symbol-tree");
|
|
3
4
|
const { domSymbolTree } = require("../helpers/internal-constants");
|
|
4
|
-
const { nodeRoot, isFollowing, isInclusiveAncestor } = require("../helpers/node");
|
|
5
5
|
|
|
6
6
|
// Returns 0 if equal, +1 for after and -1 for before
|
|
7
7
|
// https://dom.spec.whatwg.org/#concept-range-bp-after
|
|
8
|
+
//
|
|
9
|
+
// The relative tree position comes from symbol-tree, which walks the two
|
|
10
|
+
// ancestor chains and compares indices within their lowest common ancestor.
|
|
11
|
+
// Deriving it from a tree-order scan instead — walking forward from one node
|
|
12
|
+
// until the other is found or the tree runs out — costs O(nodes following the
|
|
13
|
+
// node) per comparison, and the Range containment tests call this once or twice
|
|
14
|
+
// per candidate node.
|
|
8
15
|
function compareBoundaryPointsPosition(bpA, bpB) {
|
|
9
16
|
const { node: nodeA, offset: offsetA } = bpA;
|
|
10
17
|
const { node: nodeB, offset: offsetB } = bpB;
|
|
11
18
|
|
|
12
|
-
if (nodeRoot(nodeA) !== nodeRoot(nodeB)) {
|
|
13
|
-
throw new Error(`Internal Error: Boundary points should have the same root!`);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
19
|
if (nodeA === nodeB) {
|
|
17
20
|
if (offsetA === offsetB) {
|
|
18
21
|
return 0;
|
|
@@ -23,23 +26,36 @@ function compareBoundaryPointsPosition(bpA, bpB) {
|
|
|
23
26
|
return 1;
|
|
24
27
|
}
|
|
25
28
|
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
const position = domSymbolTree.compareTreePosition(nodeA, nodeB);
|
|
30
|
+
|
|
31
|
+
if (position & TreePosition.DISCONNECTED) {
|
|
32
|
+
throw new Error(`Internal Error: Boundary points should have the same root!`);
|
|
28
33
|
}
|
|
29
34
|
|
|
30
|
-
|
|
35
|
+
// nodeA is an ancestor of nodeB: the boundary points are ordered by whether
|
|
36
|
+
// offsetA is past the child of nodeA that contains nodeB.
|
|
37
|
+
if (position & TreePosition.CONTAINED_BY) {
|
|
31
38
|
let child = nodeB;
|
|
32
|
-
|
|
33
39
|
while (domSymbolTree.parent(child) !== nodeA) {
|
|
34
40
|
child = domSymbolTree.parent(child);
|
|
35
41
|
}
|
|
36
42
|
|
|
37
|
-
|
|
38
|
-
|
|
43
|
+
return domSymbolTree.index(child) < offsetA ? 1 : -1;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// nodeB is an ancestor of nodeA, i.e. the mirror of the above with the
|
|
47
|
+
// boundary points swapped, so the result is inverted.
|
|
48
|
+
if (position & TreePosition.CONTAINS) {
|
|
49
|
+
let child = nodeA;
|
|
50
|
+
while (domSymbolTree.parent(child) !== nodeB) {
|
|
51
|
+
child = domSymbolTree.parent(child);
|
|
39
52
|
}
|
|
53
|
+
|
|
54
|
+
return domSymbolTree.index(child) < offsetB ? -1 : 1;
|
|
40
55
|
}
|
|
41
56
|
|
|
42
|
-
|
|
57
|
+
// Disjoint subtrees: tree order alone decides.
|
|
58
|
+
return position & TreePosition.PRECEDING ? 1 : -1;
|
|
43
59
|
}
|
|
44
60
|
|
|
45
61
|
module.exports = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/jsdom",
|
|
3
|
-
"version": "30.0.
|
|
3
|
+
"version": "30.0.1-depup.1",
|
|
4
4
|
"description": "A JavaScript implementation of many web standards (with updated dependencies)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jsdom",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@asamuzakjp/css-color": "^6.0.5",
|
|
33
|
-
"@asamuzakjp/dom-selector": "^8.3.
|
|
33
|
+
"@asamuzakjp/dom-selector": "^8.3.2",
|
|
34
34
|
"@bramus/specificity": "^2.4.2",
|
|
35
35
|
"@csstools/css-syntax-patches-for-csstree": "^1.1.7",
|
|
36
36
|
"@exodus/bytes": "^1.15.1",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"saxes": "^6.0.0",
|
|
45
45
|
"symbol-tree": "^3.2.4",
|
|
46
46
|
"tough-cookie": "^6.0.2",
|
|
47
|
-
"undici": "^8.
|
|
47
|
+
"undici": "^8.10.0",
|
|
48
48
|
"w3c-xmlserializer": "^5.0.0",
|
|
49
49
|
"webidl-conversions": "^8.0.1",
|
|
50
50
|
"whatwg-mimetype": "^5.0.0",
|
|
@@ -62,20 +62,20 @@
|
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@domenic/eslint-config": "^5.1.0",
|
|
64
64
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
65
|
-
"@webref/css": "^8.7.
|
|
66
|
-
"eslint": "^10.
|
|
65
|
+
"@webref/css": "^8.7.1",
|
|
66
|
+
"eslint": "^10.8.0",
|
|
67
67
|
"eslint-plugin-html": "^8.1.4",
|
|
68
68
|
"eslint-plugin-n": "^18.2.2",
|
|
69
|
-
"globals": "^17.
|
|
70
|
-
"js-yaml": "^5.2.
|
|
69
|
+
"globals": "^17.8.0",
|
|
70
|
+
"js-yaml": "^5.2.2",
|
|
71
71
|
"mocha": "^11.7.6",
|
|
72
72
|
"mocha-sugar-free": "^1.4.0",
|
|
73
|
-
"npm-run-all2": "^9.0.
|
|
73
|
+
"npm-run-all2": "^9.0.3",
|
|
74
74
|
"opener": "^1.5.2",
|
|
75
75
|
"pngjs": "^7.0.0",
|
|
76
76
|
"semver": "^7.8.5",
|
|
77
77
|
"server-destroy": "^1.0.1",
|
|
78
|
-
"tinybench": "^6.
|
|
78
|
+
"tinybench": "^6.1.2",
|
|
79
79
|
"webidl2": "^24.5.0",
|
|
80
80
|
"webidl2js": "^20.1.0",
|
|
81
81
|
"wireit": "^0.14.13"
|
|
@@ -131,22 +131,18 @@
|
|
|
131
131
|
"depup": {
|
|
132
132
|
"changes": {
|
|
133
133
|
"@asamuzakjp/dom-selector": {
|
|
134
|
-
"from": "^8.
|
|
135
|
-
"to": "^8.3.
|
|
136
|
-
},
|
|
137
|
-
"@csstools/css-syntax-patches-for-csstree": {
|
|
138
|
-
"from": "^1.1.6",
|
|
139
|
-
"to": "^1.1.7"
|
|
134
|
+
"from": "^8.3.0",
|
|
135
|
+
"to": "^8.3.2"
|
|
140
136
|
},
|
|
141
137
|
"undici": {
|
|
142
|
-
"from": "^8.
|
|
143
|
-
"to": "^8.
|
|
138
|
+
"from": "^8.9.0",
|
|
139
|
+
"to": "^8.10.0"
|
|
144
140
|
}
|
|
145
141
|
},
|
|
146
|
-
"depsUpdated":
|
|
142
|
+
"depsUpdated": 2,
|
|
147
143
|
"originalPackage": "jsdom",
|
|
148
|
-
"originalVersion": "30.0.
|
|
149
|
-
"processedAt": "2026-
|
|
144
|
+
"originalVersion": "30.0.1",
|
|
145
|
+
"processedAt": "2026-08-03T16:51:19.047Z",
|
|
150
146
|
"smokeTest": "passed"
|
|
151
147
|
}
|
|
152
148
|
}
|