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
Grid track sizing should reset the override width as well as height t…
…o compute intrinsic sizing. https://bugs.webkit.org/show_bug.cgi?id=247465 <rdar://101304306> Reviewed by Alan Baradlay. Grid layout (sometimes) sets the override content size and containing block sizes, so that grid items get sized relative to their grid tracks, rather than the size of the grid element. During the sizing process, we want to know the intrinsic size of children, so we reset any overrides and re-layout children to measure them. We're currently not resetting the content logical width, and there's a comment saying that grid never uses it, but that's out of date and we do need to reset this. * LayoutTests/fast/dynamic/relayout-grid-should-reset-instrinsic-sizes-expected.html: Added. * LayoutTests/fast/dynamic/relayout-grid-should-reset-instrinsic-sizes.html: Added. * Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp: (WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild const): * Source/WebCore/rendering/RenderGrid.cpp: Canonical link: https://commits.webkit.org/256622@main
- Loading branch information
Showing
4 changed files
with
41 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<body> | ||
<div style="width: 150px; height: 150px; background-color: green"></div> | ||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
<style> | ||
#grid_container { | ||
display: grid; | ||
align-items:end; | ||
} | ||
|
||
#inner { | ||
width: 100%; | ||
background-color: green; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="grid_container"> | ||
<div> | ||
<canvas id="inner" width="100" height="100"></img> | ||
</div> | ||
</div> | ||
|
||
<script> | ||
let container = document.getElementById('grid_container'); | ||
window.getComputedStyle(container).width; | ||
container.style.width = '150px'; | ||
</script> | ||
</body> | ||
</html> |
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