Fix `justify-content` and `align-content` when free space is negative (content overflows container) (#551)
* Add tests for justify-content with negative free space (content overflows container) * Add tests for align-content with negative free space (content overflows container) * Add tests for content alignment with negative space and gap * Add tests for align/justify-content with negative free space for CSS Grid containers * Fix alignment when free space is negative Co-authored-by: robtfm <50659922+robtfm@users.noreply.github.com> * Remove existing CSS Grid accounting for negative free space when aligning * Add alignment fix to release notes --------- Co-authored-by: robtfm <50659922+robtfm@users.noreply.github.com>
Semantic delta · 116
src/compute/common/alignment.rs
- body changed def compute_alignment_offset
src/compute/grid/alignment.rs
- body changed def align_tracks
tests/generated/align_content_center_single_line.rs
tests/generated/align_content_center_single_line_negative_space.rs
tests/generated/align_content_center_single_line_negative_space_gap.rs
tests/generated/align_content_center_wrapped.rs
- new fn align_content_center_wrapped
tests/generated/align_content_center_wrapped_negative_space.rs
tests/generated/align_content_center_wrapped_negative_space_gap.rs
tests/generated/align_content_end.rs
- new fn align_content_end
tests/generated/align_content_end_single_line_negative_space.rs
tests/generated/align_content_end_single_line_negative_space_gap.rs
tests/generated/align_content_end_wrapped_negative_space.rs
tests/generated/align_content_end_wrapped_negative_space_gap.rs
tests/generated/align_content_space_around_single_line_negative_space.rs
tests/generated/align_content_space_around_single_line_negative_space_gap.rs
tests/generated/align_content_space_around_wrapped_negative_space.rs
tests/generated/align_content_space_around_wrapped_negative_space_gap.rs
tests/generated/align_content_space_between_single_line_negative_space.rs
tests/generated/align_content_space_between_single_line_negative_space_gap.rs
tests/generated/align_content_space_between_wrapped_negative_space.rs
tests/generated/align_content_space_between_wrapped_negative_space_gap.rs
tests/generated/align_content_space_evenly_single_line_negative_space.rs
tests/generated/align_content_space_evenly_single_line_negative_space_gap.rs
tests/generated/align_content_space_evenly_wrapped_negative_space.rs
tests/generated/align_content_space_evenly_wrapped_negative_space_gap.rs
tests/generated/align_content_start.rs
- new fn align_content_start
tests/generated/align_content_start_single_line_negative_space.rs
tests/generated/align_content_start_single_line_negative_space_gap.rs
tests/generated/align_content_start_wrapped_negative_space.rs
tests/generated/grid_align_content_center_negative_space_gap.rs
tests/generated/grid_align_content_end_negative_space_gap.rs
tests/generated/grid_align_content_space_around_negative_space_gap.rs
tests/generated/grid_align_content_space_between_negative_space_gap.rs
tests/generated/grid_align_content_space_evenly_negative_space_gap.rs
tests/generated/grid_align_content_start_negative_space_gap.rs
tests/generated/grid_justify_content_center_negative_space_gap.rs
tests/generated/grid_justify_content_end_negative_space_gap.rs
tests/generated/grid_justify_content_space_around_negative_space_gap.rs
tests/generated/grid_justify_content_space_between_negative_space_gap.rs
tests/generated/grid_justify_content_space_evenly_negative_space_gap.rs
tests/generated/grid_justify_content_start_negative_space_gap.rs
tests/generated/justify_content_column_center_negative_space.rs
tests/generated/justify_content_column_center_negative_space_gap.rs
tests/generated/justify_content_column_end.rs
- new fn justify_content_column_end
tests/generated/justify_content_column_end_negative_space.rs
tests/generated/justify_content_column_end_negative_space_gap.rs
tests/generated/justify_content_column_end_reverse.rs
tests/generated/justify_content_column_flex_end_reverse.rs
tests/generated/justify_content_column_flex_start_reverse.rs
tests/generated/justify_content_column_space_around_negative_space.rs
tests/generated/justify_content_column_space_around_negative_space_gap.rs
tests/generated/justify_content_column_space_between_negative_space.rs
tests/generated/justify_content_column_space_between_negative_space_gap.rs
tests/generated/justify_content_column_space_evenly_negative_space.rs
tests/generated/justify_content_column_space_evenly_negative_space_gap.rs
tests/generated/justify_content_column_start.rs
- new fn justify_content_column_start
tests/generated/justify_content_column_start_negative_space.rs
tests/generated/justify_content_column_start_negative_space_gap.rs
tests/generated/justify_content_column_start_reverse.rs
tests/generated/mod.rs
- new mod align_content_center_single_line
- new mod align_content_center_single_line_negative_space
- new mod align_content_center_single_line_negative_space_gap
- new mod align_content_center_wrapped
- new mod align_content_center_wrapped_negative_space
- new mod align_content_center_wrapped_negative_space_gap
- new mod align_content_end
- new mod align_content_end_single_line_negative_space
- new mod align_content_end_single_line_negative_space_gap
- new mod align_content_end_wrapped_negative_space
- new mod align_content_end_wrapped_negative_space_gap
- new mod align_content_space_around_single_line_negative_space
- new mod align_content_space_around_single_line_negative_space_gap
- new mod align_content_space_around_wrapped_negative_space
- new mod align_content_space_around_wrapped_negative_space_gap
- new mod align_content_space_between_single_line_negative_space
- new mod align_content_space_between_single_line_negative_space_gap
- new mod align_content_space_between_wrapped_negative_space
- new mod align_content_space_between_wrapped_negative_space_gap
- new mod align_content_space_evenly_single_line_negative_space
- new mod align_content_space_evenly_single_line_negative_space_gap
- new mod align_content_space_evenly_wrapped_negative_space
- new mod align_content_space_evenly_wrapped_negative_space_gap
- new mod align_content_start
- new mod align_content_start_single_line_negative_space
- new mod align_content_start_single_line_negative_space_gap
- new mod align_content_start_wrapped_negative_space
- new mod grid_align_content_center_negative_space_gap
- new mod grid_align_content_end_negative_space_gap
- new mod grid_align_content_space_around_negative_space_gap
- new mod grid_align_content_space_between_negative_space_gap
- new mod grid_align_content_space_evenly_negative_space_gap
- new mod grid_align_content_start_negative_space_gap
- new mod grid_justify_content_center_negative_space_gap
- new mod grid_justify_content_end_negative_space_gap
- new mod grid_justify_content_space_around_negative_space_gap
- new mod grid_justify_content_space_between_negative_space_gap
- new mod grid_justify_content_space_evenly_negative_space_gap
- new mod grid_justify_content_start_negative_space_gap
- new mod justify_content_column_center_negative_space
- new mod justify_content_column_center_negative_space_gap
- new mod justify_content_column_end
- new mod justify_content_column_end_negative_space
- new mod justify_content_column_end_negative_space_gap
- new mod justify_content_column_end_reverse
- new mod justify_content_column_flex_end_reverse
- new mod justify_content_column_flex_start_reverse
- new mod justify_content_column_space_around_negative_space
- new mod justify_content_column_space_around_negative_space_gap
- new mod justify_content_column_space_between_negative_space
- new mod justify_content_column_space_between_negative_space_gap
- new mod justify_content_column_space_evenly_negative_space
- new mod justify_content_column_space_evenly_negative_space_gap
- new mod justify_content_column_start
- new mod justify_content_column_start_negative_space
- new mod justify_content_column_start_negative_space_gap
- new mod justify_content_column_start_reverse
118 files · +6675 −22
- RELEASES.md +6 −0
- src/compute/common/alignment.rs +15 −2
- src/compute/grid/alignment.rs +3 −20
- test_fixtures/align_content_center_single_line.html +22 −0
- test_fixtures/align_content_center_single_line_negative_space.html +19 −0
- test_fixtures/align_content_center_single_line_negative_space_gap.html +19 −0
- test_fixtures/align_content_center_wrapped.html +22 −0
- test_fixtures/align_content_center_wrapped_negative_space.html +21 −0
- test_fixtures/align_content_center_wrapped_negative_space_gap.html +21 −0
- test_fixtures/align_content_end.html +21 −0
- test_fixtures/align_content_end_single_line_negative_space.html +19 −0
- test_fixtures/align_content_end_single_line_negative_space_gap.html +19 −0
- test_fixtures/align_content_end_wrapped_negative_space.html +21 −0
- test_fixtures/align_content_end_wrapped_negative_space_gap.html +21 −0
- test_fixtures/align_content_space_around_single_line_negative_space.html +19 −0
- test_fixtures/align_content_space_around_single_line_negative_space_gap.html +19 −0
- test_fixtures/align_content_space_around_wrapped_negative_space.html +21 −0
- test_fixtures/align_content_space_around_wrapped_negative_space_gap.html +21 −0
- test_fixtures/align_content_space_between_single_line_negative_space.html +19 −0
- test_fixtures/align_content_space_between_single_line_negative_space_gap.html +19 −0
- test_fixtures/align_content_space_between_wrapped_negative_space.html +21 −0
- test_fixtures/align_content_space_between_wrapped_negative_space_gap.html +21 −0
- test_fixtures/align_content_space_evenly_single_line_negative_space.html +19 −0
- test_fixtures/align_content_space_evenly_single_line_negative_space_gap.html +19 −0
- test_fixtures/align_content_space_evenly_wrapped_negative_space.html +21 −0
- test_fixtures/align_content_space_evenly_wrapped_negative_space_gap.html +21 −0
- test_fixtures/align_content_start.html +21 −0
- test_fixtures/align_content_start_single_line_negative_space.html +19 −0
- test_fixtures/align_content_start_single_line_negative_space_gap.html +19 −0
- test_fixtures/align_content_start_wrapped_negative_space.html +21 −0
- test_fixtures/grid_align_content_center_negative_space_gap.html +27 −0
- test_fixtures/grid_align_content_end_negative_space_gap.html +27 −0
- test_fixtures/grid_align_content_space_around_negative_space_gap.html +27 −0
- test_fixtures/grid_align_content_space_between_negative_space_gap.html +27 −0
- test_fixtures/grid_align_content_space_evenly_negative_space_gap.html +27 −0
- test_fixtures/grid_align_content_start_negative_space_gap.html +27 −0
- test_fixtures/grid_justify_content_center_negative_space_gap.html +27 −0
- test_fixtures/grid_justify_content_end_negative_space_gap.html +27 −0
- test_fixtures/grid_justify_content_space_around_negative_space_gap.html +27 −0
- test_fixtures/grid_justify_content_space_between_negative_space_gap.html +27 −0
- test_fixtures/grid_justify_content_space_evenly_negative_space_gap.html +27 −0
- test_fixtures/grid_justify_content_start_negative_space_gap.html +27 −0
- test_fixtures/justify_content_column_center_negative_space.html +21 −0
- test_fixtures/justify_content_column_center_negative_space_gap.html +21 −0
- test_fixtures/justify_content_column_end.html +19 −0
- test_fixtures/justify_content_column_end_negative_space.html +21 −0
- test_fixtures/justify_content_column_end_negative_space_gap.html +21 −0
- test_fixtures/justify_content_column_end_reverse.html +19 −0
- test_fixtures/justify_content_column_flex_end_reverse.html +19 −0
- test_fixtures/justify_content_column_flex_start_reverse.html +19 −0
- test_fixtures/justify_content_column_space_around_negative_space.html +21 −0
- test_fixtures/justify_content_column_space_around_negative_space_gap.html +21 −0
- test_fixtures/justify_content_column_space_between_negative_space.html +21 −0
- test_fixtures/justify_content_column_space_between_negative_space_gap.html +21 −0
- test_fixtures/justify_content_column_space_evenly_negative_space.html +21 −0
- test_fixtures/justify_content_column_space_evenly_negative_space_gap.html +21 −0
- test_fixtures/justify_content_column_start.html +19 −0
- test_fixtures/justify_content_column_start_negative_space.html +21 −0
- test_fixtures/justify_content_column_start_negative_space_gap.html +21 −0
- test_fixtures/justify_content_column_start_reverse.html +19 −0
- tests/generated/align_content_center_single_line.rs +113 −0
- tests/generated/align_content_center_single_line_negative_space.rs +68 −0
- tests/generated/align_content_center_single_line_negative_space_gap.rs +72 −0
- tests/generated/align_content_center_wrapped.rs +114 −0
- tests/generated/align_content_center_wrapped_negative_space.rs +99 −0
- tests/generated/align_content_center_wrapped_negative_space_gap.rs +103 −0
- tests/generated/align_content_end.rs +101 −0
- tests/generated/align_content_end_single_line_negative_space.rs +68 −0
- tests/generated/align_content_end_single_line_negative_space_gap.rs +72 −0
- tests/generated/align_content_end_wrapped_negative_space.rs +99 −0
- tests/generated/align_content_end_wrapped_negative_space_gap.rs +103 −0
- tests/generated/align_content_space_around_single_line_negative_space.rs +68 −0
- tests/generated/align_content_space_around_single_line_negative_space_gap.rs +72 −0
- tests/generated/align_content_space_around_wrapped_negative_space.rs +99 −0
- tests/generated/align_content_space_around_wrapped_negative_space_gap.rs +103 −0
- tests/generated/align_content_space_between_single_line_negative_space.rs +68 −0
- tests/generated/align_content_space_between_single_line_negative_space_gap.rs +72 −0
- tests/generated/align_content_space_between_wrapped_negative_space.rs +99 −0
- tests/generated/align_content_space_between_wrapped_negative_space_gap.rs +103 −0
- tests/generated/align_content_space_evenly_single_line_negative_space.rs +68 −0
- tests/generated/align_content_space_evenly_single_line_negative_space_gap.rs +72 −0
- tests/generated/align_content_space_evenly_wrapped_negative_space.rs +99 −0
- tests/generated/align_content_space_evenly_wrapped_negative_space_gap.rs +103 −0
- tests/generated/align_content_start.rs +100 −0
- tests/generated/align_content_start_single_line_negative_space.rs +68 −0
- tests/generated/align_content_start_single_line_negative_space_gap.rs +72 −0
- tests/generated/align_content_start_wrapped_negative_space.rs +99 −0
- tests/generated/grid_align_content_center_negative_space_gap.rs +115 −0
- tests/generated/grid_align_content_end_negative_space_gap.rs +115 −0
- tests/generated/grid_align_content_space_around_negative_space_gap.rs +115 −0
- tests/generated/grid_align_content_space_between_negative_space_gap.rs +115 −0
- tests/generated/grid_align_content_space_evenly_negative_space_gap.rs +115 −0
- tests/generated/grid_align_content_start_negative_space_gap.rs +115 −0
- tests/generated/grid_justify_content_center_negative_space_gap.rs +115 −0
- tests/generated/grid_justify_content_end_negative_space_gap.rs +115 −0
- tests/generated/grid_justify_content_space_around_negative_space_gap.rs +115 −0
- tests/generated/grid_justify_content_space_between_negative_space_gap.rs +115 −0
- tests/generated/grid_justify_content_space_evenly_negative_space_gap.rs +115 −0
- tests/generated/grid_justify_content_start_negative_space_gap.rs +115 −0
- tests/generated/justify_content_column_center_negative_space.rs +99 −0
- tests/generated/justify_content_column_center_negative_space_gap.rs +103 −0
- tests/generated/justify_content_column_end.rs +63 −0
- tests/generated/justify_content_column_end_negative_space.rs +99 −0
- tests/generated/justify_content_column_end_negative_space_gap.rs +103 −0
- tests/generated/justify_content_column_end_reverse.rs +63 −0
- tests/generated/justify_content_column_flex_end_reverse.rs +63 −0
- tests/generated/justify_content_column_flex_start_reverse.rs +63 −0
- tests/generated/justify_content_column_space_around_negative_space.rs +99 −0
- tests/generated/justify_content_column_space_around_negative_space_gap.rs +103 −0
- tests/generated/justify_content_column_space_between_negative_space.rs +99 −0
- tests/generated/justify_content_column_space_between_negative_space_gap.rs +103 −0
- tests/generated/justify_content_column_space_evenly_negative_space.rs +99 −0
- tests/generated/justify_content_column_space_evenly_negative_space_gap.rs +103 −0
- tests/generated/justify_content_column_start.rs +63 −0
- tests/generated/justify_content_column_start_negative_space.rs +99 −0
- tests/generated/justify_content_column_start_negative_space_gap.rs +103 −0
- tests/generated/justify_content_column_start_reverse.rs +63 −0
- tests/generated/mod.rs +69 −0
diff --git a/RELEASES.md b/RELEASES.md
index cddd49e08..31e29c03a 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -1,5 +1,11 @@
# Release Notes
+## 0.3.15
+
+### Fixes
+
+- Fix justify-content and align-content when free space is negative (content overflows container) (#549) (#551)
+
## 0.3.14
### Fixes
diff --git a/src/compute/common/alignment.rs b/src/compute/common/alignment.rs
index fb6937520..c0725a8f2 100644
--- a/src/compute/common/alignment.rs
+++ b/src/compute/common/alignment.rs
@@ -35,10 +35,23 @@ pub(crate) fn compute_alignment_offset(
AlignContent::Center => free_space / 2.0,
AlignContent::Stretch => 0.0,
AlignContent::SpaceBetween => 0.0,
- AlignContent::SpaceAround => (free_space / num_items as f32) / 2.0,
- AlignContent::SpaceEvenly => free_space / (num_items + 1) as f32,
+ AlignContent::SpaceAround => {
+ if free_space >= 0.0 {
+ (free_space / num_items as f32) / 2.0
+ } else {
+ free_space / 2.0
+ }
+ }
+ AlignContent::SpaceEvenly => {
+ if free_space >= 0.0 {
+ free_space / (num_items + 1) as f32
+ } else {
+ free_space / 2.0
+ }
+ }
}
} else {
+ let free_space = free_space.max(0.0);
gap + match alignment_mode {
AlignContent::Start => 0.0,
AlignContent::FlexStart => 0.0,
diff --git a/src/compute/grid/alignment.rs b/src/compute/grid/alignment.rs
index 0b85fb792..b4abb9f32 100644
--- a/src/compute/grid/alignment.rs
+++ b/src/compute/grid/alignment.rs
@@ -9,7 +9,7 @@ use crate::math::MaybeMath;
use crate::node::Node;
use crate::resolve::{MaybeResolve, ResolveOrZero};
use crate::style::{AlignContent, AlignItems, AlignSelf, AvailableSpace, Position};
-use crate::sys::{f32_max, f32_min};
+use crate::sys::f32_max;
use crate::tree::LayoutTree;
/// Align the grid tracks within the grid according to the align-content (rows) or
@@ -23,25 +23,8 @@ pub(super) fn align_tracks(
track_alignment_style: AlignContent,
) {
let used_size: f32 = tracks.iter().map(|track| track.base_size).sum();
- let size_diff = grid_container_content_box_size - used_size;
- let free_space = f32_max(size_diff, 0.0);
- let overflow = f32_min(size_diff, 0.0);
-
- // If the used_size > grid_container_size then the tracks must overflow their container
- // The direction in which they do so is determined by the alignment style
- let origin = padding.start
- + border.start
- + match track_alignment_style {
- AlignContent::Start => 0.0,
- AlignContent::FlexStart => 0.0,
- AlignContent::End => overflow,
- AlignContent::FlexEnd => overflow,
- AlignContent::Center => overflow / 2.0,
- AlignContent::Stretch => 0.0,
- AlignContent::SpaceBetween => 0.0,
- AlignContent::SpaceEvenly => 0.0,
- AlignContent::SpaceAround => 0.0,
- };
+ let free_space = grid_container_content_box_size - used_size;
+ let origin = padding.start + border.start;
// Count the number of non-collapsed tracks (not counting gutters)
let num_tracks = tracks.iter().skip(1).step_by(2).filter(|track| !track.is_collapsed).count();
diff --git a/test_fixtures/align_content_center_single_line.html b/test_fixtures/align_content_center_single_line.html
new file mode 100644
index 000000000..2ab861197
--- /dev/null
+++ b/test_fixtures/align_content_center_single_line.html
@@ -0,0 +1,22 @@
+<!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 id="test-root" style="width: 120px; height: 100px; flex-direction: row; align-content: center;">
+ <div style="height: 10px; width: 50px;"></div>
+ <div style="height: 10px; width: 50px;"></div>
+ <div style="height: 10px; width: 50px;"></div>
+ <div style="height: 10px; width: 50px;"></div>
+ <div style="height: 10px; width: 50px;"></div>
+ <div style="height: 10px; width: 50px;"></div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/align_content_center_single_line_negative_space.html b/test_fixtures/align_content_center_single_line_negative_space.html
new file mode 100644
index 000000000..bf13144e3
--- /dev/null
+++ b/test_fixtures/align_content_center_single_line_negative_space.html
@@ -0,0 +1,19 @@
+<!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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: row; align-content: center; justify-content: center; height: 10px;">
+ <div style="width: 80%; height: 60px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/align_content_center_single_line_negative_space_gap.html b/test_fixtures/align_content_center_single_line_negative_space_gap.html
new file mode 100644
index 000000000..2a4c4981e
--- /dev/null
+++ b/test_fixtures/align_content_center_single_line_negative_space_gap.html
@@ -0,0 +1,19 @@
+<!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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: row; align-content: center; justify-content: center; height: 10px; gap: 10px;">
+ <div style="width: 80%; height: 60px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/align_content_center_wrapped.html b/test_fixtures/align_content_center_wrapped.html
new file mode 100644
index 000000000..60dbb1d65
--- /dev/null
+++ b/test_fixtures/align_content_center_wrapped.html
@@ -0,0 +1,22 @@
+<!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 id="test-root" style="width: 120px; height: 100px; flex-direction: row; flex-wrap: wrap; align-content: center;">
+ <div style="height: 10px; width: 50px;"></div>
+ <div style="height: 10px; width: 50px;"></div>
+ <div style="height: 10px; width: 50px;"></div>
+ <div style="height: 10px; width: 50px;"></div>
+ <div style="height: 10px; width: 50px;"></div>
+ <div style="height: 10px; width: 50px;"></div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/align_content_center_wrapped_negative_space.html b/test_fixtures/align_content_center_wrapped_negative_space.html
new file mode 100644
index 000000000..c3df303fc
--- /dev/null
+++ b/test_fixtures/align_content_center_wrapped_negative_space.html
@@ -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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: row; flex-wrap: wrap; align-content: center; justify-content: center; height: 10px;">
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/align_content_center_wrapped_negative_space_gap.html b/test_fixtures/align_content_center_wrapped_negative_space_gap.html
new file mode 100644
index 000000000..f91b988b3
--- /dev/null
+++ b/test_fixtures/align_content_center_wrapped_negative_space_gap.html
@@ -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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: row; flex-wrap: wrap; align-content: center; justify-content: center; height: 10px; gap: 10px;">
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/align_content_end.html b/test_fixtures/align_content_end.html
new file mode 100644
index 000000000..32c5fb768
--- /dev/null
+++ b/test_fixtures/align_content_end.html
@@ -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 id="test-root" style="width: 100px; height: 100px; flex-wrap: wrap; flex-direction: column; align-content: end;">
+ <div style="width: 50px; height: 10px;"></div>
+ <div style="width: 50px; height: 10px;"></div>
+ <div style="width: 50px; height: 10px;"></div>
+ <div style="width: 50px; height: 10px;"></div>
+ <div style="width: 50px; height: 10px;"></div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/align_content_end_single_line_negative_space.html b/test_fixtures/align_content_end_single_line_negative_space.html
new file mode 100644
index 000000000..548382409
--- /dev/null
+++ b/test_fixtures/align_content_end_single_line_negative_space.html
@@ -0,0 +1,19 @@
+<!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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: row; align-content: end; justify-content: center; height: 10px;">
+ <div style="width: 80%; height: 60px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/align_content_end_single_line_negative_space_gap.html b/test_fixtures/align_content_end_single_line_negative_space_gap.html
new file mode 100644
index 000000000..985827177
--- /dev/null
+++ b/test_fixtures/align_content_end_single_line_negative_space_gap.html
@@ -0,0 +1,19 @@
+<!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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: row; align-content: end; justify-content: center; height: 10px; gap: 10px;">
+ <div style="width: 80%; height: 60px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/align_content_end_wrapped_negative_space.html b/test_fixtures/align_content_end_wrapped_negative_space.html
new file mode 100644
index 000000000..acb7c67f5
--- /dev/null
+++ b/test_fixtures/align_content_end_wrapped_negative_space.html
@@ -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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: row; flex-wrap: wrap; align-content: end; justify-content: center; height: 10px;">
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/align_content_end_wrapped_negative_space_gap.html b/test_fixtures/align_content_end_wrapped_negative_space_gap.html
new file mode 100644
index 000000000..dadb54d0d
--- /dev/null
+++ b/test_fixtures/align_content_end_wrapped_negative_space_gap.html
@@ -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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: row; flex-wrap: wrap; align-content: end; justify-content: center; height: 10px; gap: 10px;">
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/align_content_space_around_single_line_negative_space.html b/test_fixtures/align_content_space_around_single_line_negative_space.html
new file mode 100644
index 000000000..7f6f9211a
--- /dev/null
+++ b/test_fixtures/align_content_space_around_single_line_negative_space.html
@@ -0,0 +1,19 @@
+<!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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: row; align-content: space-around; justify-content: center; height: 10px;">
+ <div style="width: 80%; height: 60px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/align_content_space_around_single_line_negative_space_gap.html b/test_fixtures/align_content_space_around_single_line_negative_space_gap.html
new file mode 100644
index 000000000..93a6720ab
--- /dev/null
+++ b/test_fixtures/align_content_space_around_single_line_negative_space_gap.html
@@ -0,0 +1,19 @@
+<!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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: row; align-content: space-around; justify-content: center; height: 10px; gap: 10px;">
+ <div style="width: 80%; height: 60px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/align_content_space_around_wrapped_negative_space.html b/test_fixtures/align_content_space_around_wrapped_negative_space.html
new file mode 100644
index 000000000..8e4d0fe98
--- /dev/null
+++ b/test_fixtures/align_content_space_around_wrapped_negative_space.html
@@ -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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: row; flex-wrap: wrap; align-content: space-around; justify-content: center; height: 10px;">
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/align_content_space_around_wrapped_negative_space_gap.html b/test_fixtures/align_content_space_around_wrapped_negative_space_gap.html
new file mode 100644
index 000000000..7dada8173
--- /dev/null
+++ b/test_fixtures/align_content_space_around_wrapped_negative_space_gap.html
@@ -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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: row; flex-wrap: wrap; align-content: space-around; justify-content: center; height: 10px; gap: 10px;">
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/align_content_space_between_single_line_negative_space.html b/test_fixtures/align_content_space_between_single_line_negative_space.html
new file mode 100644
index 000000000..d12fffa13
--- /dev/null
+++ b/test_fixtures/align_content_space_between_single_line_negative_space.html
@@ -0,0 +1,19 @@
+<!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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: row; align-content: space-between; justify-content: center; height: 10px;">
+ <div style="width: 80%; height: 60px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/align_content_space_between_single_line_negative_space_gap.html b/test_fixtures/align_content_space_between_single_line_negative_space_gap.html
new file mode 100644
index 000000000..54bcd2224
--- /dev/null
+++ b/test_fixtures/align_content_space_between_single_line_negative_space_gap.html
@@ -0,0 +1,19 @@
+<!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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: row; align-content: space-between; justify-content: center; height: 10px; gap: 10px;">
+ <div style="width: 80%; height: 60px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/align_content_space_between_wrapped_negative_space.html b/test_fixtures/align_content_space_between_wrapped_negative_space.html
new file mode 100644
index 000000000..ddbe5cff6
--- /dev/null
+++ b/test_fixtures/align_content_space_between_wrapped_negative_space.html
@@ -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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: row; flex-wrap: wrap; align-content: space-between; justify-content: center; height: 10px;">
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/align_content_space_between_wrapped_negative_space_gap.html b/test_fixtures/align_content_space_between_wrapped_negative_space_gap.html
new file mode 100644
index 000000000..5d19d3833
--- /dev/null
+++ b/test_fixtures/align_content_space_between_wrapped_negative_space_gap.html
@@ -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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: row; flex-wrap: wrap; align-content: space-between; justify-content: center; height: 10px; gap: 10px;">
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/align_content_space_evenly_single_line_negative_space.html b/test_fixtures/align_content_space_evenly_single_line_negative_space.html
new file mode 100644
index 000000000..b894dc54e
--- /dev/null
+++ b/test_fixtures/align_content_space_evenly_single_line_negative_space.html
@@ -0,0 +1,19 @@
+<!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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: row; align-content: space-evenly; justify-content: center; height: 10px;">
+ <div style="width: 80%; height: 60px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/align_content_space_evenly_single_line_negative_space_gap.html b/test_fixtures/align_content_space_evenly_single_line_negative_space_gap.html
new file mode 100644
index 000000000..511d1ea28
--- /dev/null
+++ b/test_fixtures/align_content_space_evenly_single_line_negative_space_gap.html
@@ -0,0 +1,19 @@
+<!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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: row; align-content: space-evenly; justify-content: center; height: 10px; gap: 10px;">
+ <div style="width: 80%; height: 60px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/align_content_space_evenly_wrapped_negative_space.html b/test_fixtures/align_content_space_evenly_wrapped_negative_space.html
new file mode 100644
index 000000000..ff2687cb6
--- /dev/null
+++ b/test_fixtures/align_content_space_evenly_wrapped_negative_space.html
@@ -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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: row; flex-wrap: wrap; align-content: space-evenly; justify-content: center; height: 10px;">
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/align_content_space_evenly_wrapped_negative_space_gap.html b/test_fixtures/align_content_space_evenly_wrapped_negative_space_gap.html
new file mode 100644
index 000000000..e3bb2de26
--- /dev/null
+++ b/test_fixtures/align_content_space_evenly_wrapped_negative_space_gap.html
@@ -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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: row; flex-wrap: wrap; align-content: space-evenly; justify-content: center; height: 10px; gap: 10px;">
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/align_content_start.html b/test_fixtures/align_content_start.html
new file mode 100644
index 000000000..07d90c5ff
--- /dev/null
+++ b/test_fixtures/align_content_start.html
@@ -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 id="test-root" style="width: 130px; height: 100px; flex-wrap: wrap; flex-direction: row; align-content: start;">
+ <div style="width: 50px; height: 10px;"></div>
+ <div style="width: 50px; height: 10px;"></div>
+ <div style="width: 50px; height: 10px;"></div>
+ <div style="width: 50px; height: 10px;"></div>
+ <div style="width: 50px; height: 10px;"></div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/align_content_start_single_line_negative_space.html b/test_fixtures/align_content_start_single_line_negative_space.html
new file mode 100644
index 000000000..1f7349297
--- /dev/null
+++ b/test_fixtures/align_content_start_single_line_negative_space.html
@@ -0,0 +1,19 @@
+<!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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: row; align-content: start; justify-content: center; height: 10px;">
+ <div style="width: 80%; height: 60px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/align_content_start_single_line_negative_space_gap.html b/test_fixtures/align_content_start_single_line_negative_space_gap.html
new file mode 100644
index 000000000..5e743982b
--- /dev/null
+++ b/test_fixtures/align_content_start_single_line_negative_space_gap.html
@@ -0,0 +1,19 @@
+<!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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: row; align-content: start; justify-content: center; height: 10px; gap: 10px;">
+ <div style="width: 80%; height: 60px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/align_content_start_wrapped_negative_space.html b/test_fixtures/align_content_start_wrapped_negative_space.html
new file mode 100644
index 000000000..d1ec8f28e
--- /dev/null
+++ b/test_fixtures/align_content_start_wrapped_negative_space.html
@@ -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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: row; flex-wrap: wrap; align-content: start; justify-content: center; height: 10px;">
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/grid_align_content_center_negative_space_gap.html b/test_fixtures/grid_align_content_center_negative_space_gap.html
new file mode 100644
index 000000000..1460a9004
--- /dev/null
+++ b/test_fixtures/grid_align_content_center_negative_space_gap.html
@@ -0,0 +1,27 @@
+<!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 id="test-root" style="display: grid; width: 240px; height: 240px; border-width: 60px;">
+ <div id="test-root" style="height: 120px; width: 120px; display: grid; grid-template-columns: 20px 20px 20px; grid-template-rows: 40px 40px 40px; justify-content: center; align-content: center; gap: 10px;">
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/grid_align_content_end_negative_space_gap.html b/test_fixtures/grid_align_content_end_negative_space_gap.html
new file mode 100644
index 000000000..6a1a652ce
--- /dev/null
+++ b/test_fixtures/grid_align_content_end_negative_space_gap.html
@@ -0,0 +1,27 @@
+<!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 id="test-root" style="display: grid; width: 240px; height: 240px; border-width: 60px;">
+ <div id="test-root" style="height: 120px; width: 120px; display: grid; grid-template-columns: 20px 20px 20px; grid-template-rows: 40px 40px 40px; justify-content: center; align-content: end; gap: 10px;">
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/grid_align_content_space_around_negative_space_gap.html b/test_fixtures/grid_align_content_space_around_negative_space_gap.html
new file mode 100644
index 000000000..62e129e51
--- /dev/null
+++ b/test_fixtures/grid_align_content_space_around_negative_space_gap.html
@@ -0,0 +1,27 @@
+<!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 id="test-root" style="display: grid; width: 240px; height: 240px; border-width: 60px;">
+ <div id="test-root" style="height: 120px; width: 120px; display: grid; grid-template-columns: 20px 20px 20px; grid-template-rows: 40px 40px 40px; justify-content: center; align-content: space-around; gap: 10px;">
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/grid_align_content_space_between_negative_space_gap.html b/test_fixtures/grid_align_content_space_between_negative_space_gap.html
new file mode 100644
index 000000000..89b9e4c03
--- /dev/null
+++ b/test_fixtures/grid_align_content_space_between_negative_space_gap.html
@@ -0,0 +1,27 @@
+<!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 id="test-root" style="display: grid; width: 240px; height: 240px; border-width: 60px;">
+ <div id="test-root" style="height: 120px; width: 120px; display: grid; grid-template-columns: 20px 20px 20px; grid-template-rows: 40px 40px 40px; justify-content: center; align-content: space-between; gap: 10px;">
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/grid_align_content_space_evenly_negative_space_gap.html b/test_fixtures/grid_align_content_space_evenly_negative_space_gap.html
new file mode 100644
index 000000000..89b9e4c03
--- /dev/null
+++ b/test_fixtures/grid_align_content_space_evenly_negative_space_gap.html
@@ -0,0 +1,27 @@
+<!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 id="test-root" style="display: grid; width: 240px; height: 240px; border-width: 60px;">
+ <div id="test-root" style="height: 120px; width: 120px; display: grid; grid-template-columns: 20px 20px 20px; grid-template-rows: 40px 40px 40px; justify-content: center; align-content: space-between; gap: 10px;">
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/grid_align_content_start_negative_space_gap.html b/test_fixtures/grid_align_content_start_negative_space_gap.html
new file mode 100644
index 000000000..f70e0e6ff
--- /dev/null
+++ b/test_fixtures/grid_align_content_start_negative_space_gap.html
@@ -0,0 +1,27 @@
+<!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 id="test-root" style="display: grid; width: 240px; height: 240px; border-width: 60px;">
+ <div id="test-root" style="height: 120px; width: 120px; display: grid; grid-template-columns: 20px 20px 20px; grid-template-rows: 40px 40px 40px; justify-content: center; align-content: start; gap: 10px;">
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/grid_justify_content_center_negative_space_gap.html b/test_fixtures/grid_justify_content_center_negative_space_gap.html
new file mode 100644
index 000000000..8b26a40b3
--- /dev/null
+++ b/test_fixtures/grid_justify_content_center_negative_space_gap.html
@@ -0,0 +1,27 @@
+<!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 id="test-root" style="display: grid; width: 240px; height: 240px; border-width: 60px;">
+ <div id="test-root" style="height: 120px; width: 120px; display: grid; grid-template-columns: 40px 40px 40px; grid-template-rows: 20px 20px 20px; justify-content: center; align-content: center; gap: 10px;">
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/grid_justify_content_end_negative_space_gap.html b/test_fixtures/grid_justify_content_end_negative_space_gap.html
new file mode 100644
index 000000000..40a16c44d
--- /dev/null
+++ b/test_fixtures/grid_justify_content_end_negative_space_gap.html
@@ -0,0 +1,27 @@
+<!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 id="test-root" style="display: grid; width: 240px; height: 240px; border-width: 60px;">
+ <div id="test-root" style="height: 120px; width: 120px; display: grid; grid-template-columns: 40px 40px 40px; grid-template-rows: 20px 20px 20px; justify-content: end; align-content: center; gap: 10px;">
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/grid_justify_content_space_around_negative_space_gap.html b/test_fixtures/grid_justify_content_space_around_negative_space_gap.html
new file mode 100644
index 000000000..1357e66cb
--- /dev/null
+++ b/test_fixtures/grid_justify_content_space_around_negative_space_gap.html
@@ -0,0 +1,27 @@
+<!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 id="test-root" style="display: grid; width: 240px; height: 240px; border-width: 60px;">
+ <div id="test-root" style="height: 120px; width: 120px; display: grid; grid-template-columns: 40px 40px 40px; grid-template-rows: 20px 20px 20px; justify-content: space-around; align-content: center; gap: 10px;">
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/grid_justify_content_space_between_negative_space_gap.html b/test_fixtures/grid_justify_content_space_between_negative_space_gap.html
new file mode 100644
index 000000000..953f5fc45
--- /dev/null
+++ b/test_fixtures/grid_justify_content_space_between_negative_space_gap.html
@@ -0,0 +1,27 @@
+<!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 id="test-root" style="display: grid; width: 240px; height: 240px; border-width: 60px;">
+ <div id="test-root" style="height: 120px; width: 120px; display: grid; grid-template-columns: 40px 40px 40px; grid-template-rows: 20px 20px 20px; justify-content: space-between; align-content: center; gap: 10px;">
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/grid_justify_content_space_evenly_negative_space_gap.html b/test_fixtures/grid_justify_content_space_evenly_negative_space_gap.html
new file mode 100644
index 000000000..c4881287b
--- /dev/null
+++ b/test_fixtures/grid_justify_content_space_evenly_negative_space_gap.html
@@ -0,0 +1,27 @@
+<!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 id="test-root" style="display: grid; width: 240px; height: 240px; border-width: 60px;">
+ <div id="test-root" style="height: 120px; width: 120px; display: grid; grid-template-columns: 40px 40px 40px; grid-template-rows: 20px 20px 20px; justify-content: space-evenly; align-content: center; gap: 10px;">
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/grid_justify_content_start_negative_space_gap.html b/test_fixtures/grid_justify_content_start_negative_space_gap.html
new file mode 100644
index 000000000..4055cf5be
--- /dev/null
+++ b/test_fixtures/grid_justify_content_start_negative_space_gap.html
@@ -0,0 +1,27 @@
+<!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 id="test-root" style="display: grid; width: 240px; height: 240px; border-width: 60px;">
+ <div id="test-root" style="height: 120px; width: 120px; display: grid; grid-template-columns: 40px 40px 40px; grid-template-rows: 20px 20px 20px; justify-content: start; align-content: center; gap: 10px;">
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/justify_content_column_center_negative_space.html b/test_fixtures/justify_content_column_center_negative_space.html
new file mode 100644
index 000000000..a16d7e4cc
--- /dev/null
+++ b/test_fixtures/justify_content_column_center_negative_space.html
@@ -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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: column; justify-content: center; align-items: center; height: 10px;">
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/justify_content_column_center_negative_space_gap.html b/test_fixtures/justify_content_column_center_negative_space_gap.html
new file mode 100644
index 000000000..e07a6587f
--- /dev/null
+++ b/test_fixtures/justify_content_column_center_negative_space_gap.html
@@ -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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: column; justify-content: center; align-items: center; height: 10px; gap: 10px;">
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/justify_content_column_end.html b/test_fixtures/justify_content_column_end.html
new file mode 100644
index 000000000..caaaf46b4
--- /dev/null
+++ b/test_fixtures/justify_content_column_end.html
@@ -0,0 +1,19 @@
+<!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 id="test-root" style="width: 100px; height: 100px; justify-content: flex-end; flex-direction: column;">
+ <div style="height: 10px;"></div>
+ <div style="height: 10px;"></div>
+ <div style="height: 10px;"></div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/justify_content_column_end_negative_space.html b/test_fixtures/justify_content_column_end_negative_space.html
new file mode 100644
index 000000000..fc9b3774d
--- /dev/null
+++ b/test_fixtures/justify_content_column_end_negative_space.html
@@ -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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: column; justify-content: end; align-items: center; height: 10px;">
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/justify_content_column_end_negative_space_gap.html b/test_fixtures/justify_content_column_end_negative_space_gap.html
new file mode 100644
index 000000000..25c3a3482
--- /dev/null
+++ b/test_fixtures/justify_content_column_end_negative_space_gap.html
@@ -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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: column; justify-content: end; align-items: center; height: 10px; gap: 10px;">
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/justify_content_column_end_reverse.html b/test_fixtures/justify_content_column_end_reverse.html
new file mode 100644
index 000000000..caaaf46b4
--- /dev/null
+++ b/test_fixtures/justify_content_column_end_reverse.html
@@ -0,0 +1,19 @@
+<!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 id="test-root" style="width: 100px; height: 100px; justify-content: flex-end; flex-direction: column;">
+ <div style="height: 10px;"></div>
+ <div style="height: 10px;"></div>
+ <div style="height: 10px;"></div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/justify_content_column_flex_end_reverse.html b/test_fixtures/justify_content_column_flex_end_reverse.html
new file mode 100644
index 000000000..982a31b50
--- /dev/null
+++ b/test_fixtures/justify_content_column_flex_end_reverse.html
@@ -0,0 +1,19 @@
+<!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 id="test-root" style="width: 100px; height: 100px; justify-content: flex-end; flex-direction: column-reverse;">
+ <div style="height: 10px;"></div>
+ <div style="height: 10px;"></div>
+ <div style="height: 10px;"></div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/justify_content_column_flex_start_reverse.html b/test_fixtures/justify_content_column_flex_start_reverse.html
new file mode 100644
index 000000000..3991638a9
--- /dev/null
+++ b/test_fixtures/justify_content_column_flex_start_reverse.html
@@ -0,0 +1,19 @@
+<!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 id="test-root" style="width: 100px; height: 100px; justify-content: flex-start; flex-direction: column-reverse;">
+ <div style="height: 10px;"></div>
+ <div style="height: 10px;"></div>
+ <div style="height: 10px;"></div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/justify_content_column_space_around_negative_space.html b/test_fixtures/justify_content_column_space_around_negative_space.html
new file mode 100644
index 000000000..f3976b458
--- /dev/null
+++ b/test_fixtures/justify_content_column_space_around_negative_space.html
@@ -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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: column; justify-content: space-around; align-items: center; height: 10px;">
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/justify_content_column_space_around_negative_space_gap.html b/test_fixtures/justify_content_column_space_around_negative_space_gap.html
new file mode 100644
index 000000000..949b3b571
--- /dev/null
+++ b/test_fixtures/justify_content_column_space_around_negative_space_gap.html
@@ -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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: column; justify-content: space-around; align-items: center; height: 10px; gap: 10px;">
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/justify_content_column_space_between_negative_space.html b/test_fixtures/justify_content_column_space_between_negative_space.html
new file mode 100644
index 000000000..a77d6d55f
--- /dev/null
+++ b/test_fixtures/justify_content_column_space_between_negative_space.html
@@ -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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: column; justify-content: space-between; align-items: center; height: 10px;">
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/justify_content_column_space_between_negative_space_gap.html b/test_fixtures/justify_content_column_space_between_negative_space_gap.html
new file mode 100644
index 000000000..03d11052b
--- /dev/null
+++ b/test_fixtures/justify_content_column_space_between_negative_space_gap.html
@@ -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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: column; justify-content: space-between; align-items: center; height: 10px; gap: 10px;">
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/justify_content_column_space_evenly_negative_space.html b/test_fixtures/justify_content_column_space_evenly_negative_space.html
new file mode 100644
index 000000000..1a723893f
--- /dev/null
+++ b/test_fixtures/justify_content_column_space_evenly_negative_space.html
@@ -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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: column; justify-content: space-evenly; align-items: center; height: 10px;">
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/justify_content_column_space_evenly_negative_space_gap.html b/test_fixtures/justify_content_column_space_evenly_negative_space_gap.html
new file mode 100644
index 000000000..fcc152d77
--- /dev/null
+++ b/test_fixtures/justify_content_column_space_evenly_negative_space_gap.html
@@ -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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: column; justify-content: space-evenly; align-items: center; height: 10px; gap: 10px;">
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/justify_content_column_start.html b/test_fixtures/justify_content_column_start.html
new file mode 100644
index 000000000..bc2e907f8
--- /dev/null
+++ b/test_fixtures/justify_content_column_start.html
@@ -0,0 +1,19 @@
+<!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 id="test-root" style="width: 100px; height: 100px; justify-content: start; flex-direction: column;">
+ <div style="height: 10px;"></div>
+ <div style="height: 10px;"></div>
+ <div style="height: 10px;"></div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/justify_content_column_start_negative_space.html b/test_fixtures/justify_content_column_start_negative_space.html
new file mode 100644
index 000000000..f70a15231
--- /dev/null
+++ b/test_fixtures/justify_content_column_start_negative_space.html
@@ -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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: column; justify-content: start; align-items: center; height: 10px;">
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/justify_content_column_start_negative_space_gap.html b/test_fixtures/justify_content_column_start_negative_space_gap.html
new file mode 100644
index 000000000..a716cd964
--- /dev/null
+++ b/test_fixtures/justify_content_column_start_negative_space_gap.html
@@ -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 id="test-root" style="display: flex; flex-direction: column; width: 320px; height: 320px; border-width: 60px;">
+ <div style="display: flex; flex-direction: column; justify-content: start; align-items: center; height: 10px; gap: 10px;">
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ <div style="width: 80%; height: 20px; flex-shrink: 0;"></div>
+ </div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/test_fixtures/justify_content_column_start_reverse.html b/test_fixtures/justify_content_column_start_reverse.html
new file mode 100644
index 000000000..f08c89705
--- /dev/null
+++ b/test_fixtures/justify_content_column_start_reverse.html
@@ -0,0 +1,19 @@
+<!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 id="test-root" style="width: 100px; height: 100px; justify-content: start; flex-direction: column-reverse;">
+ <div style="height: 10px;"></div>
+ <div style="height: 10px;"></div>
+ <div style="height: 10px;"></div>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/tests/generated/align_content_center_single_line.rs b/tests/generated/align_content_center_single_line.rs
new file mode 100644
index 000000000..e90617aca
--- /dev/null
+++ b/tests/generated/align_content_center_single_line.rs
@@ -0,0 +1,113 @@
+#[test]
+fn align_content_center_single_line() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node1 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node2 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node3 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node4 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node5 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ align_content: Some(taffy::style::AlignContent::Center),
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(120f32),
+ height: taffy::style::Dimension::Points(100f32),
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2, node3, node4, node5],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 120f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 120f32, size.width);
+ assert_eq!(size.height, 100f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 100f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 20f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node1).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node1.data(), 20f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node1.data(), 10f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node1.data(), 20f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node1.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node2).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node2.data(), 20f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node2.data(), 10f32, size.height);
+ assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node2.data(), 40f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node2.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node3).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node3.data(), 20f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node3.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node3.data(), 60f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node3.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node4).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node4.data(), 20f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node4.data(), 10f32, size.height);
+ assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node4.data(), 80f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node4.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node5).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node5.data(), 20f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node5.data(), 10f32, size.height);
+ assert_eq!(location.x, 100f32, "x of node {:?}. Expected {}. Actual {}", node5.data(), 100f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node5.data(), 0f32, location.y);
+}
diff --git a/tests/generated/align_content_center_single_line_negative_space.rs b/tests/generated/align_content_center_single_line_negative_space.rs
new file mode 100644
index 000000000..0e8efbc43
--- /dev/null
+++ b/tests/generated/align_content_center_single_line_negative_space.rs
@@ -0,0 +1,68 @@
+#[test]
+fn align_content_center_single_line_negative_space() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(60f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ align_content: Some(taffy::style::AlignContent::Center),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 60f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 0f32, location.y);
+}
diff --git a/tests/generated/align_content_center_single_line_negative_space_gap.rs b/tests/generated/align_content_center_single_line_negative_space_gap.rs
new file mode 100644
index 000000000..13be47a44
--- /dev/null
+++ b/tests/generated/align_content_center_single_line_negative_space_gap.rs
@@ -0,0 +1,72 @@
+#[test]
+fn align_content_center_single_line_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(60f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ align_content: Some(taffy::style::AlignContent::Center),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 60f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 0f32, location.y);
+}
diff --git a/tests/generated/align_content_center_wrapped.rs b/tests/generated/align_content_center_wrapped.rs
new file mode 100644
index 000000000..f60faf0c7
--- /dev/null
+++ b/tests/generated/align_content_center_wrapped.rs
@@ -0,0 +1,114 @@
+#[test]
+fn align_content_center_wrapped() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node1 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node2 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node3 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node4 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node5 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ flex_wrap: taffy::style::FlexWrap::Wrap,
+ align_content: Some(taffy::style::AlignContent::Center),
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(120f32),
+ height: taffy::style::Dimension::Points(100f32),
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2, node3, node4, node5],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 120f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 120f32, size.width);
+ assert_eq!(size.height, 100f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 100f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 50f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 50f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 0f32, location.x);
+ assert_eq!(location.y, 35f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 35f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node1).unwrap();
+ assert_eq!(size.width, 50f32, "width of node {:?}. Expected {}. Actual {}", node1.data(), 50f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node1.data(), 10f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node1.data(), 50f32, location.x);
+ assert_eq!(location.y, 35f32, "y of node {:?}. Expected {}. Actual {}", node1.data(), 35f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node2).unwrap();
+ assert_eq!(size.width, 50f32, "width of node {:?}. Expected {}. Actual {}", node2.data(), 50f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node2.data(), 10f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node2.data(), 0f32, location.x);
+ assert_eq!(location.y, 45f32, "y of node {:?}. Expected {}. Actual {}", node2.data(), 45f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node3).unwrap();
+ assert_eq!(size.width, 50f32, "width of node {:?}. Expected {}. Actual {}", node3.data(), 50f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node3.data(), 10f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node3.data(), 50f32, location.x);
+ assert_eq!(location.y, 45f32, "y of node {:?}. Expected {}. Actual {}", node3.data(), 45f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node4).unwrap();
+ assert_eq!(size.width, 50f32, "width of node {:?}. Expected {}. Actual {}", node4.data(), 50f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node4.data(), 10f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node4.data(), 0f32, location.x);
+ assert_eq!(location.y, 55f32, "y of node {:?}. Expected {}. Actual {}", node4.data(), 55f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node5).unwrap();
+ assert_eq!(size.width, 50f32, "width of node {:?}. Expected {}. Actual {}", node5.data(), 50f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node5.data(), 10f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node5.data(), 50f32, location.x);
+ assert_eq!(location.y, 55f32, "y of node {:?}. Expected {}. Actual {}", node5.data(), 55f32, location.y);
+}
diff --git a/tests/generated/align_content_center_wrapped_negative_space.rs b/tests/generated/align_content_center_wrapped_negative_space.rs
new file mode 100644
index 000000000..6494d9ce2
--- /dev/null
+++ b/tests/generated/align_content_center_wrapped_negative_space.rs
@@ -0,0 +1,99 @@
+#[test]
+fn align_content_center_wrapped_negative_space() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node01 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node02 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_wrap: taffy::style::FlexWrap::Wrap,
+ align_content: Some(taffy::style::AlignContent::Center),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00, node01, node02],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, -25f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), -25f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.x);
+ assert_eq!(location.y, -5f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), -5f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.x);
+ assert_eq!(location.y, 15f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 15f32, location.y);
+}
diff --git a/tests/generated/align_content_center_wrapped_negative_space_gap.rs b/tests/generated/align_content_center_wrapped_negative_space_gap.rs
new file mode 100644
index 000000000..748e91fb3
--- /dev/null
+++ b/tests/generated/align_content_center_wrapped_negative_space_gap.rs
@@ -0,0 +1,103 @@
+#[test]
+fn align_content_center_wrapped_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node01 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node02 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_wrap: taffy::style::FlexWrap::Wrap,
+ align_content: Some(taffy::style::AlignContent::Center),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00, node01, node02],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, -35f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), -35f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.x);
+ assert_eq!(location.y, -5f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), -5f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.x);
+ assert_eq!(location.y, 25f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 25f32, location.y);
+}
diff --git a/tests/generated/align_content_end.rs b/tests/generated/align_content_end.rs
new file mode 100644
index 000000000..578169e0f
--- /dev/null
+++ b/tests/generated/align_content_end.rs
@@ -0,0 +1,101 @@
+#[test]
+fn align_content_end() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node1 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node2 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node3 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node4 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ flex_direction: taffy::style::FlexDirection::Column,
+ flex_wrap: taffy::style::FlexWrap::Wrap,
+ align_content: Some(taffy::style::AlignContent::End),
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(100f32),
+ height: taffy::style::Dimension::Points(100f32),
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2, node3, node4],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 100f32, size.width);
+ assert_eq!(size.height, 100f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 100f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 50f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 50f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 50f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node1).unwrap();
+ assert_eq!(size.width, 50f32, "width of node {:?}. Expected {}. Actual {}", node1.data(), 50f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node1.data(), 10f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node1.data(), 50f32, location.x);
+ assert_eq!(location.y, 10f32, "y of node {:?}. Expected {}. Actual {}", node1.data(), 10f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node2).unwrap();
+ assert_eq!(size.width, 50f32, "width of node {:?}. Expected {}. Actual {}", node2.data(), 50f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node2.data(), 10f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node2.data(), 50f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node2.data(), 20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node3).unwrap();
+ assert_eq!(size.width, 50f32, "width of node {:?}. Expected {}. Actual {}", node3.data(), 50f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node3.data(), 10f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node3.data(), 50f32, location.x);
+ assert_eq!(location.y, 30f32, "y of node {:?}. Expected {}. Actual {}", node3.data(), 30f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node4).unwrap();
+ assert_eq!(size.width, 50f32, "width of node {:?}. Expected {}. Actual {}", node4.data(), 50f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node4.data(), 10f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node4.data(), 50f32, location.x);
+ assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node4.data(), 40f32, location.y);
+}
diff --git a/tests/generated/align_content_end_single_line_negative_space.rs b/tests/generated/align_content_end_single_line_negative_space.rs
new file mode 100644
index 000000000..a1ec34782
--- /dev/null
+++ b/tests/generated/align_content_end_single_line_negative_space.rs
@@ -0,0 +1,68 @@
+#[test]
+fn align_content_end_single_line_negative_space() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(60f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ align_content: Some(taffy::style::AlignContent::End),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 60f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 0f32, location.y);
+}
diff --git a/tests/generated/align_content_end_single_line_negative_space_gap.rs b/tests/generated/align_content_end_single_line_negative_space_gap.rs
new file mode 100644
index 000000000..b542c3e51
--- /dev/null
+++ b/tests/generated/align_content_end_single_line_negative_space_gap.rs
@@ -0,0 +1,72 @@
+#[test]
+fn align_content_end_single_line_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(60f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ align_content: Some(taffy::style::AlignContent::End),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 60f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 0f32, location.y);
+}
diff --git a/tests/generated/align_content_end_wrapped_negative_space.rs b/tests/generated/align_content_end_wrapped_negative_space.rs
new file mode 100644
index 000000000..91d064e96
--- /dev/null
+++ b/tests/generated/align_content_end_wrapped_negative_space.rs
@@ -0,0 +1,99 @@
+#[test]
+fn align_content_end_wrapped_negative_space() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node01 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node02 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_wrap: taffy::style::FlexWrap::Wrap,
+ align_content: Some(taffy::style::AlignContent::End),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00, node01, node02],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, -50f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), -50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.x);
+ assert_eq!(location.y, -30f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), -30f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.x);
+ assert_eq!(location.y, -10f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), -10f32, location.y);
+}
diff --git a/tests/generated/align_content_end_wrapped_negative_space_gap.rs b/tests/generated/align_content_end_wrapped_negative_space_gap.rs
new file mode 100644
index 000000000..feeadaef1
--- /dev/null
+++ b/tests/generated/align_content_end_wrapped_negative_space_gap.rs
@@ -0,0 +1,103 @@
+#[test]
+fn align_content_end_wrapped_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node01 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node02 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_wrap: taffy::style::FlexWrap::Wrap,
+ align_content: Some(taffy::style::AlignContent::End),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00, node01, node02],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, -70f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), -70f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.x);
+ assert_eq!(location.y, -40f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), -40f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.x);
+ assert_eq!(location.y, -10f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), -10f32, location.y);
+}
diff --git a/tests/generated/align_content_space_around_single_line_negative_space.rs b/tests/generated/align_content_space_around_single_line_negative_space.rs
new file mode 100644
index 000000000..d6c1d52ae
--- /dev/null
+++ b/tests/generated/align_content_space_around_single_line_negative_space.rs
@@ -0,0 +1,68 @@
+#[test]
+fn align_content_space_around_single_line_negative_space() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(60f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ align_content: Some(taffy::style::AlignContent::SpaceAround),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 60f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 0f32, location.y);
+}
diff --git a/tests/generated/align_content_space_around_single_line_negative_space_gap.rs b/tests/generated/align_content_space_around_single_line_negative_space_gap.rs
new file mode 100644
index 000000000..c534f67bd
--- /dev/null
+++ b/tests/generated/align_content_space_around_single_line_negative_space_gap.rs
@@ -0,0 +1,72 @@
+#[test]
+fn align_content_space_around_single_line_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(60f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ align_content: Some(taffy::style::AlignContent::SpaceAround),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 60f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 0f32, location.y);
+}
diff --git a/tests/generated/align_content_space_around_wrapped_negative_space.rs b/tests/generated/align_content_space_around_wrapped_negative_space.rs
new file mode 100644
index 000000000..452a8d7e4
--- /dev/null
+++ b/tests/generated/align_content_space_around_wrapped_negative_space.rs
@@ -0,0 +1,99 @@
+#[test]
+fn align_content_space_around_wrapped_negative_space() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node01 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node02 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_wrap: taffy::style::FlexWrap::Wrap,
+ align_content: Some(taffy::style::AlignContent::SpaceAround),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00, node01, node02],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, -25f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), -25f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.x);
+ assert_eq!(location.y, -5f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), -5f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.x);
+ assert_eq!(location.y, 15f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 15f32, location.y);
+}
diff --git a/tests/generated/align_content_space_around_wrapped_negative_space_gap.rs b/tests/generated/align_content_space_around_wrapped_negative_space_gap.rs
new file mode 100644
index 000000000..a6bd52656
--- /dev/null
+++ b/tests/generated/align_content_space_around_wrapped_negative_space_gap.rs
@@ -0,0 +1,103 @@
+#[test]
+fn align_content_space_around_wrapped_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node01 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node02 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_wrap: taffy::style::FlexWrap::Wrap,
+ align_content: Some(taffy::style::AlignContent::SpaceAround),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00, node01, node02],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, -35f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), -35f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.x);
+ assert_eq!(location.y, -5f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), -5f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.x);
+ assert_eq!(location.y, 25f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 25f32, location.y);
+}
diff --git a/tests/generated/align_content_space_between_single_line_negative_space.rs b/tests/generated/align_content_space_between_single_line_negative_space.rs
new file mode 100644
index 000000000..fad86f1f2
--- /dev/null
+++ b/tests/generated/align_content_space_between_single_line_negative_space.rs
@@ -0,0 +1,68 @@
+#[test]
+fn align_content_space_between_single_line_negative_space() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(60f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ align_content: Some(taffy::style::AlignContent::SpaceBetween),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 60f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 0f32, location.y);
+}
diff --git a/tests/generated/align_content_space_between_single_line_negative_space_gap.rs b/tests/generated/align_content_space_between_single_line_negative_space_gap.rs
new file mode 100644
index 000000000..8bc9382ab
--- /dev/null
+++ b/tests/generated/align_content_space_between_single_line_negative_space_gap.rs
@@ -0,0 +1,72 @@
+#[test]
+fn align_content_space_between_single_line_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(60f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ align_content: Some(taffy::style::AlignContent::SpaceBetween),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 60f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 0f32, location.y);
+}
diff --git a/tests/generated/align_content_space_between_wrapped_negative_space.rs b/tests/generated/align_content_space_between_wrapped_negative_space.rs
new file mode 100644
index 000000000..2d12dfd0e
--- /dev/null
+++ b/tests/generated/align_content_space_between_wrapped_negative_space.rs
@@ -0,0 +1,99 @@
+#[test]
+fn align_content_space_between_wrapped_negative_space() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node01 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node02 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_wrap: taffy::style::FlexWrap::Wrap,
+ align_content: Some(taffy::style::AlignContent::SpaceBetween),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00, node01, node02],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.x);
+ assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 40f32, location.y);
+}
diff --git a/tests/generated/align_content_space_between_wrapped_negative_space_gap.rs b/tests/generated/align_content_space_between_wrapped_negative_space_gap.rs
new file mode 100644
index 000000000..47e346781
--- /dev/null
+++ b/tests/generated/align_content_space_between_wrapped_negative_space_gap.rs
@@ -0,0 +1,103 @@
+#[test]
+fn align_content_space_between_wrapped_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node01 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node02 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_wrap: taffy::style::FlexWrap::Wrap,
+ align_content: Some(taffy::style::AlignContent::SpaceBetween),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00, node01, node02],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.x);
+ assert_eq!(location.y, 30f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), 30f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 60f32, location.y);
+}
diff --git a/tests/generated/align_content_space_evenly_single_line_negative_space.rs b/tests/generated/align_content_space_evenly_single_line_negative_space.rs
new file mode 100644
index 000000000..3a95089b8
--- /dev/null
+++ b/tests/generated/align_content_space_evenly_single_line_negative_space.rs
@@ -0,0 +1,68 @@
+#[test]
+fn align_content_space_evenly_single_line_negative_space() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(60f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ align_content: Some(taffy::style::AlignContent::SpaceEvenly),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 60f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 0f32, location.y);
+}
diff --git a/tests/generated/align_content_space_evenly_single_line_negative_space_gap.rs b/tests/generated/align_content_space_evenly_single_line_negative_space_gap.rs
new file mode 100644
index 000000000..69fff3c65
--- /dev/null
+++ b/tests/generated/align_content_space_evenly_single_line_negative_space_gap.rs
@@ -0,0 +1,72 @@
+#[test]
+fn align_content_space_evenly_single_line_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(60f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ align_content: Some(taffy::style::AlignContent::SpaceEvenly),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 60f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 0f32, location.y);
+}
diff --git a/tests/generated/align_content_space_evenly_wrapped_negative_space.rs b/tests/generated/align_content_space_evenly_wrapped_negative_space.rs
new file mode 100644
index 000000000..31a739ff7
--- /dev/null
+++ b/tests/generated/align_content_space_evenly_wrapped_negative_space.rs
@@ -0,0 +1,99 @@
+#[test]
+fn align_content_space_evenly_wrapped_negative_space() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node01 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node02 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_wrap: taffy::style::FlexWrap::Wrap,
+ align_content: Some(taffy::style::AlignContent::SpaceEvenly),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00, node01, node02],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, -25f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), -25f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.x);
+ assert_eq!(location.y, -5f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), -5f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.x);
+ assert_eq!(location.y, 15f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 15f32, location.y);
+}
diff --git a/tests/generated/align_content_space_evenly_wrapped_negative_space_gap.rs b/tests/generated/align_content_space_evenly_wrapped_negative_space_gap.rs
new file mode 100644
index 000000000..3a9be58f9
--- /dev/null
+++ b/tests/generated/align_content_space_evenly_wrapped_negative_space_gap.rs
@@ -0,0 +1,103 @@
+#[test]
+fn align_content_space_evenly_wrapped_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node01 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node02 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_wrap: taffy::style::FlexWrap::Wrap,
+ align_content: Some(taffy::style::AlignContent::SpaceEvenly),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00, node01, node02],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, -35f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), -35f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.x);
+ assert_eq!(location.y, -5f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), -5f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.x);
+ assert_eq!(location.y, 25f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 25f32, location.y);
+}
diff --git a/tests/generated/align_content_start.rs b/tests/generated/align_content_start.rs
new file mode 100644
index 000000000..4ad63668d
--- /dev/null
+++ b/tests/generated/align_content_start.rs
@@ -0,0 +1,100 @@
+#[test]
+fn align_content_start() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node1 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node2 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node3 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node4 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(50f32),
+ height: taffy::style::Dimension::Points(10f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ flex_wrap: taffy::style::FlexWrap::Wrap,
+ align_content: Some(taffy::style::AlignContent::Start),
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(130f32),
+ height: taffy::style::Dimension::Points(100f32),
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2, node3, node4],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 130f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 130f32, size.width);
+ assert_eq!(size.height, 100f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 100f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 50f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 50f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node1).unwrap();
+ assert_eq!(size.width, 50f32, "width of node {:?}. Expected {}. Actual {}", node1.data(), 50f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node1.data(), 10f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node1.data(), 50f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node1.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node2).unwrap();
+ assert_eq!(size.width, 50f32, "width of node {:?}. Expected {}. Actual {}", node2.data(), 50f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node2.data(), 10f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node2.data(), 0f32, location.x);
+ assert_eq!(location.y, 10f32, "y of node {:?}. Expected {}. Actual {}", node2.data(), 10f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node3).unwrap();
+ assert_eq!(size.width, 50f32, "width of node {:?}. Expected {}. Actual {}", node3.data(), 50f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node3.data(), 10f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node3.data(), 50f32, location.x);
+ assert_eq!(location.y, 10f32, "y of node {:?}. Expected {}. Actual {}", node3.data(), 10f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node4).unwrap();
+ assert_eq!(size.width, 50f32, "width of node {:?}. Expected {}. Actual {}", node4.data(), 50f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node4.data(), 10f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node4.data(), 0f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node4.data(), 20f32, location.y);
+}
diff --git a/tests/generated/align_content_start_single_line_negative_space.rs b/tests/generated/align_content_start_single_line_negative_space.rs
new file mode 100644
index 000000000..5b8c781f3
--- /dev/null
+++ b/tests/generated/align_content_start_single_line_negative_space.rs
@@ -0,0 +1,68 @@
+#[test]
+fn align_content_start_single_line_negative_space() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(60f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ align_content: Some(taffy::style::AlignContent::Start),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 60f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 0f32, location.y);
+}
diff --git a/tests/generated/align_content_start_single_line_negative_space_gap.rs b/tests/generated/align_content_start_single_line_negative_space_gap.rs
new file mode 100644
index 000000000..7c8561023
--- /dev/null
+++ b/tests/generated/align_content_start_single_line_negative_space_gap.rs
@@ -0,0 +1,72 @@
+#[test]
+fn align_content_start_single_line_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(60f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ align_content: Some(taffy::style::AlignContent::Start),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 60f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 60f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 0f32, location.y);
+}
diff --git a/tests/generated/align_content_start_wrapped_negative_space.rs b/tests/generated/align_content_start_wrapped_negative_space.rs
new file mode 100644
index 000000000..24642d646
--- /dev/null
+++ b/tests/generated/align_content_start_wrapped_negative_space.rs
@@ -0,0 +1,99 @@
+#[test]
+fn align_content_start_wrapped_negative_space() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node01 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node02 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_wrap: taffy::style::FlexWrap::Wrap,
+ align_content: Some(taffy::style::AlignContent::Start),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00, node01, node02],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.x);
+ assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 40f32, location.y);
+}
diff --git a/tests/generated/grid_align_content_center_negative_space_gap.rs b/tests/generated/grid_align_content_center_negative_space_gap.rs
new file mode 100644
index 000000000..60706ef92
--- /dev/null
+++ b/tests/generated/grid_align_content_center_negative_space_gap.rs
@@ -0,0 +1,115 @@
+#[test]
+fn grid_align_content_center_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node01 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node02 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node03 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node04 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node05 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node06 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node07 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node08 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Grid,
+ align_content: Some(taffy::style::AlignContent::Center),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ grid_template_rows: vec![points(40f32), points(40f32), points(40f32)],
+ grid_template_columns: vec![points(20f32), points(20f32), points(20f32)],
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(120f32),
+ height: taffy::style::Dimension::Points(120f32),
+ },
+ ..Default::default()
+ },
+ &[node00, node01, node02, node03, node04, node05, node06, node07, node08],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Grid,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(240f32),
+ height: taffy::style::Dimension::Points(240f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 240f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 240f32, size.width);
+ assert_eq!(size.height, 240f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 240f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 120f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 120f32, size.width);
+ assert_eq!(size.height, 120f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 120f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 40f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, -10f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), -10f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 40f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 50f32, location.x);
+ assert_eq!(location.y, -10f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), -10f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 40f32, size.height);
+ assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 80f32, location.x);
+ assert_eq!(location.y, -10f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), -10f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node03).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node03.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node03.data(), 40f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node03.data(), 20f32, location.x);
+ assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node03.data(), 40f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node04).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node04.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node04.data(), 40f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node04.data(), 50f32, location.x);
+ assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node04.data(), 40f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node05).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node05.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node05.data(), 40f32, size.height);
+ assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node05.data(), 80f32, location.x);
+ assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node05.data(), 40f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node06).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node06.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node06.data(), 40f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node06.data(), 20f32, location.x);
+ assert_eq!(location.y, 90f32, "y of node {:?}. Expected {}. Actual {}", node06.data(), 90f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node07).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node07.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node07.data(), 40f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node07.data(), 50f32, location.x);
+ assert_eq!(location.y, 90f32, "y of node {:?}. Expected {}. Actual {}", node07.data(), 90f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node08).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node08.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node08.data(), 40f32, size.height);
+ assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node08.data(), 80f32, location.x);
+ assert_eq!(location.y, 90f32, "y of node {:?}. Expected {}. Actual {}", node08.data(), 90f32, location.y);
+}
diff --git a/tests/generated/grid_align_content_end_negative_space_gap.rs b/tests/generated/grid_align_content_end_negative_space_gap.rs
new file mode 100644
index 000000000..63bf2ca62
--- /dev/null
+++ b/tests/generated/grid_align_content_end_negative_space_gap.rs
@@ -0,0 +1,115 @@
+#[test]
+fn grid_align_content_end_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node01 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node02 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node03 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node04 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node05 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node06 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node07 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node08 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Grid,
+ align_content: Some(taffy::style::AlignContent::End),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ grid_template_rows: vec![points(40f32), points(40f32), points(40f32)],
+ grid_template_columns: vec![points(20f32), points(20f32), points(20f32)],
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(120f32),
+ height: taffy::style::Dimension::Points(120f32),
+ },
+ ..Default::default()
+ },
+ &[node00, node01, node02, node03, node04, node05, node06, node07, node08],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Grid,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(240f32),
+ height: taffy::style::Dimension::Points(240f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 240f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 240f32, size.width);
+ assert_eq!(size.height, 240f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 240f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 120f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 120f32, size.width);
+ assert_eq!(size.height, 120f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 120f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 40f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, -20f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), -20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 40f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 50f32, location.x);
+ assert_eq!(location.y, -20f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), -20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 40f32, size.height);
+ assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 80f32, location.x);
+ assert_eq!(location.y, -20f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), -20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node03).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node03.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node03.data(), 40f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node03.data(), 20f32, location.x);
+ assert_eq!(location.y, 30f32, "y of node {:?}. Expected {}. Actual {}", node03.data(), 30f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node04).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node04.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node04.data(), 40f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node04.data(), 50f32, location.x);
+ assert_eq!(location.y, 30f32, "y of node {:?}. Expected {}. Actual {}", node04.data(), 30f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node05).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node05.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node05.data(), 40f32, size.height);
+ assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node05.data(), 80f32, location.x);
+ assert_eq!(location.y, 30f32, "y of node {:?}. Expected {}. Actual {}", node05.data(), 30f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node06).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node06.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node06.data(), 40f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node06.data(), 20f32, location.x);
+ assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node06.data(), 80f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node07).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node07.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node07.data(), 40f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node07.data(), 50f32, location.x);
+ assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node07.data(), 80f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node08).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node08.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node08.data(), 40f32, size.height);
+ assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node08.data(), 80f32, location.x);
+ assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node08.data(), 80f32, location.y);
+}
diff --git a/tests/generated/grid_align_content_space_around_negative_space_gap.rs b/tests/generated/grid_align_content_space_around_negative_space_gap.rs
new file mode 100644
index 000000000..382e8df1e
--- /dev/null
+++ b/tests/generated/grid_align_content_space_around_negative_space_gap.rs
@@ -0,0 +1,115 @@
+#[test]
+fn grid_align_content_space_around_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node01 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node02 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node03 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node04 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node05 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node06 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node07 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node08 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Grid,
+ align_content: Some(taffy::style::AlignContent::SpaceAround),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ grid_template_rows: vec![points(40f32), points(40f32), points(40f32)],
+ grid_template_columns: vec![points(20f32), points(20f32), points(20f32)],
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(120f32),
+ height: taffy::style::Dimension::Points(120f32),
+ },
+ ..Default::default()
+ },
+ &[node00, node01, node02, node03, node04, node05, node06, node07, node08],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Grid,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(240f32),
+ height: taffy::style::Dimension::Points(240f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 240f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 240f32, size.width);
+ assert_eq!(size.height, 240f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 240f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 120f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 120f32, size.width);
+ assert_eq!(size.height, 120f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 120f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 40f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, -10f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), -10f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 40f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 50f32, location.x);
+ assert_eq!(location.y, -10f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), -10f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 40f32, size.height);
+ assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 80f32, location.x);
+ assert_eq!(location.y, -10f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), -10f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node03).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node03.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node03.data(), 40f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node03.data(), 20f32, location.x);
+ assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node03.data(), 40f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node04).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node04.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node04.data(), 40f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node04.data(), 50f32, location.x);
+ assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node04.data(), 40f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node05).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node05.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node05.data(), 40f32, size.height);
+ assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node05.data(), 80f32, location.x);
+ assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node05.data(), 40f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node06).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node06.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node06.data(), 40f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node06.data(), 20f32, location.x);
+ assert_eq!(location.y, 90f32, "y of node {:?}. Expected {}. Actual {}", node06.data(), 90f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node07).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node07.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node07.data(), 40f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node07.data(), 50f32, location.x);
+ assert_eq!(location.y, 90f32, "y of node {:?}. Expected {}. Actual {}", node07.data(), 90f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node08).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node08.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node08.data(), 40f32, size.height);
+ assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node08.data(), 80f32, location.x);
+ assert_eq!(location.y, 90f32, "y of node {:?}. Expected {}. Actual {}", node08.data(), 90f32, location.y);
+}
diff --git a/tests/generated/grid_align_content_space_between_negative_space_gap.rs b/tests/generated/grid_align_content_space_between_negative_space_gap.rs
new file mode 100644
index 000000000..7e63485d5
--- /dev/null
+++ b/tests/generated/grid_align_content_space_between_negative_space_gap.rs
@@ -0,0 +1,115 @@
+#[test]
+fn grid_align_content_space_between_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node01 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node02 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node03 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node04 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node05 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node06 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node07 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node08 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Grid,
+ align_content: Some(taffy::style::AlignContent::SpaceBetween),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ grid_template_rows: vec![points(40f32), points(40f32), points(40f32)],
+ grid_template_columns: vec![points(20f32), points(20f32), points(20f32)],
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(120f32),
+ height: taffy::style::Dimension::Points(120f32),
+ },
+ ..Default::default()
+ },
+ &[node00, node01, node02, node03, node04, node05, node06, node07, node08],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Grid,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(240f32),
+ height: taffy::style::Dimension::Points(240f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 240f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 240f32, size.width);
+ assert_eq!(size.height, 240f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 240f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 120f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 120f32, size.width);
+ assert_eq!(size.height, 120f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 120f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 40f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 40f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 50f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 40f32, size.height);
+ assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 80f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node03).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node03.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node03.data(), 40f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node03.data(), 20f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node03.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node04).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node04.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node04.data(), 40f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node04.data(), 50f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node04.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node05).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node05.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node05.data(), 40f32, size.height);
+ assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node05.data(), 80f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node05.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node06).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node06.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node06.data(), 40f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node06.data(), 20f32, location.x);
+ assert_eq!(location.y, 100f32, "y of node {:?}. Expected {}. Actual {}", node06.data(), 100f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node07).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node07.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node07.data(), 40f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node07.data(), 50f32, location.x);
+ assert_eq!(location.y, 100f32, "y of node {:?}. Expected {}. Actual {}", node07.data(), 100f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node08).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node08.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node08.data(), 40f32, size.height);
+ assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node08.data(), 80f32, location.x);
+ assert_eq!(location.y, 100f32, "y of node {:?}. Expected {}. Actual {}", node08.data(), 100f32, location.y);
+}
diff --git a/tests/generated/grid_align_content_space_evenly_negative_space_gap.rs b/tests/generated/grid_align_content_space_evenly_negative_space_gap.rs
new file mode 100644
index 000000000..92cf44fb4
--- /dev/null
+++ b/tests/generated/grid_align_content_space_evenly_negative_space_gap.rs
@@ -0,0 +1,115 @@
+#[test]
+fn grid_align_content_space_evenly_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node01 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node02 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node03 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node04 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node05 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node06 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node07 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node08 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Grid,
+ align_content: Some(taffy::style::AlignContent::SpaceBetween),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ grid_template_rows: vec![points(40f32), points(40f32), points(40f32)],
+ grid_template_columns: vec![points(20f32), points(20f32), points(20f32)],
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(120f32),
+ height: taffy::style::Dimension::Points(120f32),
+ },
+ ..Default::default()
+ },
+ &[node00, node01, node02, node03, node04, node05, node06, node07, node08],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Grid,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(240f32),
+ height: taffy::style::Dimension::Points(240f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 240f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 240f32, size.width);
+ assert_eq!(size.height, 240f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 240f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 120f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 120f32, size.width);
+ assert_eq!(size.height, 120f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 120f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 40f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 40f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 50f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 40f32, size.height);
+ assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 80f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node03).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node03.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node03.data(), 40f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node03.data(), 20f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node03.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node04).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node04.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node04.data(), 40f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node04.data(), 50f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node04.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node05).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node05.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node05.data(), 40f32, size.height);
+ assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node05.data(), 80f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node05.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node06).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node06.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node06.data(), 40f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node06.data(), 20f32, location.x);
+ assert_eq!(location.y, 100f32, "y of node {:?}. Expected {}. Actual {}", node06.data(), 100f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node07).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node07.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node07.data(), 40f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node07.data(), 50f32, location.x);
+ assert_eq!(location.y, 100f32, "y of node {:?}. Expected {}. Actual {}", node07.data(), 100f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node08).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node08.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node08.data(), 40f32, size.height);
+ assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node08.data(), 80f32, location.x);
+ assert_eq!(location.y, 100f32, "y of node {:?}. Expected {}. Actual {}", node08.data(), 100f32, location.y);
+}
diff --git a/tests/generated/grid_align_content_start_negative_space_gap.rs b/tests/generated/grid_align_content_start_negative_space_gap.rs
new file mode 100644
index 000000000..42647c840
--- /dev/null
+++ b/tests/generated/grid_align_content_start_negative_space_gap.rs
@@ -0,0 +1,115 @@
+#[test]
+fn grid_align_content_start_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node01 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node02 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node03 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node04 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node05 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node06 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node07 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node08 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Grid,
+ align_content: Some(taffy::style::AlignContent::Start),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ grid_template_rows: vec![points(40f32), points(40f32), points(40f32)],
+ grid_template_columns: vec![points(20f32), points(20f32), points(20f32)],
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(120f32),
+ height: taffy::style::Dimension::Points(120f32),
+ },
+ ..Default::default()
+ },
+ &[node00, node01, node02, node03, node04, node05, node06, node07, node08],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Grid,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(240f32),
+ height: taffy::style::Dimension::Points(240f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 240f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 240f32, size.width);
+ assert_eq!(size.height, 240f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 240f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 120f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 120f32, size.width);
+ assert_eq!(size.height, 120f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 120f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 40f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 40f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 50f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 40f32, size.height);
+ assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 80f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node03).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node03.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node03.data(), 40f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node03.data(), 20f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node03.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node04).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node04.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node04.data(), 40f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node04.data(), 50f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node04.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node05).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node05.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node05.data(), 40f32, size.height);
+ assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node05.data(), 80f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node05.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node06).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node06.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node06.data(), 40f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node06.data(), 20f32, location.x);
+ assert_eq!(location.y, 100f32, "y of node {:?}. Expected {}. Actual {}", node06.data(), 100f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node07).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node07.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node07.data(), 40f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node07.data(), 50f32, location.x);
+ assert_eq!(location.y, 100f32, "y of node {:?}. Expected {}. Actual {}", node07.data(), 100f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node08).unwrap();
+ assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node08.data(), 20f32, size.width);
+ assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node08.data(), 40f32, size.height);
+ assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node08.data(), 80f32, location.x);
+ assert_eq!(location.y, 100f32, "y of node {:?}. Expected {}. Actual {}", node08.data(), 100f32, location.y);
+}
diff --git a/tests/generated/grid_justify_content_center_negative_space_gap.rs b/tests/generated/grid_justify_content_center_negative_space_gap.rs
new file mode 100644
index 000000000..f8ed43765
--- /dev/null
+++ b/tests/generated/grid_justify_content_center_negative_space_gap.rs
@@ -0,0 +1,115 @@
+#[test]
+fn grid_justify_content_center_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node01 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node02 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node03 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node04 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node05 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node06 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node07 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node08 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Grid,
+ align_content: Some(taffy::style::AlignContent::Center),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ grid_template_rows: vec![points(20f32), points(20f32), points(20f32)],
+ grid_template_columns: vec![points(40f32), points(40f32), points(40f32)],
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(120f32),
+ height: taffy::style::Dimension::Points(120f32),
+ },
+ ..Default::default()
+ },
+ &[node00, node01, node02, node03, node04, node05, node06, node07, node08],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Grid,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(240f32),
+ height: taffy::style::Dimension::Points(240f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 240f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 240f32, size.width);
+ assert_eq!(size.height, 240f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 240f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 120f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 120f32, size.width);
+ assert_eq!(size.height, 120f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 120f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, -10f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), -10f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 40f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 90f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 90f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node03).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node03.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node03.data(), 20f32, size.height);
+ assert_eq!(location.x, -10f32, "x of node {:?}. Expected {}. Actual {}", node03.data(), -10f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node03.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node04).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node04.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node04.data(), 20f32, size.height);
+ assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node04.data(), 40f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node04.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node05).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node05.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node05.data(), 20f32, size.height);
+ assert_eq!(location.x, 90f32, "x of node {:?}. Expected {}. Actual {}", node05.data(), 90f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node05.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node06).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node06.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node06.data(), 20f32, size.height);
+ assert_eq!(location.x, -10f32, "x of node {:?}. Expected {}. Actual {}", node06.data(), -10f32, location.x);
+ assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node06.data(), 80f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node07).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node07.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node07.data(), 20f32, size.height);
+ assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node07.data(), 40f32, location.x);
+ assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node07.data(), 80f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node08).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node08.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node08.data(), 20f32, size.height);
+ assert_eq!(location.x, 90f32, "x of node {:?}. Expected {}. Actual {}", node08.data(), 90f32, location.x);
+ assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node08.data(), 80f32, location.y);
+}
diff --git a/tests/generated/grid_justify_content_end_negative_space_gap.rs b/tests/generated/grid_justify_content_end_negative_space_gap.rs
new file mode 100644
index 000000000..9678af25a
--- /dev/null
+++ b/tests/generated/grid_justify_content_end_negative_space_gap.rs
@@ -0,0 +1,115 @@
+#[test]
+fn grid_justify_content_end_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node01 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node02 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node03 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node04 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node05 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node06 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node07 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node08 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Grid,
+ align_content: Some(taffy::style::AlignContent::Center),
+ justify_content: Some(taffy::style::JustifyContent::End),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ grid_template_rows: vec![points(20f32), points(20f32), points(20f32)],
+ grid_template_columns: vec![points(40f32), points(40f32), points(40f32)],
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(120f32),
+ height: taffy::style::Dimension::Points(120f32),
+ },
+ ..Default::default()
+ },
+ &[node00, node01, node02, node03, node04, node05, node06, node07, node08],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Grid,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(240f32),
+ height: taffy::style::Dimension::Points(240f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 240f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 240f32, size.width);
+ assert_eq!(size.height, 240f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 240f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 120f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 120f32, size.width);
+ assert_eq!(size.height, 120f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 120f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, -20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), -20f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 30f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 30f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 80f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node03).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node03.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node03.data(), 20f32, size.height);
+ assert_eq!(location.x, -20f32, "x of node {:?}. Expected {}. Actual {}", node03.data(), -20f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node03.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node04).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node04.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node04.data(), 20f32, size.height);
+ assert_eq!(location.x, 30f32, "x of node {:?}. Expected {}. Actual {}", node04.data(), 30f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node04.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node05).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node05.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node05.data(), 20f32, size.height);
+ assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node05.data(), 80f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node05.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node06).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node06.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node06.data(), 20f32, size.height);
+ assert_eq!(location.x, -20f32, "x of node {:?}. Expected {}. Actual {}", node06.data(), -20f32, location.x);
+ assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node06.data(), 80f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node07).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node07.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node07.data(), 20f32, size.height);
+ assert_eq!(location.x, 30f32, "x of node {:?}. Expected {}. Actual {}", node07.data(), 30f32, location.x);
+ assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node07.data(), 80f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node08).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node08.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node08.data(), 20f32, size.height);
+ assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node08.data(), 80f32, location.x);
+ assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node08.data(), 80f32, location.y);
+}
diff --git a/tests/generated/grid_justify_content_space_around_negative_space_gap.rs b/tests/generated/grid_justify_content_space_around_negative_space_gap.rs
new file mode 100644
index 000000000..868c35dd8
--- /dev/null
+++ b/tests/generated/grid_justify_content_space_around_negative_space_gap.rs
@@ -0,0 +1,115 @@
+#[test]
+fn grid_justify_content_space_around_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node01 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node02 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node03 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node04 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node05 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node06 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node07 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node08 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Grid,
+ align_content: Some(taffy::style::AlignContent::Center),
+ justify_content: Some(taffy::style::JustifyContent::SpaceAround),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ grid_template_rows: vec![points(20f32), points(20f32), points(20f32)],
+ grid_template_columns: vec![points(40f32), points(40f32), points(40f32)],
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(120f32),
+ height: taffy::style::Dimension::Points(120f32),
+ },
+ ..Default::default()
+ },
+ &[node00, node01, node02, node03, node04, node05, node06, node07, node08],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Grid,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(240f32),
+ height: taffy::style::Dimension::Points(240f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 240f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 240f32, size.width);
+ assert_eq!(size.height, 240f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 240f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 120f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 120f32, size.width);
+ assert_eq!(size.height, 120f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 120f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, -10f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), -10f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 40f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 90f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 90f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node03).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node03.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node03.data(), 20f32, size.height);
+ assert_eq!(location.x, -10f32, "x of node {:?}. Expected {}. Actual {}", node03.data(), -10f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node03.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node04).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node04.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node04.data(), 20f32, size.height);
+ assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node04.data(), 40f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node04.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node05).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node05.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node05.data(), 20f32, size.height);
+ assert_eq!(location.x, 90f32, "x of node {:?}. Expected {}. Actual {}", node05.data(), 90f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node05.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node06).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node06.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node06.data(), 20f32, size.height);
+ assert_eq!(location.x, -10f32, "x of node {:?}. Expected {}. Actual {}", node06.data(), -10f32, location.x);
+ assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node06.data(), 80f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node07).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node07.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node07.data(), 20f32, size.height);
+ assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node07.data(), 40f32, location.x);
+ assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node07.data(), 80f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node08).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node08.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node08.data(), 20f32, size.height);
+ assert_eq!(location.x, 90f32, "x of node {:?}. Expected {}. Actual {}", node08.data(), 90f32, location.x);
+ assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node08.data(), 80f32, location.y);
+}
diff --git a/tests/generated/grid_justify_content_space_between_negative_space_gap.rs b/tests/generated/grid_justify_content_space_between_negative_space_gap.rs
new file mode 100644
index 000000000..0f8147f7f
--- /dev/null
+++ b/tests/generated/grid_justify_content_space_between_negative_space_gap.rs
@@ -0,0 +1,115 @@
+#[test]
+fn grid_justify_content_space_between_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node01 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node02 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node03 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node04 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node05 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node06 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node07 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node08 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Grid,
+ align_content: Some(taffy::style::AlignContent::Center),
+ justify_content: Some(taffy::style::JustifyContent::SpaceBetween),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ grid_template_rows: vec![points(20f32), points(20f32), points(20f32)],
+ grid_template_columns: vec![points(40f32), points(40f32), points(40f32)],
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(120f32),
+ height: taffy::style::Dimension::Points(120f32),
+ },
+ ..Default::default()
+ },
+ &[node00, node01, node02, node03, node04, node05, node06, node07, node08],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Grid,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(240f32),
+ height: taffy::style::Dimension::Points(240f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 240f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 240f32, size.width);
+ assert_eq!(size.height, 240f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 240f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 120f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 120f32, size.width);
+ assert_eq!(size.height, 120f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 120f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 0f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 50f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 100f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 100f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node03).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node03.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node03.data(), 20f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node03.data(), 0f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node03.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node04).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node04.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node04.data(), 20f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node04.data(), 50f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node04.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node05).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node05.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node05.data(), 20f32, size.height);
+ assert_eq!(location.x, 100f32, "x of node {:?}. Expected {}. Actual {}", node05.data(), 100f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node05.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node06).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node06.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node06.data(), 20f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node06.data(), 0f32, location.x);
+ assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node06.data(), 80f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node07).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node07.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node07.data(), 20f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node07.data(), 50f32, location.x);
+ assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node07.data(), 80f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node08).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node08.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node08.data(), 20f32, size.height);
+ assert_eq!(location.x, 100f32, "x of node {:?}. Expected {}. Actual {}", node08.data(), 100f32, location.x);
+ assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node08.data(), 80f32, location.y);
+}
diff --git a/tests/generated/grid_justify_content_space_evenly_negative_space_gap.rs b/tests/generated/grid_justify_content_space_evenly_negative_space_gap.rs
new file mode 100644
index 000000000..c8381eb1e
--- /dev/null
+++ b/tests/generated/grid_justify_content_space_evenly_negative_space_gap.rs
@@ -0,0 +1,115 @@
+#[test]
+fn grid_justify_content_space_evenly_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node01 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node02 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node03 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node04 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node05 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node06 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node07 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node08 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Grid,
+ align_content: Some(taffy::style::AlignContent::Center),
+ justify_content: Some(taffy::style::JustifyContent::SpaceEvenly),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ grid_template_rows: vec![points(20f32), points(20f32), points(20f32)],
+ grid_template_columns: vec![points(40f32), points(40f32), points(40f32)],
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(120f32),
+ height: taffy::style::Dimension::Points(120f32),
+ },
+ ..Default::default()
+ },
+ &[node00, node01, node02, node03, node04, node05, node06, node07, node08],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Grid,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(240f32),
+ height: taffy::style::Dimension::Points(240f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 240f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 240f32, size.width);
+ assert_eq!(size.height, 240f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 240f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 120f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 120f32, size.width);
+ assert_eq!(size.height, 120f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 120f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, -10f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), -10f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 40f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 90f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 90f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node03).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node03.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node03.data(), 20f32, size.height);
+ assert_eq!(location.x, -10f32, "x of node {:?}. Expected {}. Actual {}", node03.data(), -10f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node03.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node04).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node04.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node04.data(), 20f32, size.height);
+ assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node04.data(), 40f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node04.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node05).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node05.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node05.data(), 20f32, size.height);
+ assert_eq!(location.x, 90f32, "x of node {:?}. Expected {}. Actual {}", node05.data(), 90f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node05.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node06).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node06.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node06.data(), 20f32, size.height);
+ assert_eq!(location.x, -10f32, "x of node {:?}. Expected {}. Actual {}", node06.data(), -10f32, location.x);
+ assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node06.data(), 80f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node07).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node07.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node07.data(), 20f32, size.height);
+ assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node07.data(), 40f32, location.x);
+ assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node07.data(), 80f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node08).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node08.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node08.data(), 20f32, size.height);
+ assert_eq!(location.x, 90f32, "x of node {:?}. Expected {}. Actual {}", node08.data(), 90f32, location.x);
+ assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node08.data(), 80f32, location.y);
+}
diff --git a/tests/generated/grid_justify_content_start_negative_space_gap.rs b/tests/generated/grid_justify_content_start_negative_space_gap.rs
new file mode 100644
index 000000000..058fce1a4
--- /dev/null
+++ b/tests/generated/grid_justify_content_start_negative_space_gap.rs
@@ -0,0 +1,115 @@
+#[test]
+fn grid_justify_content_start_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node01 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node02 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node03 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node04 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node05 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node06 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node07 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node08 = taffy.new_leaf(taffy::style::Style { ..Default::default() }).unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Grid,
+ align_content: Some(taffy::style::AlignContent::Center),
+ justify_content: Some(taffy::style::JustifyContent::Start),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ grid_template_rows: vec![points(20f32), points(20f32), points(20f32)],
+ grid_template_columns: vec![points(40f32), points(40f32), points(40f32)],
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(120f32),
+ height: taffy::style::Dimension::Points(120f32),
+ },
+ ..Default::default()
+ },
+ &[node00, node01, node02, node03, node04, node05, node06, node07, node08],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Grid,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(240f32),
+ height: taffy::style::Dimension::Points(240f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 240f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 240f32, size.width);
+ assert_eq!(size.height, 240f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 240f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 120f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 120f32, size.width);
+ assert_eq!(size.height, 120f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 120f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 0f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 50f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 100f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 100f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node03).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node03.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node03.data(), 20f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node03.data(), 0f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node03.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node04).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node04.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node04.data(), 20f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node04.data(), 50f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node04.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node05).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node05.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node05.data(), 20f32, size.height);
+ assert_eq!(location.x, 100f32, "x of node {:?}. Expected {}. Actual {}", node05.data(), 100f32, location.x);
+ assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node05.data(), 50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node06).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node06.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node06.data(), 20f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node06.data(), 0f32, location.x);
+ assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node06.data(), 80f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node07).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node07.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node07.data(), 20f32, size.height);
+ assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node07.data(), 50f32, location.x);
+ assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node07.data(), 80f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node08).unwrap();
+ assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node08.data(), 40f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node08.data(), 20f32, size.height);
+ assert_eq!(location.x, 100f32, "x of node {:?}. Expected {}. Actual {}", node08.data(), 100f32, location.x);
+ assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node08.data(), 80f32, location.y);
+}
diff --git a/tests/generated/justify_content_column_center_negative_space.rs b/tests/generated/justify_content_column_center_negative_space.rs
new file mode 100644
index 000000000..75958d90a
--- /dev/null
+++ b/tests/generated/justify_content_column_center_negative_space.rs
@@ -0,0 +1,99 @@
+#[test]
+fn justify_content_column_center_negative_space() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node01 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node02 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ align_items: Some(taffy::style::AlignItems::Center),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00, node01, node02],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, -25f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), -25f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.x);
+ assert_eq!(location.y, -5f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), -5f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.x);
+ assert_eq!(location.y, 15f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 15f32, location.y);
+}
diff --git a/tests/generated/justify_content_column_center_negative_space_gap.rs b/tests/generated/justify_content_column_center_negative_space_gap.rs
new file mode 100644
index 000000000..0e7cec211
--- /dev/null
+++ b/tests/generated/justify_content_column_center_negative_space_gap.rs
@@ -0,0 +1,103 @@
+#[test]
+fn justify_content_column_center_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node01 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node02 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ align_items: Some(taffy::style::AlignItems::Center),
+ justify_content: Some(taffy::style::JustifyContent::Center),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00, node01, node02],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, -35f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), -35f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.x);
+ assert_eq!(location.y, -5f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), -5f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.x);
+ assert_eq!(location.y, 25f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 25f32, location.y);
+}
diff --git a/tests/generated/justify_content_column_end.rs b/tests/generated/justify_content_column_end.rs
new file mode 100644
index 000000000..e0743b569
--- /dev/null
+++ b/tests/generated/justify_content_column_end.rs
@@ -0,0 +1,63 @@
+#[test]
+fn justify_content_column_end() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ })
+ .unwrap();
+ let node1 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ })
+ .unwrap();
+ let node2 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ })
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ flex_direction: taffy::style::FlexDirection::Column,
+ justify_content: Some(taffy::style::JustifyContent::FlexEnd),
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(100f32),
+ height: taffy::style::Dimension::Points(100f32),
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 100f32, size.width);
+ assert_eq!(size.height, 100f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 100f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 100f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 0f32, location.x);
+ assert_eq!(location.y, 70f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 70f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node1).unwrap();
+ assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node1.data(), 100f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node1.data(), 10f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node1.data(), 0f32, location.x);
+ assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node1.data(), 80f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node2).unwrap();
+ assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node2.data(), 100f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node2.data(), 10f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node2.data(), 0f32, location.x);
+ assert_eq!(location.y, 90f32, "y of node {:?}. Expected {}. Actual {}", node2.data(), 90f32, location.y);
+}
diff --git a/tests/generated/justify_content_column_end_negative_space.rs b/tests/generated/justify_content_column_end_negative_space.rs
new file mode 100644
index 000000000..e370f216d
--- /dev/null
+++ b/tests/generated/justify_content_column_end_negative_space.rs
@@ -0,0 +1,99 @@
+#[test]
+fn justify_content_column_end_negative_space() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node01 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node02 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ align_items: Some(taffy::style::AlignItems::Center),
+ justify_content: Some(taffy::style::JustifyContent::End),
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00, node01, node02],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, -50f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), -50f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.x);
+ assert_eq!(location.y, -30f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), -30f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.x);
+ assert_eq!(location.y, -10f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), -10f32, location.y);
+}
diff --git a/tests/generated/justify_content_column_end_negative_space_gap.rs b/tests/generated/justify_content_column_end_negative_space_gap.rs
new file mode 100644
index 000000000..414074b27
--- /dev/null
+++ b/tests/generated/justify_content_column_end_negative_space_gap.rs
@@ -0,0 +1,103 @@
+#[test]
+fn justify_content_column_end_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node01 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node02 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ align_items: Some(taffy::style::AlignItems::Center),
+ justify_content: Some(taffy::style::JustifyContent::End),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00, node01, node02],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, -70f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), -70f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.x);
+ assert_eq!(location.y, -40f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), -40f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.x);
+ assert_eq!(location.y, -10f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), -10f32, location.y);
+}
diff --git a/tests/generated/justify_content_column_end_reverse.rs b/tests/generated/justify_content_column_end_reverse.rs
new file mode 100644
index 000000000..aa5e37a7a
--- /dev/null
+++ b/tests/generated/justify_content_column_end_reverse.rs
@@ -0,0 +1,63 @@
+#[test]
+fn justify_content_column_end_reverse() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ })
+ .unwrap();
+ let node1 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ })
+ .unwrap();
+ let node2 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ })
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ flex_direction: taffy::style::FlexDirection::Column,
+ justify_content: Some(taffy::style::JustifyContent::FlexEnd),
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(100f32),
+ height: taffy::style::Dimension::Points(100f32),
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 100f32, size.width);
+ assert_eq!(size.height, 100f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 100f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 100f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 0f32, location.x);
+ assert_eq!(location.y, 70f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 70f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node1).unwrap();
+ assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node1.data(), 100f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node1.data(), 10f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node1.data(), 0f32, location.x);
+ assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node1.data(), 80f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node2).unwrap();
+ assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node2.data(), 100f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node2.data(), 10f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node2.data(), 0f32, location.x);
+ assert_eq!(location.y, 90f32, "y of node {:?}. Expected {}. Actual {}", node2.data(), 90f32, location.y);
+}
diff --git a/tests/generated/justify_content_column_flex_end_reverse.rs b/tests/generated/justify_content_column_flex_end_reverse.rs
new file mode 100644
index 000000000..d1d8acaed
--- /dev/null
+++ b/tests/generated/justify_content_column_flex_end_reverse.rs
@@ -0,0 +1,63 @@
+#[test]
+fn justify_content_column_flex_end_reverse() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ })
+ .unwrap();
+ let node1 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ })
+ .unwrap();
+ let node2 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ })
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ flex_direction: taffy::style::FlexDirection::ColumnReverse,
+ justify_content: Some(taffy::style::JustifyContent::FlexEnd),
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(100f32),
+ height: taffy::style::Dimension::Points(100f32),
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 100f32, size.width);
+ assert_eq!(size.height, 100f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 100f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 100f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 0f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node1).unwrap();
+ assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node1.data(), 100f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node1.data(), 10f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node1.data(), 0f32, location.x);
+ assert_eq!(location.y, 10f32, "y of node {:?}. Expected {}. Actual {}", node1.data(), 10f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node2).unwrap();
+ assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node2.data(), 100f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node2.data(), 10f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node2.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node2.data(), 0f32, location.y);
+}
diff --git a/tests/generated/justify_content_column_flex_start_reverse.rs b/tests/generated/justify_content_column_flex_start_reverse.rs
new file mode 100644
index 000000000..776b5c639
--- /dev/null
+++ b/tests/generated/justify_content_column_flex_start_reverse.rs
@@ -0,0 +1,63 @@
+#[test]
+fn justify_content_column_flex_start_reverse() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ })
+ .unwrap();
+ let node1 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ })
+ .unwrap();
+ let node2 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ })
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ flex_direction: taffy::style::FlexDirection::ColumnReverse,
+ justify_content: Some(taffy::style::JustifyContent::FlexStart),
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(100f32),
+ height: taffy::style::Dimension::Points(100f32),
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 100f32, size.width);
+ assert_eq!(size.height, 100f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 100f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 100f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 0f32, location.x);
+ assert_eq!(location.y, 90f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 90f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node1).unwrap();
+ assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node1.data(), 100f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node1.data(), 10f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node1.data(), 0f32, location.x);
+ assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node1.data(), 80f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node2).unwrap();
+ assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node2.data(), 100f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node2.data(), 10f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node2.data(), 0f32, location.x);
+ assert_eq!(location.y, 70f32, "y of node {:?}. Expected {}. Actual {}", node2.data(), 70f32, location.y);
+}
diff --git a/tests/generated/justify_content_column_space_around_negative_space.rs b/tests/generated/justify_content_column_space_around_negative_space.rs
new file mode 100644
index 000000000..d5a576f53
--- /dev/null
+++ b/tests/generated/justify_content_column_space_around_negative_space.rs
@@ -0,0 +1,99 @@
+#[test]
+fn justify_content_column_space_around_negative_space() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node01 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node02 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ align_items: Some(taffy::style::AlignItems::Center),
+ justify_content: Some(taffy::style::JustifyContent::SpaceAround),
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00, node01, node02],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, -25f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), -25f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.x);
+ assert_eq!(location.y, -5f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), -5f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.x);
+ assert_eq!(location.y, 15f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 15f32, location.y);
+}
diff --git a/tests/generated/justify_content_column_space_around_negative_space_gap.rs b/tests/generated/justify_content_column_space_around_negative_space_gap.rs
new file mode 100644
index 000000000..02ef72756
--- /dev/null
+++ b/tests/generated/justify_content_column_space_around_negative_space_gap.rs
@@ -0,0 +1,103 @@
+#[test]
+fn justify_content_column_space_around_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node01 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node02 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ align_items: Some(taffy::style::AlignItems::Center),
+ justify_content: Some(taffy::style::JustifyContent::SpaceAround),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00, node01, node02],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, -35f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), -35f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.x);
+ assert_eq!(location.y, -5f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), -5f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.x);
+ assert_eq!(location.y, 25f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 25f32, location.y);
+}
diff --git a/tests/generated/justify_content_column_space_between_negative_space.rs b/tests/generated/justify_content_column_space_between_negative_space.rs
new file mode 100644
index 000000000..4cde8ebfd
--- /dev/null
+++ b/tests/generated/justify_content_column_space_between_negative_space.rs
@@ -0,0 +1,99 @@
+#[test]
+fn justify_content_column_space_between_negative_space() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node01 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node02 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ align_items: Some(taffy::style::AlignItems::Center),
+ justify_content: Some(taffy::style::JustifyContent::SpaceBetween),
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00, node01, node02],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.x);
+ assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 40f32, location.y);
+}
diff --git a/tests/generated/justify_content_column_space_between_negative_space_gap.rs b/tests/generated/justify_content_column_space_between_negative_space_gap.rs
new file mode 100644
index 000000000..5f84c1952
--- /dev/null
+++ b/tests/generated/justify_content_column_space_between_negative_space_gap.rs
@@ -0,0 +1,103 @@
+#[test]
+fn justify_content_column_space_between_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node01 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node02 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ align_items: Some(taffy::style::AlignItems::Center),
+ justify_content: Some(taffy::style::JustifyContent::SpaceBetween),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00, node01, node02],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.x);
+ assert_eq!(location.y, 30f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), 30f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 60f32, location.y);
+}
diff --git a/tests/generated/justify_content_column_space_evenly_negative_space.rs b/tests/generated/justify_content_column_space_evenly_negative_space.rs
new file mode 100644
index 000000000..c30ed3298
--- /dev/null
+++ b/tests/generated/justify_content_column_space_evenly_negative_space.rs
@@ -0,0 +1,99 @@
+#[test]
+fn justify_content_column_space_evenly_negative_space() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node01 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node02 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ align_items: Some(taffy::style::AlignItems::Center),
+ justify_content: Some(taffy::style::JustifyContent::SpaceEvenly),
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00, node01, node02],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, -25f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), -25f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.x);
+ assert_eq!(location.y, -5f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), -5f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.x);
+ assert_eq!(location.y, 15f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 15f32, location.y);
+}
diff --git a/tests/generated/justify_content_column_space_evenly_negative_space_gap.rs b/tests/generated/justify_content_column_space_evenly_negative_space_gap.rs
new file mode 100644
index 000000000..b1f070faa
--- /dev/null
+++ b/tests/generated/justify_content_column_space_evenly_negative_space_gap.rs
@@ -0,0 +1,103 @@
+#[test]
+fn justify_content_column_space_evenly_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node01 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node02 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ align_items: Some(taffy::style::AlignItems::Center),
+ justify_content: Some(taffy::style::JustifyContent::SpaceEvenly),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00, node01, node02],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, -35f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), -35f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.x);
+ assert_eq!(location.y, -5f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), -5f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.x);
+ assert_eq!(location.y, 25f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 25f32, location.y);
+}
diff --git a/tests/generated/justify_content_column_start.rs b/tests/generated/justify_content_column_start.rs
new file mode 100644
index 000000000..3fd3274f3
--- /dev/null
+++ b/tests/generated/justify_content_column_start.rs
@@ -0,0 +1,63 @@
+#[test]
+fn justify_content_column_start() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ })
+ .unwrap();
+ let node1 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ })
+ .unwrap();
+ let node2 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ })
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ flex_direction: taffy::style::FlexDirection::Column,
+ justify_content: Some(taffy::style::JustifyContent::Start),
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(100f32),
+ height: taffy::style::Dimension::Points(100f32),
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 100f32, size.width);
+ assert_eq!(size.height, 100f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 100f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 100f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node1).unwrap();
+ assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node1.data(), 100f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node1.data(), 10f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node1.data(), 0f32, location.x);
+ assert_eq!(location.y, 10f32, "y of node {:?}. Expected {}. Actual {}", node1.data(), 10f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node2).unwrap();
+ assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node2.data(), 100f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node2.data(), 10f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node2.data(), 0f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node2.data(), 20f32, location.y);
+}
diff --git a/tests/generated/justify_content_column_start_negative_space.rs b/tests/generated/justify_content_column_start_negative_space.rs
new file mode 100644
index 000000000..04bee979f
--- /dev/null
+++ b/tests/generated/justify_content_column_start_negative_space.rs
@@ -0,0 +1,99 @@
+#[test]
+fn justify_content_column_start_negative_space() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node01 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node02 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ align_items: Some(taffy::style::AlignItems::Center),
+ justify_content: Some(taffy::style::JustifyContent::Start),
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00, node01, node02],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.x);
+ assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 40f32, location.y);
+}
diff --git a/tests/generated/justify_content_column_start_negative_space_gap.rs b/tests/generated/justify_content_column_start_negative_space_gap.rs
new file mode 100644
index 000000000..1bec1a72f
--- /dev/null
+++ b/tests/generated/justify_content_column_start_negative_space_gap.rs
@@ -0,0 +1,103 @@
+#[test]
+fn justify_content_column_start_negative_space_gap() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node00 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node01 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node02 = taffy
+ .new_leaf(taffy::style::Style {
+ flex_shrink: 0f32,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Percent(0.8f32),
+ height: taffy::style::Dimension::Points(20f32),
+ },
+ ..Default::default()
+ })
+ .unwrap();
+ let node0 = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ align_items: Some(taffy::style::AlignItems::Center),
+ justify_content: Some(taffy::style::JustifyContent::Start),
+ gap: taffy::geometry::Size {
+ width: taffy::style::LengthPercentage::Points(10f32),
+ height: taffy::style::LengthPercentage::Points(10f32),
+ },
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ },
+ &[node00, node01, node02],
+ )
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ display: taffy::style::Display::Flex,
+ flex_direction: taffy::style::FlexDirection::Column,
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(320f32),
+ height: taffy::style::Dimension::Points(320f32),
+ },
+ border: taffy::geometry::Rect {
+ left: taffy::style::LengthPercentage::Points(60f32),
+ right: taffy::style::LengthPercentage::Points(60f32),
+ top: taffy::style::LengthPercentage::Points(60f32),
+ bottom: taffy::style::LengthPercentage::Points(60f32),
+ },
+ ..Default::default()
+ },
+ &[node0],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 320f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.width);
+ assert_eq!(size.height, 320f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 320f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 200f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 60f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 60f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node00).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00.data(), 20f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node01).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01.data(), 20f32, location.x);
+ assert_eq!(location.y, 30f32, "y of node {:?}. Expected {}. Actual {}", node01.data(), 30f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node02).unwrap();
+ assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02.data(), 160f32, size.width);
+ assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, size.height);
+ assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02.data(), 20f32, location.x);
+ assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node02.data(), 60f32, location.y);
+}
diff --git a/tests/generated/justify_content_column_start_reverse.rs b/tests/generated/justify_content_column_start_reverse.rs
new file mode 100644
index 000000000..37686cddd
--- /dev/null
+++ b/tests/generated/justify_content_column_start_reverse.rs
@@ -0,0 +1,63 @@
+#[test]
+fn justify_content_column_start_reverse() {
+ use slotmap::Key;
+ #[allow(unused_imports)]
+ use taffy::{layout::Layout, prelude::*};
+ let mut taffy = taffy::Taffy::new();
+ let node0 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ })
+ .unwrap();
+ let node1 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ })
+ .unwrap();
+ let node2 = taffy
+ .new_leaf(taffy::style::Style {
+ size: taffy::geometry::Size { width: auto(), height: taffy::style::Dimension::Points(10f32) },
+ ..Default::default()
+ })
+ .unwrap();
+ let node = taffy
+ .new_with_children(
+ taffy::style::Style {
+ flex_direction: taffy::style::FlexDirection::ColumnReverse,
+ justify_content: Some(taffy::style::JustifyContent::Start),
+ size: taffy::geometry::Size {
+ width: taffy::style::Dimension::Points(100f32),
+ height: taffy::style::Dimension::Points(100f32),
+ },
+ ..Default::default()
+ },
+ &[node0, node1, node2],
+ )
+ .unwrap();
+ taffy.compute_layout(node, taffy::geometry::Size::MAX_CONTENT).unwrap();
+ println!("\nComputed tree:");
+ taffy::debug::print_tree(&taffy, node);
+ println!();
+ let Layout { size, location, .. } = taffy.layout(node).unwrap();
+ assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node.data(), 100f32, size.width);
+ assert_eq!(size.height, 100f32, "height of node {:?}. Expected {}. Actual {}", node.data(), 100f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node.data(), 0f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node0).unwrap();
+ assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node0.data(), 100f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node0.data(), 10f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node0.data(), 0f32, location.x);
+ assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node0.data(), 20f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node1).unwrap();
+ assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node1.data(), 100f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node1.data(), 10f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node1.data(), 0f32, location.x);
+ assert_eq!(location.y, 10f32, "y of node {:?}. Expected {}. Actual {}", node1.data(), 10f32, location.y);
+ let Layout { size, location, .. } = taffy.layout(node2).unwrap();
+ assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node2.data(), 100f32, size.width);
+ assert_eq!(size.height, 10f32, "height of node {:?}. Expected {}. Actual {}", node2.data(), 10f32, size.height);
+ assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node2.data(), 0f32, location.x);
+ assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node2.data(), 0f32, location.y);
+}
diff --git a/tests/generated/mod.rs b/tests/generated/mod.rs
index 7117f4f70..49db6907a 100644
--- a/tests/generated/mod.rs
+++ b/tests/generated/mod.rs
@@ -125,19 +125,46 @@ mod align_baseline_multiline_row_and_column;
mod align_baseline_nested_child;
mod align_baseline_nested_column;
mod align_center_should_size_based_on_content;
+mod align_content_center_single_line;
+mod align_content_center_single_line_negative_space;
+mod align_content_center_single_line_negative_space_gap;
+mod align_content_center_wrapped;
+mod align_content_center_wrapped_negative_space;
+mod align_content_center_wrapped_negative_space_gap;
+mod align_content_end;
+mod align_content_end_single_line_negative_space;
+mod align_content_end_single_line_negative_space_gap;
+mod align_content_end_wrapped_negative_space;
+mod align_content_end_wrapped_negative_space_gap;
mod align_content_flex_end;
mod align_content_flex_start;
mod align_content_flex_start_with_flex;
mod align_conte
The patch goes on, but was cut here: fetch the commit with git to see it whole.