| commit | 12cc431ee4a3180312e4fb13f5b54bb2b71be71d | [log] [tgz] |
|---|---|---|
| author | Ian Kilpatrick <ikilpatrick@chromium.org> | Mon May 19 16:25:58 2025 |
| committer | Chromium LUCI CQ <chromium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon May 19 16:25:58 2025 |
| tree | fa2a2d26c1f8328efc4e6f27d0a58a1bece75ea2 | |
| parent | 5a44ba89cad7861f1d150c68b37ec781ee0068a4 [diff] |
[flex-balance] Allow clamping of margin-box size to zero. For the score based flex line-breaker to work (fast) we need the scoring function to be monotonic. E.g. if we add an item to a line, the score must decrease. Negative margins break this invariant. There are various strategies to mitigate this. For the moment we just clamp the margin-box size to zero when this occurs. An alternate more complex strategy is to perform a forward-scan, and accumulate these negative-size items into the current items size. We'd still need clamping in this case, as the negative margins could exceed the current items size for example. Lets do the simple thing for the moment, and see what feedback we get. This patch introduces a `greedy_line_count` lambda to line-break off the prefix-sums array, as we'll need this for the min-line-count feature (and the prefix-sums array contains the source of truth of the sizes now). Bug: 416755656 Change-Id: I2bb5b8280c015d73ab8365b32bdb2f7852a830d8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6557623 Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org> Reviewed-by: Morten Stenshorne <mstensho@chromium.org> Cr-Commit-Position: refs/heads/main@{#1462202}
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.
To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.
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.
If you found a bug, please file it at https://crbug.com/new.