LibWeb: Invalidate layout tree on CSS position property change

When position changes, we may need to make larger structural updates
to the layout tree. A simple relayout is not sufficient.

This was a source of flakiness in the engine, and gives us at least
+28 new WPT subtest passes.
This commit is contained in:
Andreas Kling 2025-05-20 12:03:44 +02:00 committed by Andreas Kling
parent f66c55138b
commit 821d54de7f
Notes: github-actions[bot] 2025-05-20 11:29:55 +00:00
2 changed files with 32 additions and 32 deletions

View file

@ -18,9 +18,9 @@ RequiredInvalidationAfterStyleChange compute_property_invalidation(CSS::Property
if (!property_value_changed)
return invalidation;
// NOTE: If the computed CSS display, content, or content-visibility property changes, we have to rebuild the entire layout tree.
// NOTE: If the computed CSS display, position, content, or content-visibility property changes, we have to rebuild the entire layout tree.
// In the future, we should figure out ways to rebuild a smaller part of the tree.
if (AK::first_is_one_of(property_id, CSS::PropertyID::Display, CSS::PropertyID::Content, CSS::PropertyID::ContentVisibility)) {
if (AK::first_is_one_of(property_id, CSS::PropertyID::Display, CSS::PropertyID::Position, CSS::PropertyID::Content, CSS::PropertyID::ContentVisibility)) {
return RequiredInvalidationAfterStyleChange::full();
}