mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibWeb: Remove CalculatedStyleValue from Angle
...and replace it with AngleOrCalculated. This has the nice bonus effect of actually handling `calc()` for angles in a transform function. :^) (Previously we just would have asserted.)
This commit is contained in:
parent
fa90a3bb4f
commit
7a1a97f153
Notes:
sideshowbarker
2024-07-16 22:10:48 +09:00
Author: https://github.com/AtkinsSJ
Commit: 7a1a97f153
Pull-request: https://github.com/SerenityOS/serenity/pull/18104
6 changed files with 9 additions and 37 deletions
|
@ -20,6 +20,7 @@
|
|||
#include <LibWeb/CSS/CSSStyleRule.h>
|
||||
#include <LibWeb/CSS/CSSStyleSheet.h>
|
||||
#include <LibWeb/CSS/CSSSupportsRule.h>
|
||||
#include <LibWeb/CSS/CalculatedOr.h>
|
||||
#include <LibWeb/CSS/MediaList.h>
|
||||
#include <LibWeb/CSS/Parser/Block.h>
|
||||
#include <LibWeb/CSS/Parser/ComponentValue.h>
|
||||
|
@ -5780,7 +5781,7 @@ RefPtr<StyleValue> Parser::parse_transform_value(Vector<ComponentValue> const& c
|
|||
case TransformFunctionParameterType::Angle: {
|
||||
// These are `<angle> | <zero>` in the spec, so we have to check for both kinds.
|
||||
if (maybe_calc_value && maybe_calc_value->resolves_to_angle()) {
|
||||
values.append(AngleStyleValue::create(Angle::make_calculated(maybe_calc_value.release_nonnull())));
|
||||
values.append(maybe_calc_value.release_nonnull());
|
||||
} else if (value.is(Token::Type::Number) && value.token().number_value() == 0) {
|
||||
values.append(AngleStyleValue::create(Angle::make_degrees(0)));
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue