From 7412b80c975bcabdea6a24c1b5c5be75e7d142b1 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Fri, 9 Oct 2026 00:06:16 +0000 Subject: [PATCH 1/3] Bump Taffy to fix default block alignment safety --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4c29ac0564..858e482b38 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8011,7 +8011,7 @@ dependencies = [ [[package]] name = "taffy" version = "0.14.0" -source = "git+https://github.com/DioxusLabs/taffy?rev=c8b7261edccc660f5fabf41a9d86ae5893a20791#c8b7261edccc660f5fabf41a9d86ae5893a20791" +source = "git+https://github.com/DioxusLabs/taffy?rev=60aafc96a959a63077c842653c63d94cac838859#60aafc96a959a63077c842653c63d94cac838859" dependencies = [ "serde", "slotmap", diff --git a/Cargo.toml b/Cargo.toml index ccafabb30a..34c55d3083 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -98,7 +98,7 @@ dioxus-cli-config = { version = "0.7.3" } dioxus-core-macro = { version = "0.7.3" } # Taffy + Parley + Fontations -taffy = { git = "https://github.com/DioxusLabs/taffy", rev = "c8b7261edccc660f5fabf41a9d86ae5893a20791", default-features = false, features = [ +taffy = { git = "https://github.com/DioxusLabs/taffy", rev = "60aafc96a959a63077c842653c63d94cac838859", default-features = false, features = [ "std", "flexbox", "flexbox_balance", From 229bc9f9ffc0c4c62be4daf8422923ae27e549d4 Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Fri, 9 Oct 2026 00:20:35 +0000 Subject: [PATCH 2/3] Preserve explicit unsafe content alignment when updating Taffy --- Cargo.lock | 2 +- Cargo.toml | 2 +- packages/stylo_taffy/src/convert.rs | 39 +++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 858e482b38..0d4fd439b1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8011,7 +8011,7 @@ dependencies = [ [[package]] name = "taffy" version = "0.14.0" -source = "git+https://github.com/DioxusLabs/taffy?rev=60aafc96a959a63077c842653c63d94cac838859#60aafc96a959a63077c842653c63d94cac838859" +source = "git+https://github.com/DioxusLabs/taffy?rev=b7c31935de663d9293d5d51ccd4ccbfd4e045127#b7c31935de663d9293d5d51ccd4ccbfd4e045127" dependencies = [ "serde", "slotmap", diff --git a/Cargo.toml b/Cargo.toml index 34c55d3083..0e2dfb1e7e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -98,7 +98,7 @@ dioxus-cli-config = { version = "0.7.3" } dioxus-core-macro = { version = "0.7.3" } # Taffy + Parley + Fontations -taffy = { git = "https://github.com/DioxusLabs/taffy", rev = "60aafc96a959a63077c842653c63d94cac838859", default-features = false, features = [ +taffy = { git = "https://github.com/DioxusLabs/taffy", rev = "b7c31935de663d9293d5d51ccd4ccbfd4e045127", default-features = false, features = [ "std", "flexbox", "flexbox_balance", diff --git a/packages/stylo_taffy/src/convert.rs b/packages/stylo_taffy/src/convert.rs index c8e24e3960..8fae8f17c8 100644 --- a/packages/stylo_taffy/src/convert.rs +++ b/packages/stylo_taffy/src/convert.rs @@ -461,6 +461,8 @@ pub fn content_alignment( || (is_block_container && !primary.flags().contains(stylo::AlignFlags::UNSAFE)); if safe { align.safety = taffy::AlignmentSafety::Safe; + } else if primary.flags().contains(stylo::AlignFlags::UNSAFE) { + align.safety = taffy::AlignmentSafety::Unsafe; } align } @@ -1074,3 +1076,40 @@ pub fn to_taffy_style(style: &stylo::ComputedValues) -> taffy::Style { }, } } + +#[cfg(test)] +mod tests { + use super::{content_alignment, stylo}; + use taffy::{AlignContent, AlignmentSafety}; + + #[test] + fn content_alignment_preserves_explicit_safety() { + for (display, default_safety) in [ + (stylo::Display::Block, AlignmentSafety::Safe), + (stylo::Display::InlineBlock, AlignmentSafety::Safe), + (stylo::Display::TableCell, AlignmentSafety::Safe), + (stylo::Display::Flex, AlignmentSafety::Default), + (stylo::Display::Grid, AlignmentSafety::Default), + ] { + for (position, alignment) in [ + (stylo::AlignFlags::END, AlignContent::END), + (stylo::AlignFlags::FLEX_END, AlignContent::FLEX_END), + (stylo::AlignFlags::CENTER, AlignContent::CENTER), + ] { + for (modifier, safety) in [ + (stylo::AlignFlags::empty(), default_safety), + (stylo::AlignFlags::SAFE, AlignmentSafety::Safe), + (stylo::AlignFlags::UNSAFE, AlignmentSafety::Unsafe), + ] { + assert_eq!( + content_alignment( + stylo::ContentDistribution::new(position | modifier), + display + ), + alignment.with_safety(safety) + ); + } + } + } + } +} From fcd5f863c5aded3ac9577af0caea3be12dbe2f2c Mon Sep 17 00:00:00 2001 From: Nico Burns Date: Fri, 9 Oct 2026 00:38:37 +0000 Subject: [PATCH 3/3] Refresh Taffy pin with alignment safety documentation --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0d4fd439b1..0cf7006b4e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8011,7 +8011,7 @@ dependencies = [ [[package]] name = "taffy" version = "0.14.0" -source = "git+https://github.com/DioxusLabs/taffy?rev=b7c31935de663d9293d5d51ccd4ccbfd4e045127#b7c31935de663d9293d5d51ccd4ccbfd4e045127" +source = "git+https://github.com/DioxusLabs/taffy?rev=fe82ebde9bedb5c7ea504bd7bec576f53c43aaec#fe82ebde9bedb5c7ea504bd7bec576f53c43aaec" dependencies = [ "serde", "slotmap", diff --git a/Cargo.toml b/Cargo.toml index 0e2dfb1e7e..9378fed861 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -98,7 +98,7 @@ dioxus-cli-config = { version = "0.7.3" } dioxus-core-macro = { version = "0.7.3" } # Taffy + Parley + Fontations -taffy = { git = "https://github.com/DioxusLabs/taffy", rev = "b7c31935de663d9293d5d51ccd4ccbfd4e045127", default-features = false, features = [ +taffy = { git = "https://github.com/DioxusLabs/taffy", rev = "fe82ebde9bedb5c7ea504bd7bec576f53c43aaec", default-features = false, features = [ "std", "flexbox", "flexbox_balance",