mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 08:41:15 +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
Notes:
sideshowbarker
2024-07-17 17:02:45 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/07a4d590dd
|
@ -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…
Reference in a new issue