WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
191308
CSS grid elements with justify-content: space-around have extra whitespace, sometimes a lot
https://bugs.webkit.org/show_bug.cgi?id=191308
Summary
CSS grid elements with justify-content: space-around have extra whitespace, s...
Javier Fernandez
Reported
2018-11-06 08:49:19 PST
Steps to reproduce the problem: 1. Create a grid element where the total width of the columns is less than the width of the element itself. 2. Add justify-content: space-around to the grid element. 3. Add a child element with a large amount of text, and assign a very narrow overall width on the grid element, as if it were a mobile layout. This makes the bug more pronounced and easier to see. What is the expected behavior? The child element should only be as tall as the text inside it, as seen in Firefox. What went wrong? A gap appears at the bottom the child element, after the text.
Attachments
Patch
(37.68 KB, patch)
2018-11-06 09:11 PST
,
Javier Fernandez
no flags
Details
Formatted Diff
Diff
Patch
(37.53 KB, patch)
2018-11-06 12:46 PST
,
Javier Fernandez
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Javier Fernandez
Comment 1
2018-11-06 09:11:37 PST
Created
attachment 353971
[details]
Patch
Dean Jackson
Comment 2
2018-11-06 11:17:25 PST
Comment on
attachment 353971
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=353971&action=review
> Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp:565 > + // FIXME (jfernandez) Content Alignment should account for this heuristic
Nit. Punctuation.
> Source/WebCore/rendering/RenderGrid.cpp:1605 > + auto& offset = > + isRowAxis ? m_offsetBetweenColumns : m_offsetBetweenRows;
Nit: Should be one line.
> Source/WebCore/rendering/RenderGrid.cpp:1624 > + positionOffset = LayoutUnit();
I don't think this line is necessary.
> Source/WebCore/rendering/RenderGrid.cpp:1645 > + positionOffset = LayoutUnit();
Nor this one.
> Source/WebCore/rendering/RenderGrid.h:42 > + bool isValid() { return positionOffset >= 0 && distributionOffset >= 0; }
const
Javier Fernandez
Comment 3
2018-11-06 12:46:06 PST
Created
attachment 353989
[details]
Patch
WebKit Commit Bot
Comment 4
2018-11-06 13:45:50 PST
Comment on
attachment 353989
[details]
Patch Clearing flags on attachment: 353989 Committed
r237884
: <
https://trac.webkit.org/changeset/237884
>
WebKit Commit Bot
Comment 5
2018-11-06 13:45:51 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 6
2018-11-06 13:46:24 PST
<
rdar://problem/45854716
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug