Fix use of color channel keywords in calc() division denominators
The calc expression parser was enforcing a restriction that the
denominator must be a number, and depending on this restriction to
simplify divisions at parse time. This restriction was specified in
css-values-3 but relaxed in css-values-4.
Prior to crrev.com/c/5825542, when a color channel keyword was used
in a calc() expression, we would eagerly substitute in the numeric value
as soon as we encountered the keyword token. As a result, the parsed
expression would satisfy the restriction and the expression would be
accepted. As of that change, we now do the value substitution later in
order to preserve the originally specified form.
The fix is to relax the type restriction in code, which necessitates
implementing support for Invert nodes in calculation expression trees
as specified in css-values-4.
This CL also re-enables CSSRelativeColorLateResolveAlways, which had
been disabled in crrev.com/c/5912180 due to this bug.
Bug: 371224775
Change-Id: Ia9b08030a08a64023b166abbd332e8c6db9043d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5909795
Reviewed-by: Rune Lillesveen futhark@chromium.org
Commit-Queue: Kevin Babbitt kbabbitt@microsoft.com
Cr-Commit-Position: refs/heads/main@{#1369108}