Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css2?] Hit testing / z-ordering of the root element vs the body. #11744

Open
emilio opened this issue Feb 19, 2025 · 0 comments
Open

[css2?] Hit testing / z-ordering of the root element vs the body. #11744

emilio opened this issue Feb 19, 2025 · 0 comments
Labels

Comments

@emilio
Copy link
Collaborator

emilio commented Feb 19, 2025

Consider this reduced test-case for Mozilla bug 1948937:

<!DOCTYPE html>
<style>
  html, body {
    position: relative;
  }

  body {
    z-index: -2;
  }
</style>
<input type="text">

In Firefox, you can't hit the <input type=text>, because it's ordered under the <html> box. In Blink and WebKit you can.

If you make the same test-case with two other elements, then Blink and WebKit agree with Gecko, as expected.

So I think the behavior in WebKit/Blink probably is a consequence of the background propagation to the viewport, but I still think this probably shouldn't work? I guess whether it works depends on whether you consider the box hit-testable, or the background area... If so, I should probably file WebKit and Blink issues, but since the spec for hit testing doesn't exist, I kinda want to confirm my intuition is correct.

This is probably changeable on Gecko's end if needed, but Gecko's behavior seems more consistent to me...

cc @bfgeek @dbaron @smfr @tabatkins

@emilio emilio added the CSS2 label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant