Skip to content

Commit

Permalink
[RasterInducingScroll] Force update even without raster invalidation
Browse files Browse the repository at this point in the history
The following changes won't cause raster invalidation:
- A scroller is added/removed without any visible change;
- Some scrolling content out of a non-composited scroller's
  scrollport changes.

Previously we skipped cc layer update because nothing visible
changed. However, future raster-inducing scroll without
 main-thread update could scroll the out-of-date content into
view.

Now force update in RasterInducingScroll in
ContentLayerClientImpl::UpdateCcLayer().

Bug: 364669904
Change-Id: I636d3f92a2a98db50f30160c2e214735311d6769
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6090759
Reviewed-by: Philip Rogers <[email protected]>
Commit-Queue: Xianzhu Wang <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1396313}
  • Loading branch information
wangxianzhu authored and chromium-wpt-export-bot committed Dec 14, 2024
1 parent 6b4687a commit 4a348b2
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
22 changes: 22 additions & 0 deletions css/css-overflow/add-scroller-then-scroll-content-into-view.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html class="reftest-wait">
<link rel="help" href="https://crbug.com/364669904">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
<script src="/common/reftest-wait.js"></script>
<script src="/common/rendering-utils.js"></script>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="scroller" style="position: relative; overflow: scroll; scrollbar-width: none;
width: 200px; height: 200px; display: none">
<div style="height: 2000px"></div>
<div style="position: absolute; top: 1000px;
width: 100px; height: 100px; background: green"></div>
</div>
<script>
waitForAtLeastOneFrame().then(() => {
scroller.style.display = 'block';
waitForAtLeastOneFrame().then(() => {
scroller.scrollTo(0, 1000);
takeScreenshot();
});
});
</script>
22 changes: 22 additions & 0 deletions css/css-overflow/content-change-then-scroll-into-view.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html class="reftest-wait">
<link rel="help" href="https://crbug.com/364669904">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
<script src="/common/reftest-wait.js"></script>
<script src="/common/rendering-utils.js"></script>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="scroller" style="position: relative; overflow: scroll; scrollbar-width: none;
width: 200px; height: 200px">
<div style="height: 2000px"></div>
<div id="content" style="position: absolute; top: 1000px; background: red;
width: 100px; height: 100px"></div>
</div>
<script>
waitForAtLeastOneFrame().then(() => {
content.style.background = 'green';
waitForAtLeastOneFrame().then(() => {
scroller.scrollTo(0, 1000);
takeScreenshot();
});
});
</script>

0 comments on commit 4a348b2

Please sign in to comment.