Skip to content

Commit 8a877ac

Browse files
authored
Update @asamuzakjp/dom-selector
Fixes #3928. See also #3931.
1 parent 22cc228 commit 8a877ac

File tree

3 files changed

+31
-11
lines changed

3 files changed

+31
-11
lines changed

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
"url": "git+https://github.com/jsdom/jsdom.git"
2424
},
2525
"dependencies": {
26-
"@asamuzakjp/dom-selector": "^6.5.4",
26+
"@asamuzakjp/dom-selector": "^6.5.5",
2727
"cssstyle": "^5.3.0",
2828
"data-urls": "^6.0.0",
29-
"decimal.js": "^10.5.0",
29+
"decimal.js": "^10.6.0",
3030
"html-encoding-sniffer": "^4.0.0",
3131
"http-proxy-agent": "^7.0.2",
3232
"https-proxy-agent": "^7.0.6",
@@ -41,7 +41,7 @@
4141
"whatwg-encoding": "^3.1.1",
4242
"whatwg-mimetype": "^4.0.0",
4343
"whatwg-url": "^15.0.0",
44-
"ws": "^8.18.2",
44+
"ws": "^8.18.3",
4545
"xml-name-validator": "^5.0.0"
4646
},
4747
"peerDependencies": {
@@ -59,7 +59,7 @@
5959
"eslint-plugin-html": "^8.1.3",
6060
"globals": "^16.4.0",
6161
"js-yaml": "^4.1.0",
62-
"minimatch": "^10.0.1",
62+
"minimatch": "^10.0.3",
6363
"mocha": "^11.7.2",
6464
"mocha-sugar-free": "^1.4.0",
6565
"npm-run-all2": "^8.0.4",

test/api/from-outside.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,24 @@ describe("Test cases only possible to test from the outside", () => {
9393
const [fontFaceRule] = sheet.cssRules;
9494
assert.equal(fontFaceRule.type, window.CSSRule.FONT_FACE_RULE, "Rule should be a CSSFontFaceRule");
9595
});
96+
97+
it("should switch node context on querySelector() (GH-3928)", () => {
98+
const html = `
99+
<div>
100+
<span id="s1">Actions</span>
101+
<ul>
102+
<li>
103+
<a href="/">
104+
<span id="s2">Link</span>
105+
</a>
106+
</li>
107+
</ul>
108+
</div>
109+
`;
110+
const { window } = new JSDOM(html);
111+
const { document } = window;
112+
const anchor = document.querySelector("a");
113+
const span = anchor.querySelector("span");
114+
assert.equal(span.innerHTML, "Link");
115+
});
96116
});

0 commit comments

Comments
 (0)