1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:07:35 +00:00

LibWeb: Always relayout document on element style change

Let's get this right before trying to make it fast. This patch removes
the code that tried to do less work when an element's style changes,
and instead simply invalidates the entire document.

Note that invalidations are still coalesced, and will not be
synchronized until update_style() and/or update_layout() is used.
This commit is contained in:
Andreas Kling 2022-03-09 17:57:45 +01:00
parent bca3c2a443
commit 6499cf4d28
3 changed files with 9 additions and 64 deletions

View file

@ -546,10 +546,9 @@ void Document::force_layout()
update_layout();
}
void Document::ensure_layout()
void Document::invalidate_layout()
{
if (m_needs_layout || !m_layout_root)
update_layout();
tear_down_layout_tree();
}
void Document::update_layout()