-
Notifications
You must be signed in to change notification settings - Fork 756
Open
Labels
cssom-1Current WorkCurrent Work
Description
Consider the test-case:
<!doctype html>
<div id="log"></div>
<div style="height: 500px; background: purple; overflow: hidden;">
<div style="height: 400px; background: yellow;">
<div id="target" style="height: 100px; position: -webkit-sticky; position: sticky; left: 0; top: 50%; background: blue;">
</div>
</div>
</div>
<script>
log.innerHTML = getComputedStyle(target).top;
</script>Every browser resolves the percentage during layout relative to the overflow: hidden container (that is, the closest scrollable box), so #target is positioned 250px from the top.
However, every browser except Gecko resolves the percentage in getComputedStyle against the containing block (the yellow box), returning 200px instead.
I think I should file bugs against the other browsers and clarify the spec because those percentages make no sense, but I'm not sure if I'm missing something...
jonjohnjohnson and fantasai
Metadata
Metadata
Assignees
Labels
cssom-1Current WorkCurrent Work