commit | 64bcb13df246ce5034a940715b39c53c0fd33794 | [log] [tgz] |
---|---|---|
author | Xianzhu Wang <wangxianzhu@chromium.org> | Tue May 26 18:32:21 2020 |
committer | Commit Bot <commit-bot@chromium.org> | Tue May 26 18:32:21 2020 |
tree | 11c65b1d1363c308ef3bade92773b6ea35fc32a5 | |
parent | 6214d5b98821162bacbd2d5c5cb803157d34f2c3 [diff] |
Fix layer/phase violation of custom scrollbar painting TL;DR, with this CL: - We no longer update custom scrollbar part position during paint; - We avoid unnecessary ScheduleAnimation when painting custom scrollbars; - CustomScrollbar::*Rect() methods no longer have side effects; - Some FIXMEs are fixed. Details: Previously LayoutCustomScrollbarPart::FrameRect() stored different values at different document lifecycle stages: - Before paint, its location was always zero, and the size was not the actual size for some parts, but the minimum size calculated from the style, not based on layout, though updated in UpdateLayout(). UpdateLayout() was called not during layout (as a scrollbar part is not in the layout tree), but anytime we wanted the minimum size from const methods of CustomScrollbar. - During paint, as the FrameRect() calculated during UpdateLayout was not the real frame rect, we updated the frame rect to make sure they would be painted correctly. This caused unnecessary SetShouldCheckForPaintInvalidation when the FrameRect changed and unnecessary ScheduleAnimation(). This CL contains the following changes: - Removes LayoutCustomScrollbarPart::UpdateLayout(). Adds ComputeThickness() and ComputeLength(), and lets Margin*() get style directly, to replace the original UpdateLayout() (which called SetSize()/SetMargin*()) + Size()/Margin*() in the const methods of CustomScrollbar. This removes the dependency of the const methods on the temporary incorrect FrameRect(). - Adds CustomScrollbar::PositionScrollbarParts() to set the correct FrameRect() for scrollbar parts. It's called from several places that position of scrollbar parts can change. This replaces the Set* called from CustomScrollbarTheme::Paint*. Bug: 856802 Change-Id: I5b120294a31a7f91831441cb361adfd27aefa44e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2167602 Reviewed-by: Philip Rogers <pdr@chromium.org> Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org> Cr-Commit-Position: refs/heads/master@{#771890}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.