Bug 218630 - [css-grid] IndefiniteSizeStrategy::findUsedFlexFraction can iterate the same item multiple times
Summary: [css-grid] IndefiniteSizeStrategy::findUsedFlexFraction can iterate the same ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Oriol Brufau
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-11-05 11:25 PST by Oriol Brufau
Modified: 2020-11-06 06:10 PST (History)
10 users (show)

See Also:


Attachments
Patch (3.29 KB, patch)
2020-11-05 11:36 PST, Oriol Brufau
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oriol Brufau 2020-11-05 11:25:45 PST
IndefiniteSizeStrategy::findUsedFlexFraction needs to iterate all grid items that cross a flexible track. To do so it, takes the indices of the flex tracks, and for each one it uses GridIterator to iterate the items in that track.

Then, to avoid processing the same item multiple times, it checks that the item started in the current flex track, not in a previous one.

However, this is insufficient: it's not taking into account that an item can be in a single flex track, but span multiple tracks in the other axis.

This can make it very slow. Testcase: https://jsbin.com/hefajukaxo/1/edit?html,css,js,output

Chromium has been fixed in https://crbug.com/1026275
Comment 1 Oriol Brufau 2020-11-05 11:36:41 PST
Created attachment 413335 [details]
Patch
Comment 2 Javier Fernandez 2020-11-06 03:39:05 PST
Comment on attachment 413335 [details]
Patch

r=me
Comment 3 EWS 2020-11-06 06:09:52 PST
Committed r269509: <https://trac.webkit.org/changeset/269509>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 413335 [details].
Comment 4 Radar WebKit Bug Importer 2020-11-06 06:10:23 PST
<rdar://problem/71117312>