fune/testing/web-platform/tests/css/css-overflow/scrollbar-gutter-fixedpos-001-ref.html
Ting-Yu Lin e0118cf297 Bug 728807 - Adjust containing block origin for fixed positioned elements. r=layout-reviewers,emilio,dholbert
The containing block rect which the fixed position elements are relative to
should exclude the scrollbar or scrollbar-gutter area. Current, we always use
the origin at (0,0), which makes fixed position elements draw behind the gutter
area on the left edge of the viewport.

This patch adjusts the fixed pos containing block's origin when there is a
scrollbar or scrollbar-gutter on the left edge of the viewport. In other words,
the containing block's origin becomes the same as `nsCanvasFrame`'s origin.

The "-001" test uses `scrollbar-gutter: stable`, and we already pass it without
this patch. The "-002" variant tests `scrollbar-gutter: stable both-edges`,
which requires this patch to pass.

Differential Revision: https://phabricator.services.mozilla.com/D199687
2024-01-26 17:08:04 +00:00

21 lines
518 B
HTML

<!DOCTYPE html>
<title>CSS Overflow Reference: Root element's scrollbar-gutter is accounted for in fixed-pos positioning</title>
<link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com">
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
<style>
:root {
scrollbar-gutter: stable;
}
body {
margin: 0;
}
.fixed {
width: 100px;
height: 100px;
background: green;
position: absolute;
}
</style>
<div class="fixed" style="left: 0"></div>
<div class="fixed" style="right: 0"></div>