New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 877098 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 814141
Owner:
Last visit > 30 days ago
Closed: Aug 28
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Composited position sticky does not account for margin.

Project Member Reported by ojan@chromium.org, Aug 23

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
 
Labels: Needs-Feedback
NextAction: 2018-09-03
Status: Unconfirmed (was: Untriaged)
What version is this, and what platform? It works fine for me on Linux M-69.
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.
Labels: Needs-Milestone
Summary: Composited position sticky does not account for margin. (was: hit-testing broken with position:sticky)
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.
Labels: -Needs-Feedback
NextAction: ----
Status: Available (was: Unconfirmed)
That testcase had an error in it. New one attached.
test.html
367 bytes View Download
Labels: -Pri-3 Pri-2
Owner: trchen@chromium.org
Status: Assigned (was: Available)
-> trchen to look into as part of implementing sticky for BGPT.
Mergedinto: 814141
Status: Duplicate (was: Assigned)

Sign in to add a comment