commit | cd778184be715a31314427f55b1fe43096641bf0 | [log] [tgz] |
---|---|---|
author | Xianzhu Wang <wangxianzhu@chromium.org> | Thu Jun 04 21:48:41 2020 |
committer | Commit Bot <commit-bot@chromium.org> | Thu Jun 04 21:48:41 2020 |
tree | 4cbe6ef7c060c9fcb5098fb81c128f055a47022d | |
parent | 5b2b4b0c92a90ab92536897bfa5f0e06350d2865 [diff] |
Reland "Fix layer/phase violation of custom scrollbar painting" This reverts commit 94c64b41dd5211b67014b2862037ae411ad35cda. After the revert, we no longer have crbug.com/1086968 crashes. The root cause of the crash is still unclear, but crrev.com/c/2226924 changed the class hierarchy of LayoutCustomScrollbarPart which may affect the issue. Reland the CL tentatively to see if the crash still occurs. Original change's description: > Revert "Fix layer/phase violation of custom scrollbar painting" > > This reverts commit 64bcb13df246ce5034a940715b39c53c0fd33794. > > Reason for revert: Tentative for crbug.com/1086968. > > Original change's description: > > 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} > > TBR=wangxianzhu@chromium.org,pdr@chromium.org > > # Not skipping CQ checks because original CL landed > 1 day ago. > > Bug: 856802, 1086968 > Change-Id: If1703dcda1d4cb6a53a132557b34867090f397ae > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2225222 > Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org> > Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org> > Cr-Commit-Position: refs/heads/master@{#773772} TBR=wangxianzhu@chromium.org,pdr@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 856802, 1086968 Change-Id: I7108a82ed453c32a87ca1aad689cf8a1c157f8fc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2231458 Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org> Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org> Cr-Commit-Position: refs/heads/master@{#775292}
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.