mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 19:27:45 +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:
parent
c988cbb8b1
commit
bca3c2a443
1 changed files with 2 additions and 2 deletions
|
@ -554,6 +554,8 @@ void Document::ensure_layout()
|
||||||
|
|
||||||
void Document::update_layout()
|
void Document::update_layout()
|
||||||
{
|
{
|
||||||
|
update_style();
|
||||||
|
|
||||||
if (!m_needs_layout && m_layout_root)
|
if (!m_needs_layout && m_layout_root)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -562,8 +564,6 @@ void Document::update_layout()
|
||||||
|
|
||||||
auto viewport_rect = browsing_context()->viewport_rect();
|
auto viewport_rect = browsing_context()->viewport_rect();
|
||||||
|
|
||||||
update_style();
|
|
||||||
|
|
||||||
if (!m_layout_root) {
|
if (!m_layout_root) {
|
||||||
Layout::TreeBuilder tree_builder;
|
Layout::TreeBuilder tree_builder;
|
||||||
m_layout_root = static_ptr_cast<Layout::InitialContainingBlock>(tree_builder.build(*this));
|
m_layout_root = static_ptr_cast<Layout::InitialContainingBlock>(tree_builder.build(*this));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue