Changeset 287977 in webkit
- Timestamp:
- Jan 13, 2022 6:41:12 AM (6 months ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
LayoutTests/TestExpectations (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/gtk/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/TestExpectations
r287976 r287977 1415 1415 webkit.org/b/231021 imported/w3c/web-platform-tests/css/css-grid/grid-items/percentage-margin-dynamic.html [ ImageOnlyFailure ] 1416 1416 webkit.org/b/231021 imported/w3c/web-platform-tests/css/css-grid/grid-items/replaced-element-015.html [ ImageOnlyFailure ] 1417 1418 webkit.org/b/234879 imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/flex-tracks-with-fractional-size.html [ ImageOnlyFailure ]1419 1417 1420 1418 imported/w3c/web-platform-tests/css/css-grid/masonry/tentative/masonry-align-content-001.html [ ImageOnlyFailure ] -
trunk/LayoutTests/imported/w3c/ChangeLog
r287927 r287977 1 2022-01-13 Ziran Sun <zsun@igalia.com> 2 3 [css-grid] Fix rounding of distributed free space to flexible tracks 4 https://bugs.webkit.org/show_bug.cgi?id=234917 5 6 Reviewed by Darin Adler. 7 1 8 2022-01-12 Sergio Villar Senin <svillar@igalia.com> 2 9 -
trunk/LayoutTests/platform/gtk/TestExpectations
r287974 r287977 1978 1978 webkit.org/b/228153 imported/w3c/web-platform-tests/css/css-grid/abspos/grid-positioned-item-dynamic-change-002.html [ ImageOnlyFailure ] 1979 1979 webkit.org/b/228153 imported/w3c/web-platform-tests/css/css-grid/abspos/grid-positioned-item-dynamic-change-003.html [ ImageOnlyFailure ] 1980 webkit.org/b/235025 imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/flex-tracks-with-fractional-size.html [ ImageOnlyFailure ] 1980 1981 webkit.org/b/228153 imported/w3c/web-platform-tests/css/css-lists/content-property/marker-text-matches-armenian.html [ ImageOnlyFailure ] 1981 1982 webkit.org/b/228153 imported/w3c/web-platform-tests/css/css-lists/content-property/marker-text-matches-decimal.html [ ImageOnlyFailure ] -
trunk/Source/WebCore/ChangeLog
r287976 r287977 1 2022-01-13 Ziran Sun <zsun@igalia.com> 2 3 [css-grid] Fix rounding of distributed free space to flexible tracks 4 https://bugs.webkit.org/show_bug.cgi?id=234917 5 6 Reviewed by Darin Adler. 7 8 When computing the growth size for flex sized tracks, the flexFraction multiplied by the flex factor can result 9 in a non-integer size. However, we floor the stretched size to fit in a LayoutUnit. This means that we may lose 10 the fractional part of the computation which can cause the entire free space not being distributed evenly. This 11 fix is to sum up the leftover fractional part from every flexible track to avoid this issue. 12 13 It is an import of Chromium GridNG CL at https://chromium-review.googlesource.com/c/chromium/src/+/3193674. 14 15 * rendering/GridTrackSizingAlgorithm.cpp: 16 (WebCore::GridTrackSizingAlgorithm::computeFlexSizedTracksGrowth const): 17 1 18 2022-01-10 Sergio Villar Senin <svillar@igalia.com> 2 19 -
trunk/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp
r286148 r287977 728 728 ASSERT(increments.size() == numFlexTracks); 729 729 const Vector<GridTrack>& allTracks = tracks(m_direction); 730 // The flexFraction multiplied by the flex factor can result in a non-integer size. Since we floor the stretched size to fit in a LayoutUnit, 731 // we may lose the fractional part of the computation which can cause the entire free space not being distributed evenly. The leftover 732 // fractional part from every flexible track are accumulated here to avoid this issue. 733 double leftOverSize = 0; 730 734 for (size_t i = 0; i < numFlexTracks; ++i) { 731 735 unsigned trackIndex = m_flexibleSizedTracksIndex[i]; … … 733 737 ASSERT(trackSize.maxTrackBreadth().isFlex()); 734 738 LayoutUnit oldBaseSize = allTracks[trackIndex].baseSize(); 735 LayoutUnit newBaseSize = std::max(oldBaseSize, LayoutUnit(flexFraction * trackSize.maxTrackBreadth().flex())); 739 double frShare = flexFraction * trackSize.maxTrackBreadth().flex() + leftOverSize; 740 auto stretchedSize = LayoutUnit(frShare); 741 LayoutUnit newBaseSize = std::max(oldBaseSize, stretchedSize); 736 742 increments[i] = newBaseSize - oldBaseSize; 737 743 totalGrowth += increments[i]; 744 // In the case that stretchedSize is greater than frShare, we floor it to 0 to avoid a negative leftover. 745 leftOverSize = std::max(frShare - stretchedSize.toDouble(), 0.0); 738 746 } 739 747 }
Note: See TracChangeset
for help on using the changeset viewer.