gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

HTML 231Rust 8TOML 3CSS 1317 Definiciones

Fixes for content alignment spec updates (#635)

* Update gentests to match Chrome 123

* Implement content alignment fixes to align with spec changes

* Update changelog

* Fix clippy lints

04e20d1de5cd584bf0760071cf130dd55f5b0089 · por Nico Burns · (hace 2 años) · padre 5edada7fe · ver el árbol en este commit

Delta semántico · 18

src/compute/common/alignment.rs

src/compute/flexbox.rs

src/compute/grid/alignment.rs

tests/generated/flex/align_content_space_around_wrapped_negative_space.rs

tests/generated/flex/align_content_space_around_wrapped_negative_space_gap.rs

tests/generated/flex/align_content_space_evenly_wrapped_negative_space.rs

tests/generated/flex/align_content_space_evenly_wrapped_negative_space_gap.rs

tests/generated/flex/bevy_issue_10343_block.rs

tests/generated/flex/bevy_issue_10343_flex.rs

tests/generated/flex/bevy_issue_10343_grid.rs

tests/generated/flex/justify_content_column_space_around_negative_space.rs

tests/generated/flex/justify_content_column_space_around_negative_space_gap.rs

tests/generated/flex/justify_content_column_space_evenly_negative_space.rs

tests/generated/flex/justify_content_column_space_evenly_negative_space_gap.rs

tests/generated/grid/grid_align_content_space_around_negative_space_gap.rs

tests/generated/grid/grid_justify_content_space_around_negative_space_gap.rs

tests/generated/grid/grid_justify_content_space_evenly_negative_space_gap.rs

18 archivos · +138 −92

diff --git a/RELEASES.md b/RELEASES.md
index 780ac6a01..811ec88f9 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -1,5 +1,11 @@
 # Release Notes
 
+## 0.4.4
+
+### Fixes
+
+- Content alignment (`align-content`/`justify-content`) behaviour was updated to match the latest spec (and Chrome 123+) (#635)
+
 ## 0.4.3
 
 ### Fixes
diff --git a/src/compute/common/alignment.rs b/src/compute/common/alignment.rs
index c0725a8f2..f2c7170a2 100644
--- a/src/compute/common/alignment.rs
+++ b/src/compute/common/alignment.rs
@@ -1,6 +1,38 @@
 //! Generic CSS alignment code that is shared between both the Flexbox and CSS Grid algorithms.
 use crate::style::AlignContent;
 
+/// Implement fallback alignment.
+///
+/// In addition to the spec at https://www.w3.org/TR/css-align-3/ this implementation follows
+/// the resolution of https://github.com/w3c/csswg-drafts/issues/10154
+pub(crate) fn apply_alignment_fallback(
+    free_space: f32,
+    num_items: usize,
+    mut alignment_mode: AlignContent,
+    mut is_safe: bool,
+) -> AlignContent {
+    // Fallback occurs in two cases:
+
+    // 1. If there is only a single item being aligned and alignment is a distributed alignment keyword
+    //    https://www.w3.org/TR/css-align-3/#distribution-values
+    if num_items <= 1 || free_space <= 0.0 {
+        (alignment_mode, is_safe) = match alignment_mode {
+            AlignContent::Stretch => (AlignContent::FlexStart, true),
+            AlignContent::SpaceBetween => (AlignContent::FlexStart, true),
+            AlignContent::SpaceAround => (AlignContent::Center, true),
+            AlignContent::SpaceEvenly => (AlignContent::Center, true),
+            _ => (alignment_mode, is_safe),
+        }
+    };
+
+    // 2. If free space is negative the "safe" alignment variants all fallback to Start alignment
+    if free_space <= 0.0 && is_safe {
+        alignment_mode = AlignContent::Start;
+    }
+
+    alignment_mode
+}
+
 /// Generic alignment function that is used:
 ///   - For both align-content and justify-content alignment
 ///   - For both the Flexbox and CSS Grid algorithms
diff --git a/src/compute/flexbox.rs b/src/compute/flexbox.rs
index 143a1dea3..592b8ec20 100644
--- a/src/compute/flexbox.rs
+++ b/src/compute/flexbox.rs
@@ -14,6 +14,7 @@ use crate::util::sys::{f32_max, new_vec_with_capacity, Vec};
 use crate::util::MaybeMath;
 use crate::util::{MaybeResolve, ResolveOrZero};
 
+use super::common::alignment::apply_alignment_fallback;
 #[cfg(feature = "content_size")]
 use super::common::content_size::compute_content_size_contribution;
 
@@ -1539,7 +1540,10 @@ fn distribute_remaining_free_space(flex_lines: &mut [FlexLine], constants: &Algo
             let num_items = line.items.len();
             let layout_reverse = constants.dir.is_reverse();
             let gap = constants.gap.main(constants.dir);
-            let justify_content_mode = constants.justify_content.unwrap_or(JustifyContent::FlexStart);
+            let is_safe = false; // TODO: Implement safe alignment
+            let raw_justify_content_mode = constants.justify_content.unwrap_or(JustifyContent::FlexStart);
+            let justify_content_mode =
+                apply_alignment_fallback(free_space, num_items, raw_justify_content_mode, is_safe);
 
             let justify_item = |(i, child): (usize, &mut FlexItem)| {
                 child.offset_main =
@@ -1703,9 +1707,11 @@ fn determine_container_cross_size(
 fn align_flex_lines_per_align_content(flex_lines: &mut [FlexLine], constants: &AlgoConstants, total_cross_size: f32) {
     let num_lines = flex_lines.len();
     let gap = constants.gap.cross(constants.dir);
-    let align_content_mode = constants.align_content;
     let total_cross_axis_gap = sum_axis_gaps(gap, num_lines);
     let free_space = constants.inner_container_size.cross(constants.dir) - total_cross_size - total_cross_axis_gap;
+    let is_safe = false; // TODO: Implement safe alignment
+
+    let align_content_mode = apply_alignment_fallback(free_space, num_lines, constants.align_content, is_safe);
 
     let align_line = |(i, line): (usize, &mut FlexLine)| {
         line.offset_cross =
diff --git a/src/compute/grid/alignment.rs b/src/compute/grid/alignment.rs
index 9a38c7ba6..04a0e3b40 100644
--- a/src/compute/grid/alignment.rs
+++ b/src/compute/grid/alignment.rs
@@ -1,6 +1,6 @@
 //! Alignment of tracks and final positioning of items
 use super::types::GridTrack;
-use crate::compute::common::alignment::compute_alignment_offset;
+use crate::compute::common::alignment::{apply_alignment_fallback, compute_alignment_offset};
 use crate::geometry::{InBothAbsAxis, Line, Point, Rect, Size};
 use crate::style::{AlignContent, AlignItems, AlignSelf, AvailableSpace, Overflow, Position};
 use crate::tree::{Layout, LayoutPartialTree, LayoutPartialTreeExt, NodeId, SizingMode};
@@ -31,6 +31,8 @@ pub(super) fn align_tracks(
     // simply pass zero here. Grid layout is never reversed.
     let gap = 0.0;
     let layout_is_reversed = false;
+    let is_safe = false; // TODO: Implement safe alignment
+    let track_alignment = apply_alignment_fallback(free_space, num_tracks, track_alignment_style, is_safe);
 
     // Compute offsets
     let mut total_offset = origin;
@@ -44,7 +46,7 @@ pub(super) fn align_tracks(
         let offset = if is_gutter {
             0.0
         } else {
-            compute_alignment_offset(free_space, num_tracks, gap, track_alignment_style, layout_is_reversed, is_first)
+            compute_alignment_offset(free_space, num_tracks, gap, track_alignment, layout_is_reversed, is_first)
         };
 
         track.offset = total_offset + offset;
diff --git a/tests/generated/flex/align_content_space_around_wrapped_negative_space.rs b/tests/generated/flex/align_content_space_around_wrapped_negative_space.rs
index 28e080191..8b19d511a 100644
--- a/tests/generated/flex/align_content_space_around_wrapped_negative_space.rs
+++ b/tests/generated/flex/align_content_space_around_wrapped_negative_space.rs
@@ -112,10 +112,10 @@ fn align_content_space_around_wrapped_negative_space() {
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_height(),
-        25f32,
+        50f32,
         "scroll_height of node {:?}. Expected {}. Actual {}",
         node0,
-        25f32,
+        50f32,
         layout.scroll_height()
     );
     #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
@@ -123,7 +123,7 @@ fn align_content_space_around_wrapped_negative_space() {
     assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00, 160f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00, 20f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00, 20f32, location.x);
-    assert_eq!(location.y, -25f32, "y of node {:?}. Expected {}. Actual {}", node00, -25f32, location.y);
+    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00, 0f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
@@ -147,7 +147,7 @@ fn align_content_space_around_wrapped_negative_space() {
     assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01, 160f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01, 20f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01, 20f32, location.x);
-    assert_eq!(location.y, -5f32, "y of node {:?}. Expected {}. Actual {}", node01, -5f32, location.y);
+    assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node01, 20f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
@@ -171,7 +171,7 @@ fn align_content_space_around_wrapped_negative_space() {
     assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02, 160f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02, 20f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02, 20f32, location.x);
-    assert_eq!(location.y, 15f32, "y of node {:?}. Expected {}. Actual {}", node02, 15f32, location.y);
+    assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node02, 40f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
diff --git a/tests/generated/flex/align_content_space_around_wrapped_negative_space_gap.rs b/tests/generated/flex/align_content_space_around_wrapped_negative_space_gap.rs
index 36e560945..9da50518c 100644
--- a/tests/generated/flex/align_content_space_around_wrapped_negative_space_gap.rs
+++ b/tests/generated/flex/align_content_space_around_wrapped_negative_space_gap.rs
@@ -116,10 +116,10 @@ fn align_content_space_around_wrapped_negative_space_gap() {
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_height(),
-        35f32,
+        70f32,
         "scroll_height of node {:?}. Expected {}. Actual {}",
         node0,
-        35f32,
+        70f32,
         layout.scroll_height()
     );
     #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
@@ -127,7 +127,7 @@ fn align_content_space_around_wrapped_negative_space_gap() {
     assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00, 160f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00, 20f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00, 20f32, location.x);
-    assert_eq!(location.y, -35f32, "y of node {:?}. Expected {}. Actual {}", node00, -35f32, location.y);
+    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00, 0f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
@@ -151,7 +151,7 @@ fn align_content_space_around_wrapped_negative_space_gap() {
     assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01, 160f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01, 20f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01, 20f32, location.x);
-    assert_eq!(location.y, -5f32, "y of node {:?}. Expected {}. Actual {}", node01, -5f32, location.y);
+    assert_eq!(location.y, 30f32, "y of node {:?}. Expected {}. Actual {}", node01, 30f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
@@ -175,7 +175,7 @@ fn align_content_space_around_wrapped_negative_space_gap() {
     assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02, 160f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02, 20f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02, 20f32, location.x);
-    assert_eq!(location.y, 25f32, "y of node {:?}. Expected {}. Actual {}", node02, 25f32, location.y);
+    assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node02, 60f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
diff --git a/tests/generated/flex/align_content_space_evenly_wrapped_negative_space.rs b/tests/generated/flex/align_content_space_evenly_wrapped_negative_space.rs
index 0608956ef..2d8352dc5 100644
--- a/tests/generated/flex/align_content_space_evenly_wrapped_negative_space.rs
+++ b/tests/generated/flex/align_content_space_evenly_wrapped_negative_space.rs
@@ -112,10 +112,10 @@ fn align_content_space_evenly_wrapped_negative_space() {
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_height(),
-        25f32,
+        50f32,
         "scroll_height of node {:?}. Expected {}. Actual {}",
         node0,
-        25f32,
+        50f32,
         layout.scroll_height()
     );
     #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
@@ -123,7 +123,7 @@ fn align_content_space_evenly_wrapped_negative_space() {
     assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00, 160f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00, 20f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00, 20f32, location.x);
-    assert_eq!(location.y, -25f32, "y of node {:?}. Expected {}. Actual {}", node00, -25f32, location.y);
+    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00, 0f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
@@ -147,7 +147,7 @@ fn align_content_space_evenly_wrapped_negative_space() {
     assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01, 160f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01, 20f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01, 20f32, location.x);
-    assert_eq!(location.y, -5f32, "y of node {:?}. Expected {}. Actual {}", node01, -5f32, location.y);
+    assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node01, 20f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
@@ -171,7 +171,7 @@ fn align_content_space_evenly_wrapped_negative_space() {
     assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02, 160f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02, 20f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02, 20f32, location.x);
-    assert_eq!(location.y, 15f32, "y of node {:?}. Expected {}. Actual {}", node02, 15f32, location.y);
+    assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node02, 40f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
diff --git a/tests/generated/flex/align_content_space_evenly_wrapped_negative_space_gap.rs b/tests/generated/flex/align_content_space_evenly_wrapped_negative_space_gap.rs
index 241a1e817..392c6ca1c 100644
--- a/tests/generated/flex/align_content_space_evenly_wrapped_negative_space_gap.rs
+++ b/tests/generated/flex/align_content_space_evenly_wrapped_negative_space_gap.rs
@@ -116,10 +116,10 @@ fn align_content_space_evenly_wrapped_negative_space_gap() {
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_height(),
-        35f32,
+        70f32,
         "scroll_height of node {:?}. Expected {}. Actual {}",
         node0,
-        35f32,
+        70f32,
         layout.scroll_height()
     );
     #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
@@ -127,7 +127,7 @@ fn align_content_space_evenly_wrapped_negative_space_gap() {
     assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00, 160f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00, 20f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00, 20f32, location.x);
-    assert_eq!(location.y, -35f32, "y of node {:?}. Expected {}. Actual {}", node00, -35f32, location.y);
+    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00, 0f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
@@ -151,7 +151,7 @@ fn align_content_space_evenly_wrapped_negative_space_gap() {
     assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01, 160f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01, 20f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01, 20f32, location.x);
-    assert_eq!(location.y, -5f32, "y of node {:?}. Expected {}. Actual {}", node01, -5f32, location.y);
+    assert_eq!(location.y, 30f32, "y of node {:?}. Expected {}. Actual {}", node01, 30f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
@@ -175,7 +175,7 @@ fn align_content_space_evenly_wrapped_negative_space_gap() {
     assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02, 160f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02, 20f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02, 20f32, location.x);
-    assert_eq!(location.y, 25f32, "y of node {:?}. Expected {}. Actual {}", node02, 25f32, location.y);
+    assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node02, 60f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
diff --git a/tests/generated/flex/bevy_issue_10343_block.rs b/tests/generated/flex/bevy_issue_10343_block.rs
index af5390f7a..30be4d83e 100644
--- a/tests/generated/flex/bevy_issue_10343_block.rs
+++ b/tests/generated/flex/bevy_issue_10343_block.rs
@@ -66,10 +66,10 @@ fn bevy_issue_10343_block() {
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_height(),
-        55f32,
+        110f32,
         "scroll_height of node {:?}. Expected {}. Actual {}",
         node,
-        55f32,
+        110f32,
         layout.scroll_height()
     );
     #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
@@ -77,7 +77,7 @@ fn bevy_issue_10343_block() {
     assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node0, 100f32, size.width);
     assert_eq!(size.height, 210f32, "height of node {:?}. Expected {}. Actual {}", node0, 210f32, size.height);
     assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node0, 0f32, location.x);
-    assert_eq!(location.y, -55f32, "y of node {:?}. Expected {}. Actual {}", node0, -55f32, location.y);
+    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node0, 0f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
diff --git a/tests/generated/flex/bevy_issue_10343_flex.rs b/tests/generated/flex/bevy_issue_10343_flex.rs
index 92a179c64..41bed8970 100644
--- a/tests/generated/flex/bevy_issue_10343_flex.rs
+++ b/tests/generated/flex/bevy_issue_10343_flex.rs
@@ -66,10 +66,10 @@ fn bevy_issue_10343_flex() {
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_height(),
-        55f32,
+        110f32,
         "scroll_height of node {:?}. Expected {}. Actual {}",
         node,
-        55f32,
+        110f32,
         layout.scroll_height()
     );
     #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
@@ -77,7 +77,7 @@ fn bevy_issue_10343_flex() {
     assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node0, 100f32, size.width);
     assert_eq!(size.height, 210f32, "height of node {:?}. Expected {}. Actual {}", node0, 210f32, size.height);
     assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node0, 0f32, location.x);
-    assert_eq!(location.y, -55f32, "y of node {:?}. Expected {}. Actual {}", node0, -55f32, location.y);
+    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node0, 0f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
diff --git a/tests/generated/flex/bevy_issue_10343_grid.rs b/tests/generated/flex/bevy_issue_10343_grid.rs
index 02d7a39c0..8bf63858c 100644
--- a/tests/generated/flex/bevy_issue_10343_grid.rs
+++ b/tests/generated/flex/bevy_issue_10343_grid.rs
@@ -66,10 +66,10 @@ fn bevy_issue_10343_grid() {
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_height(),
-        55f32,
+        110f32,
         "scroll_height of node {:?}. Expected {}. Actual {}",
         node,
-        55f32,
+        110f32,
         layout.scroll_height()
     );
     #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
@@ -77,7 +77,7 @@ fn bevy_issue_10343_grid() {
     assert_eq!(size.width, 100f32, "width of node {:?}. Expected {}. Actual {}", node0, 100f32, size.width);
     assert_eq!(size.height, 210f32, "height of node {:?}. Expected {}. Actual {}", node0, 210f32, size.height);
     assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node0, 0f32, location.x);
-    assert_eq!(location.y, -55f32, "y of node {:?}. Expected {}. Actual {}", node0, -55f32, location.y);
+    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node0, 0f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
diff --git a/tests/generated/flex/justify_content_column_space_around_negative_space.rs b/tests/generated/flex/justify_content_column_space_around_negative_space.rs
index 0b6e235cf..6138b24a7 100644
--- a/tests/generated/flex/justify_content_column_space_around_negative_space.rs
+++ b/tests/generated/flex/justify_content_column_space_around_negative_space.rs
@@ -112,10 +112,10 @@ fn justify_content_column_space_around_negative_space() {
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_height(),
-        25f32,
+        50f32,
         "scroll_height of node {:?}. Expected {}. Actual {}",
         node0,
-        25f32,
+        50f32,
         layout.scroll_height()
     );
     #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
@@ -123,7 +123,7 @@ fn justify_content_column_space_around_negative_space() {
     assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00, 160f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00, 20f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00, 20f32, location.x);
-    assert_eq!(location.y, -25f32, "y of node {:?}. Expected {}. Actual {}", node00, -25f32, location.y);
+    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00, 0f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
@@ -147,7 +147,7 @@ fn justify_content_column_space_around_negative_space() {
     assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01, 160f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01, 20f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01, 20f32, location.x);
-    assert_eq!(location.y, -5f32, "y of node {:?}. Expected {}. Actual {}", node01, -5f32, location.y);
+    assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node01, 20f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
@@ -171,7 +171,7 @@ fn justify_content_column_space_around_negative_space() {
     assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02, 160f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02, 20f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02, 20f32, location.x);
-    assert_eq!(location.y, 15f32, "y of node {:?}. Expected {}. Actual {}", node02, 15f32, location.y);
+    assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node02, 40f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
diff --git a/tests/generated/flex/justify_content_column_space_around_negative_space_gap.rs b/tests/generated/flex/justify_content_column_space_around_negative_space_gap.rs
index 44c47c974..facdad259 100644
--- a/tests/generated/flex/justify_content_column_space_around_negative_space_gap.rs
+++ b/tests/generated/flex/justify_content_column_space_around_negative_space_gap.rs
@@ -116,10 +116,10 @@ fn justify_content_column_space_around_negative_space_gap() {
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_height(),
-        35f32,
+        70f32,
         "scroll_height of node {:?}. Expected {}. Actual {}",
         node0,
-        35f32,
+        70f32,
         layout.scroll_height()
     );
     #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
@@ -127,7 +127,7 @@ fn justify_content_column_space_around_negative_space_gap() {
     assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00, 160f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00, 20f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00, 20f32, location.x);
-    assert_eq!(location.y, -35f32, "y of node {:?}. Expected {}. Actual {}", node00, -35f32, location.y);
+    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00, 0f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
@@ -151,7 +151,7 @@ fn justify_content_column_space_around_negative_space_gap() {
     assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01, 160f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01, 20f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01, 20f32, location.x);
-    assert_eq!(location.y, -5f32, "y of node {:?}. Expected {}. Actual {}", node01, -5f32, location.y);
+    assert_eq!(location.y, 30f32, "y of node {:?}. Expected {}. Actual {}", node01, 30f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
@@ -175,7 +175,7 @@ fn justify_content_column_space_around_negative_space_gap() {
     assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02, 160f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02, 20f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02, 20f32, location.x);
-    assert_eq!(location.y, 25f32, "y of node {:?}. Expected {}. Actual {}", node02, 25f32, location.y);
+    assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node02, 60f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
diff --git a/tests/generated/flex/justify_content_column_space_evenly_negative_space.rs b/tests/generated/flex/justify_content_column_space_evenly_negative_space.rs
index 774307682..70266113a 100644
--- a/tests/generated/flex/justify_content_column_space_evenly_negative_space.rs
+++ b/tests/generated/flex/justify_content_column_space_evenly_negative_space.rs
@@ -112,10 +112,10 @@ fn justify_content_column_space_evenly_negative_space() {
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_height(),
-        25f32,
+        50f32,
         "scroll_height of node {:?}. Expected {}. Actual {}",
         node0,
-        25f32,
+        50f32,
         layout.scroll_height()
     );
     #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
@@ -123,7 +123,7 @@ fn justify_content_column_space_evenly_negative_space() {
     assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00, 160f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00, 20f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00, 20f32, location.x);
-    assert_eq!(location.y, -25f32, "y of node {:?}. Expected {}. Actual {}", node00, -25f32, location.y);
+    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00, 0f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
@@ -147,7 +147,7 @@ fn justify_content_column_space_evenly_negative_space() {
     assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01, 160f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01, 20f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01, 20f32, location.x);
-    assert_eq!(location.y, -5f32, "y of node {:?}. Expected {}. Actual {}", node01, -5f32, location.y);
+    assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node01, 20f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
@@ -171,7 +171,7 @@ fn justify_content_column_space_evenly_negative_space() {
     assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02, 160f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02, 20f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02, 20f32, location.x);
-    assert_eq!(location.y, 15f32, "y of node {:?}. Expected {}. Actual {}", node02, 15f32, location.y);
+    assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node02, 40f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
diff --git a/tests/generated/flex/justify_content_column_space_evenly_negative_space_gap.rs b/tests/generated/flex/justify_content_column_space_evenly_negative_space_gap.rs
index 7a69de1b1..1f0a4ba0b 100644
--- a/tests/generated/flex/justify_content_column_space_evenly_negative_space_gap.rs
+++ b/tests/generated/flex/justify_content_column_space_evenly_negative_space_gap.rs
@@ -116,10 +116,10 @@ fn justify_content_column_space_evenly_negative_space_gap() {
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_height(),
-        35f32,
+        70f32,
         "scroll_height of node {:?}. Expected {}. Actual {}",
         node0,
-        35f32,
+        70f32,
         layout.scroll_height()
     );
     #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
@@ -127,7 +127,7 @@ fn justify_content_column_space_evenly_negative_space_gap() {
     assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node00, 160f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00, 20f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00, 20f32, location.x);
-    assert_eq!(location.y, -35f32, "y of node {:?}. Expected {}. Actual {}", node00, -35f32, location.y);
+    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00, 0f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
@@ -151,7 +151,7 @@ fn justify_content_column_space_evenly_negative_space_gap() {
     assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node01, 160f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01, 20f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01, 20f32, location.x);
-    assert_eq!(location.y, -5f32, "y of node {:?}. Expected {}. Actual {}", node01, -5f32, location.y);
+    assert_eq!(location.y, 30f32, "y of node {:?}. Expected {}. Actual {}", node01, 30f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
@@ -175,7 +175,7 @@ fn justify_content_column_space_evenly_negative_space_gap() {
     assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node02, 160f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02, 20f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node02, 20f32, location.x);
-    assert_eq!(location.y, 25f32, "y of node {:?}. Expected {}. Actual {}", node02, 25f32, location.y);
+    assert_eq!(location.y, 60f32, "y of node {:?}. Expected {}. Actual {}", node02, 60f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
diff --git a/tests/generated/grid/grid_align_content_space_around_negative_space_gap.rs b/tests/generated/grid/grid_align_content_space_around_negative_space_gap.rs
index 0dfa41738..3aa4c8d62 100644
--- a/tests/generated/grid/grid_align_content_space_around_negative_space_gap.rs
+++ b/tests/generated/grid/grid_align_content_space_around_negative_space_gap.rs
@@ -74,10 +74,10 @@ fn grid_align_content_space_around_negative_space_gap() {
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_height(),
-        10f32,
+        20f32,
         "scroll_height of node {:?}. Expected {}. Actual {}",
         node,
-        10f32,
+        20f32,
         layout.scroll_height()
     );
     #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
@@ -98,10 +98,10 @@ fn grid_align_content_space_around_negative_space_gap() {
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_height(),
-        10f32,
+        20f32,
         "scroll_height of node {:?}. Expected {}. Actual {}",
         node0,
-        10f32,
+        20f32,
         layout.scroll_height()
     );
     #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
@@ -109,7 +109,7 @@ fn grid_align_content_space_around_negative_space_gap() {
     assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node00, 20f32, size.width);
     assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node00, 40f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00, 20f32, location.x);
-    assert_eq!(location.y, -10f32, "y of node {:?}. Expected {}. Actual {}", node00, -10f32, location.y);
+    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00, 0f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
@@ -133,7 +133,7 @@ fn grid_align_content_space_around_negative_space_gap() {
     assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node01, 20f32, size.width);
     assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node01, 40f32, size.height);
     assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node01, 50f32, location.x);
-    assert_eq!(location.y, -10f32, "y of node {:?}. Expected {}. Actual {}", node01, -10f32, location.y);
+    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node01, 0f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
@@ -157,7 +157,7 @@ fn grid_align_content_space_around_negative_space_gap() {
     assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node02, 20f32, size.width);
     assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node02, 40f32, size.height);
     assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node02, 80f32, location.x);
-    assert_eq!(location.y, -10f32, "y of node {:?}. Expected {}. Actual {}", node02, -10f32, location.y);
+    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node02, 0f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
@@ -181,7 +181,7 @@ fn grid_align_content_space_around_negative_space_gap() {
     assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node03, 20f32, size.width);
     assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node03, 40f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node03, 20f32, location.x);
-    assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node03, 40f32, location.y);
+    assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node03, 50f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
@@ -205,7 +205,7 @@ fn grid_align_content_space_around_negative_space_gap() {
     assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node04, 20f32, size.width);
     assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node04, 40f32, size.height);
     assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node04, 50f32, location.x);
-    assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node04, 40f32, location.y);
+    assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node04, 50f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
@@ -229,7 +229,7 @@ fn grid_align_content_space_around_negative_space_gap() {
     assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node05, 20f32, size.width);
     assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node05, 40f32, size.height);
     assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node05, 80f32, location.x);
-    assert_eq!(location.y, 40f32, "y of node {:?}. Expected {}. Actual {}", node05, 40f32, location.y);
+    assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node05, 50f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
@@ -253,7 +253,7 @@ fn grid_align_content_space_around_negative_space_gap() {
     assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node06, 20f32, size.width);
     assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node06, 40f32, size.height);
     assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node06, 20f32, location.x);
-    assert_eq!(location.y, 90f32, "y of node {:?}. Expected {}. Actual {}", node06, 90f32, location.y);
+    assert_eq!(location.y, 100f32, "y of node {:?}. Expected {}. Actual {}", node06, 100f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
@@ -277,7 +277,7 @@ fn grid_align_content_space_around_negative_space_gap() {
     assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node07, 20f32, size.width);
     assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node07, 40f32, size.height);
     assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node07, 50f32, location.x);
-    assert_eq!(location.y, 90f32, "y of node {:?}. Expected {}. Actual {}", node07, 90f32, location.y);
+    assert_eq!(location.y, 100f32, "y of node {:?}. Expected {}. Actual {}", node07, 100f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
@@ -301,7 +301,7 @@ fn grid_align_content_space_around_negative_space_gap() {
     assert_eq!(size.width, 20f32, "width of node {:?}. Expected {}. Actual {}", node08, 20f32, size.width);
     assert_eq!(size.height, 40f32, "height of node {:?}. Expected {}. Actual {}", node08, 40f32, size.height);
     assert_eq!(location.x, 80f32, "x of node {:?}. Expected {}. Actual {}", node08, 80f32, location.x);
-    assert_eq!(location.y, 90f32, "y of node {:?}. Expected {}. Actual {}", node08, 90f32, location.y);
+    assert_eq!(location.y, 100f32, "y of node {:?}. Expected {}. Actual {}", node08, 100f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
diff --git a/tests/generated/grid/grid_justify_content_space_around_negative_space_gap.rs b/tests/generated/grid/grid_justify_content_space_around_negative_space_gap.rs
index 85b8004b7..942e1d1ff 100644
--- a/tests/generated/grid/grid_justify_content_space_around_negative_space_gap.rs
+++ b/tests/generated/grid/grid_justify_content_space_around_negative_space_gap.rs
@@ -65,10 +65,10 @@ fn grid_justify_content_space_around_negative_space_gap() {
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
-        10f32,
+        20f32,
         "scroll_width of node {:?}. Expected {}. Actual {}",
         node,
-        10f32,
+        20f32,
         layout.scroll_width()
     );
     #[cfg(feature = "content_size")]
@@ -89,10 +89,10 @@ fn grid_justify_content_space_around_negative_space_gap() {
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
-        10f32,
+        20f32,
         "scroll_width of node {:?}. Expected {}. Actual {}",
         node0,
-        10f32,
+        20f32,
         layout.scroll_width()
     );
     #[cfg(feature = "content_size")]
@@ -108,7 +108,7 @@ fn grid_justify_content_space_around_negative_space_gap() {
     let layout @ Layout { size, location, .. } = taffy.layout(node00).unwrap();
     assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node00, 40f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00, 20f32, size.height);
-    assert_eq!(location.x, -10f32, "x of node {:?}. Expected {}. Actual {}", node00, -10f32, location.x);
+    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node00, 0f32, location.x);
     assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node00, 20f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
@@ -132,7 +132,7 @@ fn grid_justify_content_space_around_negative_space_gap() {
     let layout @ Layout { size, location, .. } = taffy.layout(node01).unwrap();
     assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node01, 40f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01, 20f32, size.height);
-    assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node01, 40f32, location.x);
+    assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node01, 50f32, location.x);
     assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node01, 20f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
@@ -156,7 +156,7 @@ fn grid_justify_content_space_around_negative_space_gap() {
     let layout @ Layout { size, location, .. } = taffy.layout(node02).unwrap();
     assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node02, 40f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02, 20f32, size.height);
-    assert_eq!(location.x, 90f32, "x of node {:?}. Expected {}. Actual {}", node02, 90f32, location.x);
+    assert_eq!(location.x, 100f32, "x of node {:?}. Expected {}. Actual {}", node02, 100f32, location.x);
     assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node02, 20f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
@@ -180,7 +180,7 @@ fn grid_justify_content_space_around_negative_space_gap() {
     let layout @ Layout { size, location, .. } = taffy.layout(node03).unwrap();
     assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node03, 40f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node03, 20f32, size.height);
-    assert_eq!(location.x, -10f32, "x of node {:?}. Expected {}. Actual {}", node03, -10f32, location.x);
+    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node03, 0f32, location.x);
     assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node03, 50f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
@@ -204,7 +204,7 @@ fn grid_justify_content_space_around_negative_space_gap() {
     let layout @ Layout { size, location, .. } = taffy.layout(node04).unwrap();
     assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node04, 40f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node04, 20f32, size.height);
-    assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node04, 40f32, location.x);
+    assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node04, 50f32, location.x);
     assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node04, 50f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
@@ -228,7 +228,7 @@ fn grid_justify_content_space_around_negative_space_gap() {
     let layout @ Layout { size, location, .. } = taffy.layout(node05).unwrap();
     assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node05, 40f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node05, 20f32, size.height);
-    assert_eq!(location.x, 90f32, "x of node {:?}. Expected {}. Actual {}", node05, 90f32, location.x);
+    assert_eq!(location.x, 100f32, "x of node {:?}. Expected {}. Actual {}", node05, 100f32, location.x);
     assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node05, 50f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
@@ -252,7 +252,7 @@ fn grid_justify_content_space_around_negative_space_gap() {
     let layout @ Layout { size, location, .. } = taffy.layout(node06).unwrap();
     assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node06, 40f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node06, 20f32, size.height);
-    assert_eq!(location.x, -10f32, "x of node {:?}. Expected {}. Actual {}", node06, -10f32, location.x);
+    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node06, 0f32, location.x);
     assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node06, 80f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
@@ -276,7 +276,7 @@ fn grid_justify_content_space_around_negative_space_gap() {
     let layout @ Layout { size, location, .. } = taffy.layout(node07).unwrap();
     assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node07, 40f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node07, 20f32, size.height);
-    assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node07, 40f32, location.x);
+    assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node07, 50f32, location.x);
     assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node07, 80f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
@@ -300,7 +300,7 @@ fn grid_justify_content_space_around_negative_space_gap() {
     let layout @ Layout { size, location, .. } = taffy.layout(node08).unwrap();
     assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node08, 40f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node08, 20f32, size.height);
-    assert_eq!(location.x, 90f32, "x of node {:?}. Expected {}. Actual {}", node08, 90f32, location.x);
+    assert_eq!(location.x, 100f32, "x of node {:?}. Expected {}. Actual {}", node08, 100f32, location.x);
     assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node08, 80f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
diff --git a/tests/generated/grid/grid_justify_content_space_evenly_negative_space_gap.rs b/tests/generated/grid/grid_justify_content_space_evenly_negative_space_gap.rs
index 2dda64c9c..e1f5d5b29 100644
--- a/tests/generated/grid/grid_justify_content_space_evenly_negative_space_gap.rs
+++ b/tests/generated/grid/grid_justify_content_space_evenly_negative_space_gap.rs
@@ -65,10 +65,10 @@ fn grid_justify_content_space_evenly_negative_space_gap() {
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
-        10f32,
+        20f32,
         "scroll_width of node {:?}. Expected {}. Actual {}",
         node,
-        10f32,
+        20f32,
         layout.scroll_width()
     );
     #[cfg(feature = "content_size")]
@@ -89,10 +89,10 @@ fn grid_justify_content_space_evenly_negative_space_gap() {
     #[cfg(feature = "content_size")]
     assert_eq!(
         layout.scroll_width(),
-        10f32,
+        20f32,
         "scroll_width of node {:?}. Expected {}. Actual {}",
         node0,
-        10f32,
+        20f32,
         layout.scroll_width()
     );
     #[cfg(feature = "content_size")]
@@ -108,7 +108,7 @@ fn grid_justify_content_space_evenly_negative_space_gap() {
     let layout @ Layout { size, location, .. } = taffy.layout(node00).unwrap();
     assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node00, 40f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node00, 20f32, size.height);
-    assert_eq!(location.x, -10f32, "x of node {:?}. Expected {}. Actual {}", node00, -10f32, location.x);
+    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node00, 0f32, location.x);
     assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node00, 20f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
@@ -132,7 +132,7 @@ fn grid_justify_content_space_evenly_negative_space_gap() {
     let layout @ Layout { size, location, .. } = taffy.layout(node01).unwrap();
     assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node01, 40f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node01, 20f32, size.height);
-    assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node01, 40f32, location.x);
+    assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node01, 50f32, location.x);
     assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node01, 20f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
@@ -156,7 +156,7 @@ fn grid_justify_content_space_evenly_negative_space_gap() {
     let layout @ Layout { size, location, .. } = taffy.layout(node02).unwrap();
     assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node02, 40f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node02, 20f32, size.height);
-    assert_eq!(location.x, 90f32, "x of node {:?}. Expected {}. Actual {}", node02, 90f32, location.x);
+    assert_eq!(location.x, 100f32, "x of node {:?}. Expected {}. Actual {}", node02, 100f32, location.x);
     assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node02, 20f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
@@ -180,7 +180,7 @@ fn grid_justify_content_space_evenly_negative_space_gap() {
     let layout @ Layout { size, location, .. } = taffy.layout(node03).unwrap();
     assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node03, 40f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node03, 20f32, size.height);
-    assert_eq!(location.x, -10f32, "x of node {:?}. Expected {}. Actual {}", node03, -10f32, location.x);
+    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node03, 0f32, location.x);
     assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node03, 50f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
@@ -204,7 +204,7 @@ fn grid_justify_content_space_evenly_negative_space_gap() {
     let layout @ Layout { size, location, .. } = taffy.layout(node04).unwrap();
     assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node04, 40f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node04, 20f32, size.height);
-    assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node04, 40f32, location.x);
+    assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node04, 50f32, location.x);
     assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node04, 50f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
@@ -228,7 +228,7 @@ fn grid_justify_content_space_evenly_negative_space_gap() {
     let layout @ Layout { size, location, .. } = taffy.layout(node05).unwrap();
     assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node05, 40f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node05, 20f32, size.height);
-    assert_eq!(location.x, 90f32, "x of node {:?}. Expected {}. Actual {}", node05, 90f32, location.x);
+    assert_eq!(location.x, 100f32, "x of node {:?}. Expected {}. Actual {}", node05, 100f32, location.x);
     assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node05, 50f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
@@ -252,7 +252,7 @@ fn grid_justify_content_space_evenly_negative_space_gap() {
     let layout @ Layout { size, location, .. } = taffy.layout(node06).unwrap();
     assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node06, 40f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node06, 20f32, size.height);
-    assert_eq!(location.x, -10f32, "x of node {:?}. Expected {}. Actual {}", node06, -10f32, location.x);
+    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node06, 0f32, location.x);
     assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node06, 80f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
@@ -276,7 +276,7 @@ fn grid_justify_content_space_evenly_negative_space_gap() {
     let layout @ Layout { size, location, .. } = taffy.layout(node07).unwrap();
     assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node07, 40f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node07, 20f32, size.height);
-    assert_eq!(location.x, 40f32, "x of node {:?}. Expected {}. Actual {}", node07, 40f32, location.x);
+    assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node07, 50f32, location.x);
     assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node07, 80f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(
@@ -300,7 +300,7 @@ fn grid_justify_content_space_evenly_negative_space_gap() {
     let layout @ Layout { size, location, .. } = taffy.layout(node08).unwrap();
     assert_eq!(size.width, 40f32, "width of node {:?}. Expected {}. Actual {}", node08, 40f32, size.width);
     assert_eq!(size.height, 20f32, "height of node {:?}. Expected {}. Actual {}", node08, 20f32, size.height);
-    assert_eq!(location.x, 90f32, "x of node {:?}. Expected {}. Actual {}", node08, 90f32, location.x);
+    assert_eq!(location.x, 100f32, "x of node {:?}. Expected {}. Actual {}", node08, 100f32, location.x);
     assert_eq!(location.y, 80f32, "y of node {:?}. Expected {}. Actual {}", node08, 80f32, location.y);
     #[cfg(feature = "content_size")]
     assert_eq!(