webdriver: Consider shadow including descendant when computing "obscured" step of “element click” (#38841)

Testing: WebDriver Conformance test. In addition to fixing all "Element
Intercepted" errors in
https://github.com/yezhizhen/servo/actions/runs/17142506541, we are able
to fix many other tests.
Fixes: #38837

---------

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
This commit is contained in:
Euclid Ye 2025-08-22 15:22:00 +08:00 committed by GitHub
parent cae8d22823
commit 66adf2bf9f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 10 additions and 28 deletions

View file

@ -1904,7 +1904,7 @@ pub(crate) fn handle_element_click(
// `paint_tree` is guaranteed not empty as element is "in view".
if !container
.upcast::<Node>()
.Contains(Some(paint_tree[0].upcast::<Node>()))
.is_shadow_including_inclusive_ancestor_of(paint_tree[0].upcast::<Node>())
{
return Err(ErrorStatus::ElementClickIntercepted);
}