1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 18:10:56 +09:00

LibWeb: Support transform: translate(...) by percentage

This commit is contained in:
Simon Wanner 2022-03-21 23:18:38 +01:00 committed by Andreas Kling
parent bc5d39493b
commit dc94879b83
Notes: sideshowbarker 2024-07-17 16:58:10 +09:00
4 changed files with 43 additions and 32 deletions

View file

@ -329,10 +329,12 @@ Vector<CSS::Transformation> StyleProperties::transformations() const
auto& transformation_style_value = it.as_transformation();
CSS::Transformation transformation;
transformation.function = transformation_style_value.transform_function();
Vector<Variant<CSS::Length, float>> values;
Vector<Variant<CSS::LengthPercentage, float>> values;
for (auto& transformation_value : transformation_style_value.values()) {
if (transformation_value.is_length()) {
values.append({ transformation_value.to_length() });
} else if (transformation_value.is_percentage()) {
values.append({ transformation_value.as_percentage().percentage() });
} else if (transformation_value.is_numeric()) {
values.append({ transformation_value.to_number() });
} else if (transformation_value.is_angle()) {