Commit bc3e6fa5 authored by Chris Harrelson's avatar Chris Harrelson Committed by Commit Bot

[RLS] Always update compositing layer offset and related dirty bits when scroll offset changes.

Previously, it did not update update them during layout, which could result in failure to update
composited scroll offset after situations like scroll clamping during synchronous
forced layouts.

Bug: 820839
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I129e7db4c5f4bc7b862b38de84ff174e7950fd5c
Reviewed-on: https://chromium-review.googlesource.com/963517
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: default avatarSteve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543287}
parent 54d2cbe0
<!doctype HTML>
<div style="width: 300px; height: 300px; background: green; margin-top: 1500px"></div>
<div id=spacer style="position: relative; width: 10px; height: 300px"></div>
<script>
onload = function() {
window.scrollTo(0, 3000);
}
</script>
<!doctype HTML>
<div style="width: 300px; height: 300px; background: green; margin-top: 1500px"></div>
<div id=spacer style="position: relative; width: 10px; height: 300px"></div>
<script>
if (window.testRunner)
window.testRunner.waitUntilDone();
onload = function() {
window.scrollTo(0, 3000);
requestAnimationFrame(() =>
requestAnimationFrame(() =>
requestAnimationFrame(() =>
go())));
}
function go() {
spacer.style.height = '1000px';
spacer.offsetWidth;
window.scrollTo(0, 3000);
spacer.offsetWidth;
spacer.style.height = '300px';
spacer.offsetWidth;
if (window.testRunner)
window.testRunner.notifyDone();
}
</script>
......@@ -452,8 +452,7 @@ void PaintLayerScrollableArea::UpdateScrollOffset(
DisableCompositingQueryAsserts disabler;
// Update the positions of our child layers (if needed as only fixed layers
// should be impacted by a scroll). We don't update compositing layers,
// because we need to do a deep update from the compositing ancestor.
// should be impacted by a scroll).
if (!frame_view->IsInPerformLayout()) {
// If we're in the middle of layout, we'll just update layers once layout
// has finished.
......@@ -468,8 +467,8 @@ void PaintLayerScrollableArea::UpdateScrollOffset(
frame_view->SetRootLayerDidScroll();
else
frame_view->SetNeedsUpdateGeometries();
UpdateCompositingLayersAfterScroll();
}
UpdateCompositingLayersAfterScroll();
GetLayoutBox()->DispatchFakeMouseMoveEventSoon(frame->GetEventHandler());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment