| Summary: | [css-grid] Grid layout unstable with percentage margin | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Carlos Alberto Lopez Perez <clopez> | ||||||||||
| Component: | CSS | Assignee: | Oriol Brufau <obrufau> | ||||||||||
| Status: | RESOLVED FIXED | ||||||||||||
| Severity: | Normal | CC: | changseok, esprehn+autocc, ews-watchlist, glenn, jfernandez, kondapallykalyan, kyle.bavender, obrufau, pdr, rego, simon.fraser, svillar, webkit-bug-importer, ysuzuki | ||||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||||
| Version: | WebKit Nightly Build | ||||||||||||
| Hardware: | Unspecified | ||||||||||||
| OS: | Unspecified | ||||||||||||
| See Also: |
https://bugs.chromium.org/p/chromium/issues/detail?id=834643 https://bugs.chromium.org/p/chromium/issues/detail?id=942811 https://bugs.chromium.org/p/chromium/issues/detail?id=808758 https://bugs.webkit.org/show_bug.cgi?id=212983 |
||||||||||||
| Bug Depends on: | 210089, 212991 | ||||||||||||
| Bug Blocks: | |||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Carlos Alberto Lopez Perez
2020-03-23 20:37:18 PDT
This is covered by WPT tests: css/css-grid/grid-items/grid-items-percentage-margins-???.html css/css-grid/grid-items/grid-items-percentage-paddings-???.html css/css-grid/grid-items/grid-item-dynamic-min-contribution-001.html Also consider https://bugs.chromium.org/p/chromium/issues/detail?id=808758 which added WPT tests: css/css-grid/grid-items/grid-items-percentage-margins-vertical-lr-???.html css/css-grid/grid-items/grid-items-percentage-paddings-vertical-lr-???.html Created attachment 399527 [details]
Patch
The patch is a port of these Chromium commits: https://chromium-review.googlesource.com/c/chromium/src/+/1796323 https://chromium-review.googlesource.com/c/chromium/src/+/2033507 But the base code in WebKit was a slightly different so I had to improvise a bit. Comment on attachment 399527 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=399527&action=review This looks good, I have a question inline but otherwise r=me. Please clarify that before landing. > Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp:920 > + GridTrackSizingDirection childBlockDirection = GridLayoutFunctions::flowAwareDirectionForChild(*renderGrid(), child, ForRows); Why you need this here and not before? Created attachment 399665 [details]
Patch
(In reply to Manuel Rego Casasnovas from comment #5) > Comment on attachment 399527 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=399527&action=review > > This looks good, I have a question inline but otherwise r=me. > Please clarify that before landing. > > > Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp:920 > > + GridTrackSizingDirection childBlockDirection = GridLayoutFunctions::flowAwareDirectionForChild(*renderGrid(), child, ForRows); > > Why you need this here and not before? Good catch, the previous call needs to use childInlineDirection instead of ForColumns, I missed it since grid-items-minimum-width-orthogonal-001.html only covers the other axis. Committed r261841: <https://trac.webkit.org/changeset/261841> All reviewed patches have been landed. Closing bug and clearing flags on attachment 399665 [details]. Re-opened since this is blocked by bug 212991 The spotify problem was because of bug 210089. Now that it has been fixed, my patch doesn't break spotify. So it should be fine to reland, I will post a rebased patch. Created attachment 409485 [details]
Patch
Comment on attachment 409485 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=409485&action=review r=me Let's hope this time we don't get new regressions. :-) > Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp:115 > +static bool hasRelativeOrIntrinsicSizeForChild(const RenderBox& child, GridTrackSizingDirection direction) Nit: Missing new line before method name. Created attachment 409503 [details]
Patch
(In reply to Manuel Rego Casasnovas from comment #13) > Nit: Missing new line before method name. Done. Committed r267503: <https://trac.webkit.org/changeset/267503> All reviewed patches have been landed. Closing bug and clearing flags on attachment 409503 [details]. |