Steps to reproduce
<!DOCTYPE html>
<html>
<head><style>
body { margin: 0; height: 2000px; }
#sticky { position: sticky; top: 10px; width: 100px; height: 40px; background: green; }
</style></head>
<body>
<div id="sticky"></div>
</body>
</html>
Scroll with window.scrollTo(0, 50), then read document.getElementById('sticky').getBoundingClientRect().top.
Expected (Chrome 154)
The sticky element clamps to its inset: top = 10.
Actual (moli 1.1.10, 9b2f86b)
The element scrolls away with the content: top = -40.
getComputedStyle().position is "sticky" and initial placement is correct — only the re-clamping on scroll offset change is missing (finish_sticky_positioning runs only during layout in taffy_tree.rs). The same defect applies to horizontal flex containers (left inset not clamped).
Suggestion
Re-run inset clamping for sticky boxes when the scroll offset changes.
Environment
- moli 1.1.10 (9b2f86b), Linux
- CDP probe vs Chrome 154.0.8037.57, same fixture and probe
Steps to reproduce
Scroll with
window.scrollTo(0, 50), then readdocument.getElementById('sticky').getBoundingClientRect().top.Expected (Chrome 154)
The sticky element clamps to its inset:
top = 10.Actual (moli 1.1.10, 9b2f86b)
The element scrolls away with the content:
top = -40.getComputedStyle().positionis"sticky"and initial placement is correct — only the re-clamping on scroll offset change is missing (finish_sticky_positioningruns only during layout intaffy_tree.rs). The same defect applies to horizontal flex containers (left inset not clamped).Suggestion
Re-run inset clamping for sticky boxes when the scroll offset changes.
Environment