ladybird icon indicating copy to clipboard operation
ladybird copied to clipboard

LibWeb/CSS: If possible, simplify `min()` and `max()` calculations

Open Simek opened this issue 1 year ago • 0 comments

Why

According to the spec, the min() and max() calculation can be simplified, if there is only one child:

  • https://www.w3.org/TR/css-values-4/#calc-simplification (see 5.2)

Should fix few WPT tests, for example:

  • https://wpt.fyi/results/css/css-values/minmax-length-percent-computed.html?label=experimental&product=chrome&product=ladybird

How

Return the sole child string value directly in to_string calls on MinCalculationNode and MaxCalculationNode nodes.

Preview

Screenshot 2024-10-14 at 23 14 19

Simek avatar Oct 14 '24 21:10 Simek