Issue metadata
Sign in to add a comment
|
Composited position sticky does not account for margin. |
||||||||||||||||||||||
Issue description
The combination of padding, negative-margin, and sticky makes hit testing be off. In the test case below, hover over the sticky element and nothing happens. Over 50px below the sticky element and the hover highlighting takes place. Similarly, click events don't fire, so it's clearly the hit testing and not something specific to hover.
<style>
.container {
padding: 50px;
}
.sticky {
margin-top: -50px;
position: sticky;
top: 0px;
}
.sticky:hover {
position:sticky;
background-color: red;
}
</style>
<div class="container" style="border: 5px solid pink; height: 300px; overflow: auto;">
<div class="sticky">sticky</div>
<div style="height: 1000px"></div>
</div>
http://plexode.com/eval3/#s=aekVQXANJVQMbAx14Hz1PD0RQT1VCSk9GUwFcmAEBhRsBEhdRWRyYXpgPVFVKRExapKanAYYOfqoOrK6wT70Bfaq1t7nGyMEBEcWxs8y4WhtJUFeiu8fJG9fOmIsOiKpTRkXGsk8dEJaYmB1yAXcePQObnZ+hKb6AJ4fIDQiqCyuAKHAJRUBMDgBQaqCgRaavAJ8VRCKxVKCwAaXd72fD6cZafQfkzwOUhesCgkSVcVi0olctCEsAZeAA
,
Aug 24
Repros for me on Mac Retina / 70.0.3521.2. The hover happens at the wrong offset - something like 30px lower than it should be.
,
Aug 26
,
Aug 27
The bug is not actually in hit testing. It's in positioning of a composited sticky layer. It does not take into account margin properly. Example attached which forces compositing even on low-DPI screens. Firefox matches the non-compositing path of Chrome.
,
Aug 28
,
Aug 28
That testcase had an error in it. New one attached.
,
Aug 28
-> trchen to look into as part of implementing sticky for BGPT.
,
Aug 28
|
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by schenney@chromium.org
, Aug 24NextAction: 2018-09-03
Status: Unconfirmed (was: Untriaged)