diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2023-05-24 17:44:12 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-05-25 06:36:10 +0200 |
commit | 7e8ed996c9f54e7a692e75fc535a86d7eee6d97f (patch) | |
tree | c2a851899a99ce86e6fb6566125286eb08709f18 | |
parent | f759a160875dc027c20571bc9bb740422a63c485 (diff) | |
download | serenity-7e8ed996c9f54e7a692e75fc535a86d7eee6d97f.zip |
LibWeb: Use new StyleValue parsing for transform-origin
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index 379f40cbd3..73b87230dd 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -6265,9 +6265,10 @@ ErrorOr<RefPtr<StyleValue>> Parser::parse_transform_origin_value(Vector<Componen return StyleValueList::create(move(values), StyleValueList::Separator::Space); }; + auto tokens = TokenStream { component_values }; switch (component_values.size()) { case 1: { - auto single_value = TRY(to_axis_offset(TRY(parse_css_value(component_values[0])))); + auto single_value = TRY(to_axis_offset(TRY(parse_css_value_for_property(PropertyID::TransformOrigin, tokens)))); if (!single_value.has_value()) return nullptr; // If only one value is specified, the second value is assumed to be center. @@ -6282,8 +6283,8 @@ ErrorOr<RefPtr<StyleValue>> Parser::parse_transform_origin_value(Vector<Componen VERIFY_NOT_REACHED(); } case 2: { - auto first_value = TRY(to_axis_offset(TRY(parse_css_value(component_values[0])))); - auto second_value = TRY(to_axis_offset(TRY(parse_css_value(component_values[1])))); + auto first_value = TRY(to_axis_offset(TRY(parse_css_value_for_property(PropertyID::TransformOrigin, tokens)))); + auto second_value = TRY(to_axis_offset(TRY(parse_css_value_for_property(PropertyID::TransformOrigin, tokens)))); if (!first_value.has_value() || !second_value.has_value()) return nullptr; |