Closed Bug 1820835 Opened 2 years ago Closed 2 years ago

Matching for :has() relative selectors

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
113 Branch
Tracking Status
firefox113 --- fixed

People

(Reporter: dshin, Assigned: dshin)

References

Details

Attachments

(2 files, 2 obsolete files)

No description provided.
Assignee: nobody → dshin
Severity: -- → S3
Blocks: has-pseudo

e.g. Given ':has( .b .c)', and '.a .b .c', if we try to run the match on .b, we
can terminate the right-to-left match early when the next element to match is .a.
We need to skip only at the exact nesting level since the escape in the further
nesting (e.g. ':has(:is(.a .b .c))') is valid.

Depends on D172019

As long as the relative selector matching does not escape the boundary defined
by the relative selector anchor element, it's trivially true that the match
is the descendant of the anchor element.

Depends on D172020

Attachment #9321918 - Attachment is obsolete: true
Attachment #9321919 - Attachment is obsolete: true
Blocks: 1822177
Attachment #9321917 - Attachment description: Bug 1820835: Part 1 - `:has` relative selector matching. r=emilio,#layout-reviewers → Bug 1820835: `:has` relative selector matching, with no caching/filtering. r=emilio,#layout-reviewers
Pushed by dshin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/655f5564fd2a `:has` relative selector matching, with no caching/filtering. r=emilio

Mixed results here... label and textarea is okay, but label and input fails (except for general sibling). so maybe problem with void elements?

Attached file has.html

What I tested with

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch

Of note, as :aja's testcase demonstrates: There are issues with style sharing cache (bug 1793012) that causes correctness issues.

Duplicate of this bug: 1825176
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: