mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:37:45 +00:00
LibWeb: Layout browsing context parent before its children
When updating layout inside a nested browsing context, try first to perform layout in the parent document (the nested browsing context's container's document). This ensures that nested browsing contexts have the right viewport dimensions in case the parent layout changes them somehow.
This commit is contained in:
parent
6ac3bf2982
commit
07a4d590dd
1 changed files with 5 additions and 0 deletions
|
@ -551,6 +551,11 @@ void Document::invalidate_layout()
|
|||
|
||||
void Document::update_layout()
|
||||
{
|
||||
// NOTE: If our parent document needs a relayout, we must do that *first*.
|
||||
// This is necessary as the parent layout may cause our viewport to change.
|
||||
if (browsing_context() && browsing_context()->container())
|
||||
browsing_context()->container()->document().update_layout();
|
||||
|
||||
update_style();
|
||||
|
||||
if (!m_needs_layout && m_layout_root)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue