Bug 218630

Summary: [css-grid] IndefiniteSizeStrategy::findUsedFlexFraction can iterate the same item multiple times
Product: WebKit Reporter: Oriol Brufau <obrufau>
Component: CSSAssignee: Oriol Brufau <obrufau>
Status: RESOLVED FIXED    
Severity: Normal CC: changseok, esprehn+autocc, ews-watchlist, glenn, jfernandez, kondapallykalyan, pdr, rego, svillar, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.chromium.org/p/chromium/issues/detail?id=1026275
Attachments:
Description Flags
Patch none

Oriol Brufau
Reported 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
Attachments
Patch (3.29 KB, patch)
2020-11-05 11:36 PST, Oriol Brufau
no flags
Oriol Brufau
Comment 1 2020-11-05 11:36:41 PST
Javier Fernandez
Comment 2 2020-11-06 03:39:05 PST
Comment on attachment 413335 [details] Patch r=me
EWS
Comment 3 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].
Radar WebKit Bug Importer
Comment 4 2020-11-06 06:10:23 PST
Note You need to log in before you can comment on or make changes to this bug.