Revert "LibWeb: Cache intrinsic sizes across layout runs"

This reverts commit 12c6ac78e2.

Very large performance regression when viewing GitHub repository pages.
This commit is contained in:
Andreas Kling 2025-03-08 12:08:51 +01:00
parent 12c6ac78e2
commit 73a4b176cf
Notes: github-actions[bot] 2025-03-08 11:10:16 +00:00
13 changed files with 102 additions and 108 deletions

View file

@ -1405,7 +1405,7 @@ void Node::set_needs_layout_tree_update(bool value)
break;
ancestor->m_child_needs_layout_tree_update = true;
}
set_needs_layout_update(SetNeedsLayoutReason::LayoutTreeUpdate);
document().set_needs_layout(SetNeedsLayoutReason::LayoutTreeUpdate);
}
}
@ -1425,27 +1425,6 @@ void Node::set_needs_style_update(bool value)
}
}
void Node::set_needs_layout_update(SetNeedsLayoutReason reason)
{
if (m_needs_layout_update)
return;
if constexpr (UPDATE_LAYOUT_DEBUG) {
// NOTE: We check some conditions here to avoid debug spam in documents that don't do layout.
auto navigable = this->navigable();
if (navigable && navigable->active_document() == this)
dbgln_if(UPDATE_LAYOUT_DEBUG, "NEED LAYOUT {}", to_string(reason));
}
m_needs_layout_update = true;
for (auto* ancestor = parent_or_shadow_host(); ancestor; ancestor = ancestor->parent_or_shadow_host()) {
if (ancestor->m_needs_layout_update)
break;
ancestor->m_needs_layout_update = true;
}
}
void Node::post_connection()
{
}