mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:07:44 +00:00
LibWeb: Don't update style/layout in template contents owner documents
These helper documents don't actually get rendered, so computing style and doing layout for them is a complete waste of work.
This commit is contained in:
parent
64d5d633cf
commit
ba6a9318c3
1 changed files with 9 additions and 0 deletions
|
@ -809,6 +809,10 @@ void Document::update_layout()
|
||||||
if (!m_needs_layout && m_layout_root)
|
if (!m_needs_layout && m_layout_root)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// NOTE: If this is a document hosting <template> contents, layout is unnecessary.
|
||||||
|
if (m_created_for_appropriate_template_contents)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!browsing_context())
|
if (!browsing_context())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -886,6 +890,11 @@ void Document::update_style()
|
||||||
return;
|
return;
|
||||||
if (!needs_full_style_update() && !needs_style_update() && !child_needs_style_update())
|
if (!needs_full_style_update() && !needs_style_update() && !child_needs_style_update())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// NOTE: If this is a document hosting <template> contents, style update is unnecessary.
|
||||||
|
if (m_created_for_appropriate_template_contents)
|
||||||
|
return;
|
||||||
|
|
||||||
evaluate_media_rules();
|
evaluate_media_rules();
|
||||||
if (update_style_recursively(*this))
|
if (update_style_recursively(*this))
|
||||||
invalidate_layout();
|
invalidate_layout();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue