ladybird/Libraries/LibWeb/CSS/Parser
Sam Atkins eb11c35640 LibWeb/CSS: Use CSSNumericType for CalculationResult's numeric type
When we originally implemented calc(), the result of a calculation was
guaranteed to be a single CSS type like a Length or Angle. However, CSS
Values 4 now allows more complex type arithmetic, which is represented
by the CSSNumericType class. Using that directly makes us more correct,
and allows us to remove a large amount of now ad-hoc code.

Unfortunately this is a large commit but the changes it makes are
interconnected enough that doing one at a time causes test
regressions.

In no particular order:

- Update our "determine the type of a calculation" code to match the
  newest spec, which sets percent hints in a couple more cases. (One of
  these we're skipping for now, I think it fails because of the FIXMEs
  in CSSNumericType::matches_foo().)
- Make the generated math-function-parsing code aware of the difference
  between arguments being the same type, and being "consistent" types,
  for each function. Otherwise those extra percent hints would cause
  them to fail validation incorrectly.
- Use the CSSNumericType as the type for the CalculationResult.
- Calculate and assign each math function's type in its constructor,
  instead of calculating it repeatedly on-demand.

The `CalculationNode::resolved_type()` method is now entirely unused and
has been removed.
2024-12-21 18:14:28 +01:00
..
ComponentValue.cpp Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
ComponentValue.h Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Dimension.h LibWeb/CSS: Add Parser::Dimension::to_string() 2024-12-18 12:21:22 +00:00
GradientParsing.cpp Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Helpers.cpp Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
MediaParsing.cpp LibWeb/CSS: Pass Length::ResolutionContext to resolve_integer 2024-12-04 12:26:50 +00:00
Parser.cpp LibWeb/CSS: Use CSSNumericType for CalculationResult's numeric type 2024-12-21 18:14:28 +01:00
Parser.h LibWeb/CSS: Use CSSNumericType for CalculationResult's numeric type 2024-12-21 18:14:28 +01:00
ParsingContext.cpp LibWeb/CSS: Make ParsingContext's Realm optional 2024-12-05 19:59:57 +01:00
ParsingContext.h LibWeb/CSS: Make ParsingContext's Realm optional 2024-12-05 19:59:57 +01:00
RuleParsing.cpp Revert "LibWeb/CSS: Rename CalculatedStyleValue -> CSSMathValue" 2024-12-21 18:14:28 +01:00
SelectorParsing.cpp LibWeb: Require CSS combinators to be followed by a simple selector 2024-11-23 09:49:33 +01:00
Token.cpp Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Token.h Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Tokenizer.cpp LibWeb: Move CSS character type definitions to new header 2024-12-02 16:19:47 +00:00
Tokenizer.h Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
TokenStream.h Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Types.cpp Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Types.h Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00