Bug 212220 - [css-grid] Grid items shouldn't be created for white spaces.
Summary: [css-grid] Grid items shouldn't be created for white spaces.
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Oriol Brufau
Keywords: InRadar
Depends on:
Reported: 2020-05-21 10:09 PDT by Carlos Alberto Lopez Perez
Modified: 2020-05-21 16:00 PDT (History)
11 users (show)

See Also:

Patch (6.35 KB, patch)
2020-05-21 10:43 PDT, Oriol Brufau
no flags Details | Formatted Diff | Diff
Patch (7.73 KB, patch)
2020-05-21 13:50 PDT, 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 Carlos Alberto Lopez Perez 2020-05-21 10:09:09 PDT
The spec <https://drafts.csswg.org/css-grid/#grid-items> states that child text runs containing only white space should not rendered (just as if its text nodes were display:none)

There is WPT testing this https://wpt.live/css/css-grid/grid-items/whitespace-in-grid-item-001.html (or layout-test imported/w3c/web-platform-tests/css/css-grid/grid-items/whitespace-in-grid-item-001.html )

This test passes both on Chrome and Firefox.

For the related chrome issue see: https://codereview.chromium.org/16888008
Comment 1 Oriol Brufau 2020-05-21 10:43:57 PDT
Created attachment 399967 [details]
Comment 2 Manuel Rego Casasnovas 2020-05-21 12:28:10 PDT
Comment on attachment 399967 [details]

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

r=me, but please wait for green EWSs before landing.

> Source/WebCore/rendering/updating/RenderTreeUpdater.cpp:432
>      if (parentRenderer.isFlexibleBox() && !parentRenderer.isRenderButton())

Mmm, ok I see the condition for flexbox in this line, usually we have both conditions together.
Not a big deal but maybe we can just join both ifs.
Comment 3 Oriol Brufau 2020-05-21 13:50:23 PDT
Created attachment 399978 [details]
Comment 4 Oriol Brufau 2020-05-21 13:56:36 PDT
I have joined both conditionals and updated the expectation of simple-line-layout-with-zero-sized-font.html

I worried that this patch could defeat the purpose of that crashtest, but I have tried reverting the patch from bug 164076 and the test doesn't crash anyways.
Comment 5 Manuel Rego Casasnovas 2020-05-21 15:12:09 PDT
Comment on attachment 399978 [details]

r=me, thanks.
Comment 6 Oriol Brufau 2020-05-21 15:40:14 PDT
Comment on attachment 399978 [details]

EWS is green now
Comment 7 EWS 2020-05-21 15:59:05 PDT
Committed r262033: <https://trac.webkit.org/changeset/262033>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 399978 [details].
Comment 8 Radar WebKit Bug Importer 2020-05-21 16:00:20 PDT