Skip to content

Commit

Permalink
fix: TypeError occurs when :has(+ …) is used with universal or root…
Browse files Browse the repository at this point in the history
… selector

- fix #1341
  • Loading branch information
MurakamiShinyu committed Jun 3, 2024
1 parent a43c2dc commit d124d62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/vivliostyle/css-cascade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1328,10 +1328,10 @@ export class MatchesRelationalAction extends MatchesAction {
override apply(cascadeInstance: CascadeInstance): void {
for (const selectorText of this.selectorTexts) {
let selectorWithScope: string;
let scopingRoot: Element;
let scopingRoot: ParentNode;
if (/^\s*[+~]/.test(selectorText)) {
// :has(+ F) or :has(~ F)
scopingRoot = cascadeInstance.currentElement.parentElement;
scopingRoot = cascadeInstance.currentElement.parentNode;
const index = Array.from(scopingRoot.children).indexOf(
cascadeInstance.currentElement,
);
Expand Down

0 comments on commit d124d62

Please sign in to comment.