mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-05-27 13:38:28 +00:00
LibWeb: Always call update_style() in update_layout()
If the style is dirty, update_style() may cause layout to become dirty. Therefore we must always update style when updating layout, to ensure up-to-date results.
This commit is contained in:
@@ -554,6 +554,8 @@ void Document::ensure_layout()
|
||||
|
||||
void Document::update_layout()
|
||||
{
|
||||
update_style();
|
||||
|
||||
if (!m_needs_layout && m_layout_root)
|
||||
return;
|
||||
|
||||
@@ -562,8 +564,6 @@ void Document::update_layout()
|
||||
|
||||
auto viewport_rect = browsing_context()->viewport_rect();
|
||||
|
||||
update_style();
|
||||
|
||||
if (!m_layout_root) {
|
||||
Layout::TreeBuilder tree_builder;
|
||||
m_layout_root = static_ptr_cast<Layout::InitialContainingBlock>(tree_builder.build(*this));
|
||||
|
||||
Reference in New Issue
Block a user