Files
ladybird/Tests/LibWeb/Text/expected/wpt-import/dom/nodes/Element-closest.txt
Adam Colvin 994e8123ba LibWeb: Pass scope through pseudo-classes for proper :scope matching
The :scope pseudo-class inside :has(), :is(), :where(), and :not()
selectors was not receiving the scoping root from outer selector
contexts like Element.closest().

This fix passes the scope parameter through matches_has_pseudo_class(),
matches_relative_selector(), and the :is()/:where()/:not() cases so
that :scope correctly refers to the scoping root element.

This fixes WPT tests for Element.closest() with selector
':has(> :scope)' and for comparing :has(:scope) with :is(:scope)
selectors.
2026-02-02 12:47:32 +00:00

34 lines
2.2 KiB
Plaintext

Harness status: OK
Found 29 tests
29 Pass
Pass Element.closest with context node 'test12' and selector 'select'
Pass Element.closest with context node 'test13' and selector 'fieldset'
Pass Element.closest with context node 'test13' and selector 'div'
Pass Element.closest with context node 'test3' and selector 'body'
Pass Element.closest with context node 'test4' and selector '[default]'
Pass Element.closest with context node 'test4' and selector '[selected]'
Pass Element.closest with context node 'test11' and selector '[selected]'
Pass Element.closest with context node 'test12' and selector '[name="form-a"]'
Pass Element.closest with context node 'test13' and selector 'form[name="form-a"]'
Pass Element.closest with context node 'test9' and selector 'input[required]'
Pass Element.closest with context node 'test9' and selector 'select[required]'
Pass Element.closest with context node 'test13' and selector 'div:not(.div1)'
Pass Element.closest with context node 'test6' and selector 'div.div3'
Pass Element.closest with context node 'test1' and selector 'div#test7'
Pass Element.closest with context node 'test12' and selector '.div3 > .div2'
Pass Element.closest with context node 'test12' and selector '.div3 > .div1'
Pass Element.closest with context node 'test9' and selector 'form > input[required]'
Pass Element.closest with context node 'test12' and selector 'fieldset > select[required]'
Pass Element.closest with context node 'test6' and selector 'input + fieldset'
Pass Element.closest with context node 'test3' and selector 'form + form'
Pass Element.closest with context node 'test5' and selector 'form + form'
Pass Element.closest with context node 'test10' and selector ':empty'
Pass Element.closest with context node 'test11' and selector ':last-child'
Pass Element.closest with context node 'test12' and selector ':first-child'
Pass Element.closest with context node 'test11' and selector ':invalid'
Pass Element.closest with context node 'test4' and selector ':scope'
Pass Element.closest with context node 'test4' and selector 'select > :scope'
Pass Element.closest with context node 'test4' and selector 'div > :scope'
Pass Element.closest with context node 'test4' and selector ':has(> :scope)'