Permalink
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] Improve grid container sizing with size constraints and in…
…trinsic sizes https://bugs.webkit.org/show_bug.cgi?id=150679 Reviewed by Darin Adler. Source/WebCore: The grid container stores from now on its min-content and max-content block sizes in order to be able to properly compute its intrinsic size. It has to redefine computeIntrinsicLogicalContentHeightUsing() because the behavior of grid is different to "normal" blocks: - the min-content size is the sum of the grid container's track sizes in the appropiate axis when the grid is sized under a min-content constraint. - the max-content size is the sum of the grid container's track sizes in the appropiate axis when the grid is sized under a max-content constraint. - the auto block size is the max-content size. A nice side effect is that we can now properly detect whether the grid has a definite size on a given axis or not. Tests: fast/css-grid-layout/absolute-positioning-definite-sizes.html fast/css-grid-layout/flex-and-intrinsic-sizes.html fast/css-grid-layout/maximize-tracks-definite-indefinite-height.html fast/css-grid-layout/maximize-tracks-definite-indefinite-width.html * rendering/RenderBox.h: made computeIntrinsicLogicalContentHeightUsing() virtual. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::GridSizingData::GridSizingData): (WebCore::RenderGrid::GridSizingData::freeSpaceForDirection): (WebCore::RenderGrid::GridSizingData::setFreeSpaceForDirection): (WebCore::RenderGrid::computeTrackBasedLogicalHeight): (WebCore::RenderGrid::computeTrackSizesForDirection): (WebCore::RenderGrid::layoutBlock): (WebCore::RenderGrid::computeIntrinsicLogicalWidths): (WebCore::RenderGrid::computeIntrinsicLogicalHeight): (WebCore::RenderGrid::computeIntrinsicLogicalContentHeightUsing): (WebCore::RenderGrid::computeUsedBreadthOfGridTracks): (WebCore::RenderGrid::distributeSpaceToTracks): (WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth): (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded): (WebCore::RenderGrid::layoutGridItems): (WebCore::RenderGrid::populateGridPositions): (WebCore::RenderGrid::gridElementIsShrinkToFit): Deleted. * rendering/RenderGrid.h: LayoutTests: * fast/css-grid-layout/absolute-positioning-definite-sizes-expected.txt: Added. * fast/css-grid-layout/absolute-positioning-definite-sizes.html: Added. * fast/css-grid-layout/flex-and-intrinsic-sizes-expected.txt: Added. * fast/css-grid-layout/flex-and-intrinsic-sizes.html: Added. * fast/css-grid-layout/grid-element-change-columns-repaint.html: * fast/css-grid-layout/grid-item-change-column-repaint.html: * fast/css-grid-layout/grid-preferred-logical-widths.html: * fast/css-grid-layout/maximize-tracks-definite-indefinite-height-expected.txt: Added. * fast/css-grid-layout/maximize-tracks-definite-indefinite-height.html: Added. * fast/css-grid-layout/maximize-tracks-definite-indefinite-width-expected.txt: Added. * fast/css-grid-layout/maximize-tracks-definite-indefinite-width.html: Added. * fast/css-grid-layout/percent-of-indefinite-track-size.html: * fast/events/key-events-in-editable-gridbox-expected.txt: * fast/events/key-events-in-editable-gridbox.html: Added more test cases for intrinsic and fixed sized heights. Canonical link: https://commits.webkit.org/169231@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192154 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information