Set default back to 0%

Signed-off-by: Nico Burns <nico@nicoburns.com>
This commit is contained in:
Nico Burns 2025-05-30 19:10:31 +01:00
parent 9509a19dc7
commit cc64da821b
2 changed files with 2 additions and 1 deletions

View file

@ -320,6 +320,7 @@ impl taffy::LayoutGridContainer for TaffyContainerContext<'_> {
) -> Self::GridItemStyle<'_> { ) -> Self::GridItemStyle<'_> {
let id = usize::from(child_node_id); let id = usize::from(child_node_id);
let child = (*self.source_child_nodes[id]).borrow(); let child = (*self.source_child_nodes[id]).borrow();
// TODO: account for non-replaced elements that are "compressible replaced"
let is_replaced = child.is_in_flow_replaced(); let is_replaced = child.is_in_flow_replaced();
let stylo_style = AtomicRef::map(child, |c| &*c.style); let stylo_style = AtomicRef::map(child, |c| &*c.style);
TaffyStyloStyle::new(stylo_style, is_replaced) TaffyStyloStyle::new(stylo_style, is_replaced)

View file

@ -41,7 +41,7 @@ pub fn length_percentage(val: &stylo::LengthPercentage) -> taffy::LengthPercenta
match val.unpack() { match val.unpack() {
stylo::UnpackedLengthPercentage::Length(len) => length(len.px()), stylo::UnpackedLengthPercentage::Length(len) => length(len.px()),
stylo::UnpackedLengthPercentage::Percentage(percentage) => percent(percentage.0), stylo::UnpackedLengthPercentage::Percentage(percentage) => percent(percentage.0),
stylo::UnpackedLengthPercentage::Calc(_) => length(0.0), stylo::UnpackedLengthPercentage::Calc(_) => percent(0.0),
} }
} }