Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[CSS Grid Layout] Flex tracks sizing alg must handle 0fr values
https://bugs.webkit.org/show_bug.cgi?id=148944 Reviewed by Darin Adler. Source/WebCore: We don't allow 0 as flexible size value, which is not following current specs; it just states that it must be a positive value. This patch adds such change in the parser but some additional logic must be added as well to handle 0 values during the flex tracks sizing algorithm. The old algorithm didn't take 0 values into account, so there is the risk of division by zero. Additionally, it was not handling fraction values in the best way. The last versions of the spec changed this algorithm in order to handle fraction values so that they don't cause exponential grow of tracks using values bigger than 1. This patch implements also such new algorithm, so we can deal not only with 0 values, but managing fraction values properly. No new tests, just some additional test cases and some of them rebaselined. * rendering/RenderGrid.cpp: (WebCore::normalizedFlexFraction): (WebCore::RenderGrid::computeUsedBreadthOfGridTracks): (WebCore::RenderGrid::computeFlexFactorUnitSize): Added. (WebCore::RenderGrid::findFlexFactorUnitSize): Added. (WebCore::RenderGrid::GridTrackForNormalization): Deleted. (WebCore::RenderGrid::computeNormalizedFractionBreadth): Deleted. * rendering/RenderGrid.h: LayoutTests: Allow 0 as flex factor value and implement the new flex track sizing algorithm. * fast/css-grid-layout/flex-and-minmax-content-resolution-rows.html: Updated some cases. * fast/css-grid-layout/flex-content-resolution-columns-expected.txt: * fast/css-grid-layout/flex-content-resolution-columns.html: Added some new cases. * fast/css-grid-layout/flex-content-resolution-rows-expected.txt: * fast/css-grid-layout/flex-content-resolution-rows.html: Added some new cases. Canonical link: https://commits.webkit.org/167725@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190308 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
8cc92ed
commit 2b5e272d59fe2921f9f566311522b875b312ef23
Showing
9 changed files
with
271 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -13,3 +13,8 @@ PASS | ||
PASS | ||
PASS | ||
PASS | ||
PASS | ||
PASS | ||
PASS | ||
PASS | ||
PASS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -22,3 +22,10 @@ PASS | ||
PASS | ||
PASS | ||
PASS | ||
PASS | ||
PASS | ||
PASS | ||
PASS | ||
PASS | ||
PASS | ||
PASS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.