remove incorrect entries from normalization maps

- Remove scale, contain-intrinsic-size, animation-range, text-box-edge
  from isTwoValueShorthand: these have asymmetric or 3-value semantics
  that make "X X" → "X" collapse incorrect.
- Remove line-height from isLengthProperty: bare 0 is the unitless
  number multiplier, not a length (Chrome serializes as "0" not "0px").
- Fix test: background-size "cover cover" is invalid CSS, use "auto auto".
This commit is contained in:
egrs
2026-03-10 14:08:28 +01:00
parent 6a7f7fdf15
commit 4fb2f7474c

View File

@@ -493,11 +493,6 @@ fn isTwoValueShorthand(name: []const u8) bool {
.{ "border-image-repeat", {} }, .{ "border-image-repeat", {} },
.{ "mask-repeat", {} }, .{ "mask-repeat", {} },
.{ "mask-size", {} }, .{ "mask-size", {} },
// Other
.{ "contain-intrinsic-size", {} },
.{ "scale", {} },
.{ "text-box-edge", {} },
.{ "animation-range", {} },
}); });
return shorthands.has(name); return shorthands.has(name);
} }
@@ -567,7 +562,6 @@ fn isLengthProperty(name: []const u8) bool {
.{ "border-bottom-right-radius", {} }, .{ "border-bottom-right-radius", {} },
// Text // Text
.{ "font-size", {} }, .{ "font-size", {} },
.{ "line-height", {} },
.{ "letter-spacing", {} }, .{ "letter-spacing", {} },
.{ "word-spacing", {} }, .{ "word-spacing", {} },
.{ "text-indent", {} }, .{ "text-indent", {} },
@@ -784,7 +778,7 @@ test "normalizePropertyValue: collapse duplicate two-value shorthands" {
.{ "gap", "10px 10px", "10px" }, .{ "gap", "10px 10px", "10px" },
.{ "scroll-snap-align", "start start", "start" }, .{ "scroll-snap-align", "start start", "start" },
.{ "scroll-padding-block", "5px 5px", "5px" }, .{ "scroll-padding-block", "5px 5px", "5px" },
.{ "background-size", "cover cover", "cover" }, .{ "background-size", "auto auto", "auto" },
.{ "overscroll-behavior", "auto auto", "auto" }, .{ "overscroll-behavior", "auto auto", "auto" },
// Different values should NOT collapse // Different values should NOT collapse
.{ "overflow", "hidden scroll", "hidden scroll" }, .{ "overflow", "hidden scroll", "hidden scroll" },