Changeset 245279 in webkit
- Timestamp:
- May 14, 2019 8:08:46 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 10 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r245276 r245279 1 2019-05-14 Manuel Rego Casasnovas <rego@igalia.com> 2 3 [css-grid] Use max size to compute auto repeat tracks 4 https://bugs.webkit.org/show_bug.cgi?id=197854 5 6 Reviewed by Javier Fernandez. 7 8 Imported WPT tests for this bug. 9 10 * web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-001-expected.txt: Added. 11 * web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-001.html: Added. 12 * web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-002-expected.txt: Added. 13 * web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-002.html: Added. 14 * web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-max-size-001-expected.txt: Added. 15 * web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-max-size-001.html: Added. 16 * web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-001-expected.txt: Added. 17 * web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-001.html: Added. 18 * web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-002-expected.txt: Added. 19 * web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-002.html: Added. 20 * web-platform-tests/css/css-grid/grid-definition/w3c-import.log: 21 1 22 2019-05-14 Joonghun Park <jh718.park@samsung.com> 2 23 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/w3c-import.log
r234687 r245279 19 19 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/fr-unit-with-percentage.html 20 20 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/fr-unit.html 21 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-001.html 22 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-002.html 23 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-max-size-001.html 24 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-001.html 25 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-002.html 21 26 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-change-fit-content-argument-001.html 22 27 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-inline-auto-repeat-001.html -
trunk/Source/WebCore/ChangeLog
r245276 r245279 1 2019-05-14 Manuel Rego Casasnovas <rego@igalia.com> 2 3 [css-grid] Use max size to compute auto repeat tracks 4 https://bugs.webkit.org/show_bug.cgi?id=197854 5 6 Reviewed by Javier Fernandez. 7 8 When available size is indefinite we should use max size to compute the number of auto repeat tracks. 9 10 The spec text is very clear (https://drafts.csswg.org/css-grid/#auto-repeat): 11 > When auto-fill is given as the repetition number, if the grid container 12 > has a definite size or **max size** in the relevant axis... 13 14 So far we were not doing that for widths, in this patch we modify RenderGrid::computeAutoRepeatTracksCount() 15 to do the same than for heights. 16 17 We also take advantage to fix problems related to min|max sizes and box-sizing property, 18 that were inconsistent for columns and rows. 19 20 Tests: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-001.html 21 imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-max-size-002.html 22 imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-max-size-001.html 23 imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-001.html 24 imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-min-size-002.html 25 26 * rendering/RenderGrid.cpp: 27 (WebCore::RenderGrid::computeAutoRepeatTracksCount const): 28 1 29 2019-05-14 Joonghun Park <pjh0718@gmail.com> 2 30 -
trunk/Source/WebCore/rendering/RenderGrid.cpp
r244213 r245279 457 457 return 0; 458 458 459 if (!isRowAxis && !availableSize) {460 const Length& maxLength = style().logicalMaxHeight();461 if (!maxLength.isUndefined()) {462 availableSize = computeContentLogicalHeight(MaxSize, maxLength, WTF::nullopt);463 if (availableSize)464 availableSize = constrainContentBoxLogicalHeightByMinMax(availableSize.value(), WTF::nullopt);465 }466 }467 468 459 bool needsToFulfillMinimumSize = false; 469 460 if (!availableSize) { 461 const Length& maxSize = isRowAxis ? style().logicalMaxWidth() : style().logicalMaxHeight(); 462 Optional<LayoutUnit> containingBlockAvailableSize; 463 Optional<LayoutUnit> availableMaxSize; 464 if (maxSize.isSpecified()) { 465 if (maxSize.isPercentOrCalculated()) 466 containingBlockAvailableSize = isRowAxis ? containingBlockLogicalWidthForContent() : containingBlockLogicalHeightForContent(ExcludeMarginBorderPadding); 467 LayoutUnit maxSizeValue = valueForLength(maxSize, containingBlockAvailableSize.valueOr(LayoutUnit())); 468 availableMaxSize = isRowAxis ? adjustContentBoxLogicalWidthForBoxSizing(maxSizeValue) : adjustContentBoxLogicalHeightForBoxSizing(maxSizeValue); 469 } 470 470 471 const Length& minSize = isRowAxis ? style().logicalMinWidth() : style().logicalMinHeight(); 471 if (! minSize.isSpecified())472 if (!availableMaxSize && !minSize.isSpecified()) 472 473 return autoRepeatTrackListLength; 473 474 474 LayoutUnit containingBlockAvailableSize = isRowAxis ? containingBlockLogicalWidthForContent() : containingBlockLogicalHeightForContent(ExcludeMarginBorderPadding); 475 availableSize = valueForLength(minSize, containingBlockAvailableSize); 476 needsToFulfillMinimumSize = true; 475 Optional<LayoutUnit> availableMinSize; 476 if (minSize.isSpecified()) { 477 if (!containingBlockAvailableSize && minSize.isPercentOrCalculated()) 478 containingBlockAvailableSize = isRowAxis ? containingBlockLogicalWidthForContent() : containingBlockLogicalHeightForContent(ExcludeMarginBorderPadding); 479 LayoutUnit minSizeValue = valueForLength(minSize, containingBlockAvailableSize.valueOr(LayoutUnit())); 480 availableMinSize = isRowAxis ? adjustContentBoxLogicalWidthForBoxSizing(minSizeValue) : adjustContentBoxLogicalHeightForBoxSizing(minSizeValue); 481 if (!maxSize.isSpecified()) 482 needsToFulfillMinimumSize = true; 483 } 484 485 availableSize = std::max(availableMinSize.valueOr(LayoutUnit()), availableMaxSize.valueOr(LayoutUnit())); 477 486 } 478 487
Note: See TracChangeset
for help on using the changeset viewer.