-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
8d40550
commit eb11c35
Showing
7 changed files
with
439 additions
and
1,161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.