1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-08 05:27:14 +09:00
ladybird/Libraries/LibWeb/CSS/StyleValues
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
..
AbstractImageStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
AngleStyleValue.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
AngleStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
BackgroundRepeatStyleValue.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
BackgroundRepeatStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
BackgroundSizeStyleValue.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
BackgroundSizeStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
BasicShapeStyleValue.cpp LibWeb: Properly serialize position/edge style values 2024-12-13 11:35:38 +00:00
BasicShapeStyleValue.h LibWeb: Properly serialize position/edge style values 2024-12-13 11:35:38 +00:00
BorderRadiusStyleValue.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
BorderRadiusStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
CalculatedStyleValue.cpp LibWeb/CSS: Use CSSNumericType for CalculationResult's numeric type 2024-12-21 18:14:28 +01:00
CalculatedStyleValue.h LibWeb/CSS: Use CSSNumericType for CalculationResult's numeric type 2024-12-21 18:14:28 +01:00
ConicGradientStyleValue.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
ConicGradientStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
ContentStyleValue.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
ContentStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
CounterDefinitionsStyleValue.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
CounterDefinitionsStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
CounterStyleValue.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
CounterStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
CSSColor.cpp LibWeb/CSS: Correctly serialize the colorspace name of xyz and xyz-d65 2024-12-14 07:43:48 +00:00
CSSColor.h LibWeb/CSS: Serialize CSSColor without relying on RGB 2024-12-11 16:37:22 -07:00
CSSColorValue.cpp Revert "LibWeb/CSS: Rename CalculatedStyleValue -> CSSMathValue" 2024-12-21 18:14:28 +01:00
CSSColorValue.h LibWeb/CSS: Serialize CSSColor without relying on RGB 2024-12-11 16:37:22 -07:00
CSSHSL.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
CSSHSL.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
CSSHWB.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
CSSHWB.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
CSSKeywordValue.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
CSSKeywordValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
CSSLabLike.cpp Revert "LibWeb/CSS: Rename CalculatedStyleValue -> CSSMathValue" 2024-12-21 18:14:28 +01:00
CSSLabLike.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
CSSLCHLike.cpp Revert "LibWeb/CSS: Rename CalculatedStyleValue -> CSSMathValue" 2024-12-21 18:14:28 +01:00
CSSLCHLike.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
CSSNumericValue.h
CSSRGB.cpp Revert "LibWeb/CSS: Rename CalculatedStyleValue -> CSSMathValue" 2024-12-21 18:14:28 +01:00
CSSRGB.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
CSSUnitValue.h
CustomIdentStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
DisplayStyleValue.cpp
DisplayStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
EasingStyleValue.cpp LibWeb: Correct serialization of steps() easing functions 2024-11-18 17:39:03 -05:00
EasingStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
EdgeStyleValue.cpp Revert "LibWeb/CSS: Rename CalculatedStyleValue -> CSSMathValue" 2024-12-21 18:14:28 +01:00
EdgeStyleValue.h LibWeb: Properly serialize position/edge style values 2024-12-13 11:35:38 +00:00
FilterValueListStyleValue.cpp LibWeb+LibGfx: Refactor CSS filters into LibGfx 2024-12-18 18:54:20 +01:00
FilterValueListStyleValue.h LibWeb+LibGfx: Refactor CSS filters into LibGfx 2024-12-18 18:54:20 +01:00
FlexStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
FrequencyStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
GridAutoFlowStyleValue.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
GridAutoFlowStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
GridTemplateAreaStyleValue.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
GridTemplateAreaStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
GridTrackPlacementStyleValue.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
GridTrackPlacementStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
GridTrackSizeListStyleValue.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
GridTrackSizeListStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
ImageStyleValue.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
ImageStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
IntegerStyleValue.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
IntegerStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
LengthStyleValue.cpp
LengthStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
LinearGradientStyleValue.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
LinearGradientStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
MathDepthStyleValue.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
MathDepthStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
NumberStyleValue.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
NumberStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
OpenTypeTaggedStyleValue.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
OpenTypeTaggedStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
PercentageStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
PositionStyleValue.cpp LibWeb: Properly serialize position/edge style values 2024-12-13 11:35:38 +00:00
PositionStyleValue.h LibWeb: Properly serialize position/edge style values 2024-12-13 11:35:38 +00:00
RadialGradientStyleValue.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
RadialGradientStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
RatioStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
RectStyleValue.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
RectStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
ResolutionStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
RotationStyleValue.cpp Revert "LibWeb/CSS: Rename CalculatedStyleValue -> CSSMathValue" 2024-12-21 18:14:28 +01:00
RotationStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
ScaleStyleValue.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
ScaleStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
ScrollbarGutterStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
ShadowStyleValue.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
ShadowStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
ShorthandStyleValue.cpp LibWeb: Style font-variant-* css properties 2024-12-17 19:07:13 +01:00
ShorthandStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
StringStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
StyleValueList.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
StyleValueList.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
TimeStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
TransformationStyleValue.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
TransformationStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
TransitionStyleValue.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
TransitionStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
TranslationStyleValue.cpp Revert "LibWeb/CSS: Rename CalculatedStyleValue -> CSSMathValue" 2024-12-21 18:14:28 +01:00
TranslationStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
UnresolvedStyleValue.cpp LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
UnresolvedStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00
URLStyleValue.h LibWeb: Add mode flag to CSSStyleValue::to_string() 2024-12-07 08:31:03 +00:00