LibWeb: Support individual translate CSS property

This commit is contained in:
Andreas Kling 2024-11-22 16:42:20 +01:00 committed by Andreas Kling
commit 66a821e731
Notes: github-actions[bot] 2024-11-22 19:07:48 +00:00
22 changed files with 267 additions and 80 deletions

View file

@ -82,6 +82,8 @@ bool Node::can_contain_boxes_with_position_absolute() const
// Any computed value other than none for the transform affects containing block and stacking context
if (!computed_values().transformations().is_empty())
return true;
if (computed_values().translate().has_value())
return true;
if (computed_values().rotate().has_value())
return true;
@ -177,6 +179,9 @@ bool Node::establishes_stacking_context() const
if (!computed_values().transformations().is_empty())
return true;
if (computed_values().translate().has_value())
return true;
if (computed_values().rotate().has_value())
return true;
@ -717,6 +722,9 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& computed_style)
if (auto rotate_value = computed_style.rotate(*this); rotate_value.has_value())
computed_values.set_rotate(rotate_value.release_value());
if (auto translate_value = computed_style.translate(); translate_value.has_value())
computed_values.set_translate(translate_value.release_value());
computed_values.set_transformations(computed_style.transformations());
if (auto transform_box = computed_style.transform_box(); transform_box.has_value())
computed_values.set_transform_box(transform_box.value());