Skip to content

Conversation

@jdm
Copy link
Member

@jdm jdm commented Dec 1, 2025

This implementation is not actually specified (see #40973 and w3c/csswg-drafts#556), but the implementation that we have is backwards. Other retargeting uses that describe "retarget something against another thing" map to something.retarget(another_thing), but what the current code was doing for element[s]FromPoint was the equivalent of "retarget this against each element", which is obviously wrong.

Testing: Newly-passing tests.

…int.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
@jdm jdm requested a review from gterzian as a code owner December 1, 2025 04:52
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Dec 1, 2025
[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-block]
expected: FAIL

[document.elementFromPoint must return the shadow host of the hit-tested element under a shadow root and shadowRoot.elementFromPoint must return the element parent of the hit-tested text node under the point when the shadow host has display: inline]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The remaining failures in this file are caused by #40973.

Copy link
Member

@yezhizhen yezhizhen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this fix #40963?

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Dec 1, 2025
@jdm
Copy link
Member Author

jdm commented Dec 1, 2025

No, that requires a fix for #40973, which does not involve calling the method on a ShadowRoot.

@jdm jdm added this pull request to the merge queue Dec 1, 2025
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Dec 1, 2025
Merged via the queue into servo:main with commit 91a73c4 Dec 1, 2025
32 checks passed
@jdm jdm deleted the shadowroot-retarget branch December 1, 2025 05:53
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants