script: Avoid unwraps in DocumentOrShadowRoot::element_from_point. (#35130)

* script: Handle shadow roots in DocumentOrShadowRoot::element_from_point.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Clippy fixes.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2025-01-22 22:04:56 -05:00 committed by GitHub
parent 2ee25e344d
commit 1d6bd2570f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 20 deletions

View file

@ -1,26 +1,7 @@
[DocumentOrShadowRoot-prototype-elementFromPoint.html]
expected: CRASH
[document.elementFromPoint and shadow.ElementFromPoint must return the shadow host of the hit-tested text node when the hit-tested text node is a direct child of the root and the host has display: inline]
expected: FAIL
[document.elementFromPoint and shadow.ElementFromPoint must return the shadow host of the hit-tested text node when the hit-tested text node is a direct child of the root and the host has display: block]
expected: FAIL
[document.elementFromPoint and shadow.ElementFromPoint must return the shadow host of the hit-tested text node when the hit-tested text node is a direct child of the root and the host has display: inline-block]
expected: FAIL
[document.elementFromPoint and shadowRoot.elementFromPoint must return the shadow host when the hit-tested text node is assigned to a slot and the host has display: inline]
expected: FAIL
[document.elementFromPoint and shadowRoot.elementFromPoint must return the shadow host when the hit-tested text node is assigned to a slot and the host has display: block]
expected: FAIL
[document.elementFromPoint and shadowRoot.elementFromPoint must return the shadow host when the hit-tested text node is assigned to a slot and the host has display: inline-block]
expected: FAIL
[document.elementFromPoint and shadowRoot.elementFromPoint must return the element assigned to a slot when hit-tested text node under an element is assigned to a slot in the shadow tree and the shadow host of the slot has display: inline]
expected: FAIL
[document.elementFromPoint and shadowRoot.elementFromPoint must return the element assigned to a slot when hit-tested text node under an element is assigned to a slot in the shadow tree and the shadow host of the slot has display: block]
expected: FAIL