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

emilio has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css2?] Hit testing / z-ordering of the root element vs the body. ==
Consider this reduced test-case for [Mozilla bug 1948937](https://bugzil.la/1948937):

```html
<!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 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11744 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 19 February 2025 11:22:18 UTC