From 4fb2f7474ca3b859fd58c1d8e0f69aca6e632acb Mon Sep 17 00:00:00 2001 From: egrs Date: Tue, 10 Mar 2026 14:08:28 +0100 Subject: [PATCH] remove incorrect entries from normalization maps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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". --- src/browser/webapi/css/CSSStyleDeclaration.zig | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/browser/webapi/css/CSSStyleDeclaration.zig b/src/browser/webapi/css/CSSStyleDeclaration.zig index 2430f0c4..ebaafbe0 100644 --- a/src/browser/webapi/css/CSSStyleDeclaration.zig +++ b/src/browser/webapi/css/CSSStyleDeclaration.zig @@ -493,11 +493,6 @@ fn isTwoValueShorthand(name: []const u8) bool { .{ "border-image-repeat", {} }, .{ "mask-repeat", {} }, .{ "mask-size", {} }, - // Other - .{ "contain-intrinsic-size", {} }, - .{ "scale", {} }, - .{ "text-box-edge", {} }, - .{ "animation-range", {} }, }); return shorthands.has(name); } @@ -567,7 +562,6 @@ fn isLengthProperty(name: []const u8) bool { .{ "border-bottom-right-radius", {} }, // Text .{ "font-size", {} }, - .{ "line-height", {} }, .{ "letter-spacing", {} }, .{ "word-spacing", {} }, .{ "text-indent", {} }, @@ -784,7 +778,7 @@ test "normalizePropertyValue: collapse duplicate two-value shorthands" { .{ "gap", "10px 10px", "10px" }, .{ "scroll-snap-align", "start start", "start" }, .{ "scroll-padding-block", "5px 5px", "5px" }, - .{ "background-size", "cover cover", "cover" }, + .{ "background-size", "auto auto", "auto" }, .{ "overscroll-behavior", "auto auto", "auto" }, // Different values should NOT collapse .{ "overflow", "hidden scroll", "hidden scroll" },