diff options
Diffstat (limited to 'Libraries/LibWeb/DOM/Document.cpp')
-rw-r--r-- | Libraries/LibWeb/DOM/Document.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Libraries/LibWeb/DOM/Document.cpp b/Libraries/LibWeb/DOM/Document.cpp index 058c702d29..0816775695 100644 --- a/Libraries/LibWeb/DOM/Document.cpp +++ b/Libraries/LibWeb/DOM/Document.cpp @@ -196,14 +196,22 @@ URL Document::complete_url(const String& string) const return m_url.complete_url(string); } -void Document::force_layout() +void Document::invalidate_layout() { m_layout_root = nullptr; +} + +void Document::force_layout() +{ + invalidate_layout(); layout(); } void Document::layout() { + if (!frame()) + return; + if (!m_layout_root) { LayoutTreeBuilder tree_builder; m_layout_root = tree_builder.build(*this); |