Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Issue 2462643002: Be more restrictive about forcing relayout of children for pagination. (Closed)

Created:
4 years, 1 month ago by mstensho (USE GERRIT)
Modified:
4 years, 1 month ago
Reviewers:
eae
CC:
chromium-reviews, szager+layoutwatch_chromium.org, zoltan1, blink-reviews-layout_chromium.org, pdr+renderingwatchlist_chromium.org, eae+blinkwatch, leviw+renderwatch, jchaffraix+rendering, blink-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Be more restrictive about forcing relayout of children for pagination. Avoid full subtree re-layouts that could especially occur in tables. This could slow down printing and multicol by a lot. This change makes PerformanceTests/Layout/multicol/deeply-nested-tables.html about 1300 times faster (from 5.1 runs/s to 6813 runs/s when tested locally). The test in bug 487026 will now show print preview instantly, rather than taking a couple of minutes to finish. Store the amount of space used (including the trailing strut) before the first break (if any) instead of the offset from the top of the first fragmentainer. We'll use this information in markChildForPaginationRelayoutIfNeeded() to determine if we really need to force re-layout of some child. We really only need to force re-layout of a child if there's a chance that it needs to recalculate its pagination struts. It won't need to recalculate anything if we know that there were no fragmentainer breaks AND that there won't be any if we re-lay out. Even if there ARE fragmentainer breaks in there, we can still skip layout if we know that the breaks will remain at the exact same locations relative to the child. Store this information after layout by calling updateFragmentationInfoForChild(). We need to include the overflow portion after the bottom border edge of the child, since overflow also gets fragmented. The old implementation of markChildForPaginationRelayoutIfNeeded() re-laid out everything as long as LayoutState's pageLogicalHeightChanged() was true. However, this flag is only set when entering layout of some fragmentation context. Some objects, such as tables, requires multi-pass layout. If the flag was true the first time the object was laid out, it's going to be true in all subsequent re-layouts as well, potentially resulting in numerous deep layouts. BUG=487026 Committed: https://crrev.com/6f896bf597e1709b0c6dfc589c0cd7493a5acc4a Cr-Commit-Position: refs/heads/master@{#428626}

Patch Set 1 #

Patch Set 2 : No need for the float changes for now. Caused regressions anyway. #

Patch Set 3 : No need to call updateFragmentationInfoForChild() when not paginated. #

Messages

Total messages: 19 (14 generated)
mstensho (USE GERRIT)
4 years, 1 month ago (2016-10-28 21:07:49 UTC) #10
eae
Wow, this is amazing! LGTM
4 years, 1 month ago (2016-10-30 12:35:24 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2462643002/40001
4 years, 1 month ago (2016-10-30 12:35:35 UTC) #15
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 1 month ago (2016-10-30 14:04:29 UTC) #17
commit-bot: I haz the power
4 years, 1 month ago (2016-10-30 14:06:41 UTC) #19
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/6f896bf597e1709b0c6dfc589c0cd7493a5acc4a
Cr-Commit-Position: refs/heads/master@{#428626}

Powered by Google App Engine
This is Rietveld 408576698