Skip to content

Commit

Permalink
[Site Isolation] Resizing the window causes rendering issues inside c…
Browse files Browse the repository at this point in the history
…ross-origin iframe.

https://bugs.webkit.org/show_bug.cgi?id=272419
<rdar://126160881>

Reviewed by Alex Christensen.

When Page::layoutIfNeeded tries to layout all documents (and flush their compositing
layers), it should do so for all root frames, not just the main frame.

* Source/WebCore/page/Page.cpp:
(WebCore::Page::layoutIfNeeded):

Canonical link: https://commits.webkit.org/277339@main
  • Loading branch information
mattwoodrow authored and achristensen07 committed Apr 11, 2024
1 parent d41c16d commit ce9d973
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
(frame hosting node
(has hosting context identifier )
(frame scrolling node
(scrollable area size width=800 height=600)
(total content size width=800 height=600)
(scrollable area size width=300 height=300)
(total content size width=300 height=300)
(last committed scroll position (0,0))
(scrollable area parameters
(horizontal scroll elasticity 0)
(vertical scroll elasticity 0)
(horizontal scrollbar mode 0)
(vertical scrollbar mode 0))
(layout viewport (0,0) width=800 height=600)
(layout viewport (0,0) width=300 height=300)
(min layoutViewport origin (0,0))
(max layoutViewport origin (0,0))
(behavior for fixed 1)))))
Expand Down
9 changes: 7 additions & 2 deletions Source/WebCore/page/Page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1760,9 +1760,14 @@ void Page::removeActivityStateChangeObserver(ActivityStateChangeObserver& observ

void Page::layoutIfNeeded(OptionSet<LayoutOptions> layoutOptions)
{
auto* localMainFrame = dynamicDowncast<LocalFrame>(m_mainFrame.get());
if (RefPtr view = localMainFrame ? localMainFrame->view() : nullptr)
for (auto& rootFrame : m_rootFrames) {
ASSERT(rootFrame->isRootFrame());
RefPtr view = rootFrame->view();
if (!view)
continue;

view->updateLayoutAndStyleIfNeededRecursive(layoutOptions);
}
}

void Page::scheduleRenderingUpdate(OptionSet<RenderingUpdateStep> requestedSteps)
Expand Down

0 comments on commit ce9d973

Please sign in to comment.