Files
sousa-gecko/testing/web-platform/tests/css/css-backgrounds/local-attachment-flex-column-reverse-scroll-ref.html
T
Eain Chen b5e49e3748 Bug 2016886 [wpt PR 57797] - Fix background painting when scrolling in reversed-flow containers, a=testonly
Automatic update from web-platform-tests
Fix background painting when scrolling in reversed-flow containers

When multiple backgrounds were set to scroll along with the content
(background-attachment: local), they would not move correctly inside
containers where the content flow was reversed, such as with
flex-direction: row-reverse, column-reverse, or in rtl mode.

The painting logic in AdjustRectForScrolledContent did not correctly
handle the inverted scroll offsets that these reversed-flow layouts
produce. This change corrects the calculation by using the original
offset value for scrolling. This will ensure the background scrolls in
sync with the content without affecting standard layouts.

The background scrolling of following cases are as expected now:

1. Container with `direction:rtl`, fixed.
2. Container with `flex-direction:row-reverse`; fixed.
3. When `flex-direction:row-reverse` is applied to an inner content
element, leaving the scroller's origin unchanged; not broken.
4. When both `rtl` and `row-reverse` are used for the container
(contentand scrollbar remains as normal); not broken.
5. Container with `flex-direction:column-reverse`; fixed.

Bug: 416697801
Change-Id: I21690ee7e78f0de6bba7a1cba4a586d1a9ea21d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7535331
Reviewed-by: Claire Chambers <clchambers@microsoft.com>
Commit-Queue: Eain Chen <eainchen@microsoft.com>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1585027}

--

wpt-commits: ac9f6f064919d8ae40cf44e13d9cef120821a9d6
wpt-pr: 57797
2026-02-18 09:33:33 +00:00

29 lines
578 B
HTML

<!doctype html>
<title>CSS Backgrounds: local attachment with flex-direction: column-reverse scroll - Reference</title>
<style>
.init_scrolled {
width: 100px;
height: 100px;
overflow: hidden;
background-color: blue;
}
.mid_scrolled {
width: 100px;
height: 100px;
overflow: hidden;
background-image: linear-gradient(to bottom, yellow 50%, blue 50%);
}
.max_scrolled {
width: 100px;
height: 100px;
overflow: hidden;
background-color: yellow;
}
</style>
<div class="init_scrolled">
</div>
<div class="mid_scrolled">
</div>
<div class="max_scrolled">
</div>