LibWeb: Don't drop entire layout tree for SVG element transform changes

A partial update is enough here and avoids a lot of work.

Dramatically reduces time spent on relayouts on https://duolingo.com/
This commit is contained in:
Andreas Kling 2025-03-24 23:05:02 +00:00 committed by Jelle Raaijmakers
parent dc56435ecd
commit 305a5ad30b
Notes: github-actions[bot] 2025-03-25 07:32:56 +00:00
2 changed files with 1 additions and 3 deletions

View file

@ -45,8 +45,7 @@ void SVGGraphicsElement::attribute_changed(FlyString const& name, Optional<Strin
auto transform_list = AttributeParser::parse_transform(value.value_or(String {}));
if (transform_list.has_value())
m_transform = transform_from_transform_list(*transform_list);
// FIXME: This should only invalidate the contents of the SVG.
document().invalidate_layout_tree(DOM::InvalidateLayoutTreeReason::SVGGraphicsElementTransformAttributeChange);
set_needs_layout_tree_update(true);
}
}