serenity
serenity copied to clipboard
LibWeb: Support calc(...) in box-shadow's values of type Length
The CSS box-shadow property takes 2-4 properties that are <length>s, those being:
- offset-x
- offset-y
- blur-radius
- spread-radius
Previously these were resolved directly to concrete Lengths at parse time, but now they will be parsed as LengthStyleValues and/or CalculatedStyleValues and be stored that way until styles are later resolved.
Note: Optimally the test's expected value (#000000ff 0px calc(5px + (0 - 10px)) 0px calc(2px + 3px)) would definitely have the calc(...)'s resolved, but I'm unsure if this is a flaw in my patch or our current implementation of getComputedStyle. If it's the latter, I think this test can simply be updated later with the correctly resolved values.
Before:
After: