Skip to content

Commit

Permalink
Flush size properties when we hit an unparsed value
Browse files Browse the repository at this point in the history
Fixes #805, closes #838
  • Loading branch information
devongovett committed Nov 3, 2024
1 parent 6cb5776 commit 22a8b6f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3966,6 +3966,15 @@ mod tests {
minify_test(".foo { aspect-ratio: 2 / 3 }", ".foo{aspect-ratio:2/3}");
minify_test(".foo { aspect-ratio: auto 2 / 3 }", ".foo{aspect-ratio:auto 2/3}");
minify_test(".foo { aspect-ratio: 2 / 3 auto }", ".foo{aspect-ratio:auto 2/3}");

minify_test(
".foo { width: 200px; width: var(--foo); }",
".foo{width:200px;width:var(--foo)}",
);
minify_test(
".foo { width: var(--foo); width: 200px; }",
".foo{width:var(--foo);width:200px}",
);
}

#[test]
Expand Down
1 change: 1 addition & 0 deletions src/properties/size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ impl<'i> PropertyHandler<'i> for SizeHandler {
Property::MinInlineSize(size) => property!(min_inline_size, size, Logical),
Property::MaxInlineSize(size) => property!(max_inline_size, size, Logical),
Property::Unparsed(unparsed) => {
self.flush(dest, context);
macro_rules! logical_unparsed {
($physical: ident) => {
if logical_supported {
Expand Down

0 comments on commit 22a8b6f

Please sign in to comment.