mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03: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:
parent
c988cbb8b1
commit
bca3c2a443
Notes:
sideshowbarker
2024-07-17 17:39:23 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/bca3c2a443
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user