mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 10:18:15 +09:00
LibWeb: Use new StyleValue parsing for transform-origin
This commit is contained in:
parent
f759a16087
commit
7e8ed996c9
Notes:
sideshowbarker
2024-07-17 09:41:18 +09:00
Author: https://github.com/AtkinsSJ
Commit: 7e8ed996c9
Pull-request: https://github.com/SerenityOS/serenity/pull/19028
1 changed files with 4 additions and 3 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue