From 3d4528724bca7062f8c39d879ac45f342a3291c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Fri, 24 Nov 2023 08:47:56 +0000 Subject: [PATCH] Fix sign() type checking. Make sure we don't parse units whose sign is not resolvable without a basis (i.e. percentages when they're not allowed). Also make sure that we type check the sum so that we don't parse bogus operations. Make the length resolution code not crash in release builds. Differential Revision: https://phabricator.services.mozilla.com/D194500 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1866246 gecko-commit: 4b4afdd073f8bf99d995c26e1823b5b24feb07e4 gecko-reviewers: tlouw, firefox-style-system-reviewers, jwatt --- css/css-values/signs-abs-invalid.html | 48 ++++++++++++++++++--------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/css/css-values/signs-abs-invalid.html b/css/css-values/signs-abs-invalid.html index 15b058d0c42bad..ccb94c21c232eb 100644 --- a/css/css-values/signs-abs-invalid.html +++ b/css/css-values/signs-abs-invalid.html @@ -8,7 +8,16 @@ \ No newline at end of file +test_invalid_number('abs(1%)'); +test_invalid_number('sign(10px + 5rad)'); +test_invalid_number('sign(10%)'); +test_invalid_length('abs(10%)'); +test_invalid_length('1px * sign(10%)'); +test_invalid_length('1px * sign(1em + 10%)'); +test_invalid_length_percentage('1px * sign(10px + 5rad)'); +