LibWeb: Don't resolve calc'd opacity percentages at parse time

This behaviour should only apply to literal percentages as clarified
here: https://github.com/w3c/csswg-drafts/commit/4ee8429

We were also doing this wrong by converting the numeric type of the calc
to Length which was causing values to be defaulted to 1 instead (hence
the new passing tests for computed values as well)
This commit is contained in:
Callum Law
2025-09-07 23:32:06 +12:00
committed by Tim Ledbetter
parent d53668b376
commit 246a1c41ff
Notes: github-actions[bot] 2025-09-08 10:07:16 +00:00
6 changed files with 29 additions and 42 deletions

View File

@@ -2,14 +2,13 @@ Harness status: OK
Found 12 tests
11 Pass
1 Fail
12 Pass
Pass testing tab-size: calc(2 * 3)
Pass testing tab-size: calc(2 * -4)
Pass testing opacity: calc(2 / 4)
Pass testing tab-size: calc(2 / 4)
Pass testing opacity: calc(2 / 4) * 1px
Fail testing opacity: calc(90%)
Pass testing opacity: calc(90%)
Pass testing tab-size: calc(1 + 1px)
Pass testing tab-size: calc(1 + 100%)
Pass testing tab-size: calc(100%)