Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use grid area size not available space when applying aspect ratio to grid containers #656

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Content alignment (`align-content`/`justify-content`) behaviour was updated to match the latest spec (and Chrome 123+) (#635)
- Ensure that root Flexbox nodes are floored by their padding-border (#651, #655)
- Use grid area size not available space when applying aspect ratio to grid containers (#656)

## 0.4.3

Expand Down
4 changes: 2 additions & 2 deletions src/compute/grid/types/grid_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ impl GridItem {
tree.measure_child_size(
self.node,
known_dimensions,
available_space,
inner_node_size,
available_space.map(|opt| match opt {
Some(size) => AvailableSpace::Definite(size),
None => AvailableSpace::MinContent,
Expand Down Expand Up @@ -387,7 +387,7 @@ impl GridItem {
tree.measure_child_size(
self.node,
known_dimensions,
available_space,
inner_node_size,
available_space.map(|opt| match opt {
Some(size) => AvailableSpace::Definite(size),
None => AvailableSpace::MaxContent,
Expand Down
21 changes: 21 additions & 0 deletions test_fixtures/grid/chrome_issue_325928327.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script src="../../scripts/gentest/test_helper.js"></script>
<link rel="stylesheet" type="text/css" href="../../scripts/gentest/test_base_style.css">
<title>
Test description
</title>
</head>
<body>

<div class="viewport">
<div id="test-root" style="width: 100%; height: 40px; display: grid; justify-items: center;">
<div style="height: 100%; outline: 2px solid red;">
<div style="height: 100%; aspect-ratio: 1; background: slategray;"></div>
</div>
</div>
</div>

</body>
</html>
112 changes: 112 additions & 0 deletions tests/generated/grid/chrome_issue_325928327.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/generated/grid/mod.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.