New issue
Advanced search Search tips

Issue 823751 link

Starred by 2 users

Issue metadata

Status: Fixed
Merged: issue 814439
Owner:
Closed: Aug 9
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Scroll slows on large table in div

Project Member Reported by chaopeng@chromium.org, Mar 20 2018

Issue description

Chrome Version: 65.0.3325.162 (Official Build) (64-bit)
OS: Win/Linux

What steps will reproduce the problem?
(1) open https://www.tsofts.cn/test/region-div.html. wait until the load finish
(2) scroll in list

I can feel the scroll lagging. We can compare with https://www.tsofts.cn/test/region-body.html which moves the <table> to body.

I also compared with Edge, Edge does not update the hover state properly but it scroll smoothly.

I checked the tracing result: It seems related to LocalFrameView::PrePaint.

This issue is from https://www.zhihu.com/question/268016229
 
Cc: chaopeng@chromium.org
Components: Blink>Scroll
Owner: bokan@chromium.org
Status: Assigned (was: Untriaged)
Hi David, could you please take a look?
trace_scroll-in-div.json.gz
2.3 MB Download
trace_scroll-in-body.json.gz
3.3 MB Download
Description: Show this description

Comment 3 by bokan@chromium.org, Mar 21 2018

Mergedinto: 814439
Status: Duplicate (was: Assigned)
Thanks - took a look. This is because the DIV isn't promoted to a composited layer but body scrolling is always composited (because we know nothing can appear behind it). This would work equivalently well if the screen was high-DPI or with --enable-prefer-compositing-to-lcd-text.

You can also get the DIV to composite by adding some style so Chrome knows its safe to do so:

background-color: white; // Non-transparent background
contain: paint;  // Descendants can't display outside our bounds

This guarantees Chrome won't have to blend text with anything behind the scroller so it's safe to scroll on the compositor.

As for long paint times, I believe this is a known issue - I'll dup into that.
Owner: chrishtr@chromium.org
Status: Assigned (was: Duplicate)
Un-duping this bug. In non-composited mode, the reason for the slowness
is the required forced subtree paint and property tree invalidation for
scroll offset update.

Project Member

Comment 5 by bugdroid1@chromium.org, Aug 9

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe

commit 7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe
Author: Chris Harrelson <chrishtr@chromium.org>
Date: Thu Aug 09 02:19:41 2018

Don't force paint invalidation on non-composited scroll.

This is no longer necessary because, in SPv175:
a) Object visual rects are stored relative to their transform ancestor,
which is not affected by change of that scroll transform.
b) Raster invalidations happen on paint chunks, which takes care of
descendants which don't scroll.

We do, however need to set NeedsRepaint on the scrolling PaintLayer,
because its descendants could have been affected by a changed cull rect.

Bug:  823751 

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I9865e336233a92e1aac9c25ea221cec039f6abb1
Reviewed-on: https://chromium-review.googlesource.com/1159382
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581763}
[modify] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/compositing/overflow/do-not-repaint-if-scrolling-composited-layers-expected.txt
[modify] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/compositing/overflow/do-not-repaint-if-scrolling-composited-layers.html
[modify] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/paint/invalidation/reflection/scroll-absolute-layer-with-reflection-expected.txt
[modify] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/paint/invalidation/reflection/scroll-fixed-layer-with-reflection-expected.txt
[rename] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/paint/invalidation/scroll/document-flipped-blocks-writing-mode-scroll-expected.png
[rename] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/paint/invalidation/scroll/fixed-img-src-change-after-scroll-expected.png
[modify] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/paint/invalidation/scroll/iframe-scroll-repaint-expected.txt
[modify] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/paint/invalidation/scroll/overflow-auto-in-overflow-auto-scrolled-expected.txt
[modify] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/paint/invalidation/scroll/overflow-hidden-in-overflow-hidden-scrolled-expected.txt
[modify] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/paint/invalidation/scroll/overflow-hidden-yet-scrolled-expected.txt
[modify] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/paint/invalidation/scroll/overflow-hidden-yet-scrolled-with-custom-scrollbar-expected.txt
[modify] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/paint/invalidation/scroll/overflow-scroll-composited-non-stacking-child-expected.txt
[modify] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/paint/invalidation/scroll/overflow-scroll-in-overflow-scroll-scrolled-expected.txt
[rename] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/paint/invalidation/scroll/overflow-scroll-local-background-text-color-change-expected.txt
[rename] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/paint/invalidation/scroll/scroll-descendant-with-cached-cliprects-expected.png
[rename] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/paint/invalidation/scroll/scroll-descendant-with-cached-cliprects-expected.txt
[modify] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/paint/invalidation/scroll/scroll-fixed-layer-with-transformed-parent-layer-expected.txt
[modify] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/paint/invalidation/scroll/scroll-in-clipped-layer-expected.txt
[modify] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/paint/invalidation/scroll/scroll-in-fixed-layer-expected.txt
[modify] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/paint/invalidation/scroll/scroll-in-transformed-layer-expected.txt
[rename] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/paint/invalidation/scroll/scroll-stacking-context-backface-visiblity-leaves-traces-expected.png
[rename] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/paint/invalidation/scroll/scroll-stacking-context-backface-visiblity-leaves-traces-expected.txt
[modify] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/paint/invalidation/scroll/scroll-with-transformed-parent-layer-expected.txt
[modify] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/paint/invalidation/table/scroll-inside-table-cell-expected.txt
[modify] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/paint/invalidation/table/scroll-relative-table-inside-table-cell-expected.txt
[modify] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/paint/invalidation/table/table-overflow-auto-in-overflow-auto-scrolled-expected.txt
[modify] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/WebKit/LayoutTests/paint/invalidation/table/table-overflow-scroll-in-overflow-scroll-scrolled-expected.txt
[modify] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/blink/renderer/core/frame/local_frame.cc
[modify] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/blink/renderer/core/paint/compositing/paint_layer_compositor.cc
[modify] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/blink/renderer/core/paint/paint_layer.cc
[modify] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/blink/renderer/core/paint/paint_layer.h
[modify] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc
[modify] https://crrev.com/7a4adf03f8af3f368e46c8df21bb7f8182d9e1fe/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h

Status: Fixed (was: Assigned)
It's much faster now.

Sign in to add a comment