Bug 191938

Summary: [css-grid] absolute positioned child is sized wrongly when using auto-fit, generating spurious collapsed tracks
Product: WebKit Reporter: Javier Fernandez <jfernandez>
Component: Layout and RenderingAssignee: Javier Fernandez <jfernandez>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, commit-queue, ews, jfernandez, rego, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.chromium.org/p/chromium/issues/detail?id=785626
Attachments:
Description Flags
Test case to reproduce the issue
none
Patch
none
Archive of layout-test-results from ews122 for ios-simulator-wk2
none
Patch none

Description Javier Fernandez 2018-11-24 01:40:58 PST
Created attachment 355558 [details]
Test case to reproduce the issue

What steps will reproduce the problem?
(1) load the attached testcase
(2)
(3)

What is the expected result?
In the top two grids, all <span>s should be 30px wide (the width of one column).
In the last grid, all <span>s should be 65px wide (the width of two columns with a 5px grid gap in-between).

What happens instead?
All abs.pos. boxes (pink color) are 5px too short.
This how Firefox renders this case, which seems correct per the CSS Grid spec.
Comment 1 Javier Fernandez 2018-11-24 01:52:10 PST
Created attachment 355560 [details]
Patch
Comment 2 Build Bot 2018-11-24 04:37:05 PST
Comment on attachment 355560 [details]
Patch

Attachment 355560 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: https://webkit-queues.webkit.org/results/10127719

New failing tests:
imported/w3c/web-platform-tests/webrtc/simplecall-no-ssrcs.https.html
media/no-fullscreen-when-hidden.html
Comment 3 Build Bot 2018-11-24 04:37:06 PST
Created attachment 355562 [details]
Archive of layout-test-results from ews122 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews122  Port: ios-simulator-wk2  Platform: Mac OS X 10.13.6
Comment 4 Manuel Rego Casasnovas 2018-11-26 01:55:00 PST
Comment on attachment 355560 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=355560&action=review

Thanks for fixing this. If this was fixed before in Blink could you link the bug from "See also" field?

> Source/WebCore/ChangeLog:3
> +        [css-grid] grid abs.pos. child is sized wrongly when using auto-fit and it generates some collapsed tracks

Nit: This title might be reworded :-)

> Source/WebCore/rendering/RenderGrid.cpp:395
> +            // We shouldn't count the gap if the the span starts and ends in a collapsed but there isn't non-empty tracks afterwards (it's at the end of the grid).

Nit: s/collapsed/collapsed track/
Comment 5 Javier Fernandez 2018-11-26 02:20:11 PST
Created attachment 355628 [details]
Patch
Comment 6 WebKit Commit Bot 2018-11-26 04:09:13 PST
Comment on attachment 355628 [details]
Patch

Clearing flags on attachment: 355628

Committed r238491: <https://trac.webkit.org/changeset/238491>
Comment 7 WebKit Commit Bot 2018-11-26 04:09:15 PST
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2018-11-26 04:10:44 PST
<rdar://problem/46241477>