Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 14db6c6baca8d17e0b7b2cc6eb375fee29681955
https://github.com/WebKit/WebKit/commit/14db6c6baca8d17e0b7b2cc6eb375fee29681955
Author: Ruthvik Konda <[email protected]>
Date: 2026-09-24 (Thu, 24 Sep 2026)
Changed paths:
A
LayoutTests/http/tests/site-isolation/page-zoom-iframe-created-after-zoom-expected.txt
A
LayoutTests/http/tests/site-isolation/page-zoom-iframe-created-after-zoom.html
A
LayoutTests/http/tests/site-isolation/text-zoom-iframe-created-after-zoom-expected.html
A
LayoutTests/http/tests/site-isolation/text-zoom-iframe-created-after-zoom.html
M Source/WebCore/page/LocalFrame.cpp
M Source/WebCore/page/LocalFrame.h
M Source/WebKit/Shared/ProvisionalFrameCreationParameters.h
M Source/WebKit/Shared/ProvisionalFrameCreationParameters.serialization.in
M Source/WebKit/UIProcess/WebFrameProxy.cpp
M Source/WebKit/WebProcess/WebPage/WebFrame.cpp
M Source/WebKit/WebProcess/WebPage/WebPage.cpp
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ProcessSwapOnNavigation.mm
Log Message:
-----------
[Site Isolation] Cross-origin iframe content is scaled incorrectly when the
page is zoomed
https://bugs.webkit.org/show_bug.cgi?id=323721
rdar://170840133
Reviewed by Sihui Liu.
A cross-origin iframe created after the page was zoomed started at a page and
text zoom of 1. The
LocalFrame constructor seeded both factors from
dynamicDowncast<LocalFrame>(tree().parent()), which
is null for a provisional frame: it is created with AddToFrameTree::No, and its
parent is usually a
RemoteFrame. The frame only corrected itself on the next zoom change. The page
zoom being applied
twice, also reported here, was fixed by 321480@main.
WebPageProxy already has the right values, so send them to the web process in
ProvisionalFrameCreationParameters, the way a provisional frame already
receives its effective
sandbox flags and referrer policy. Each LocalFrame factory now decides the
initial zoom and the
constructor stores it: provisional frames use the values from the UI process,
and createSubframe
inherits from its local parent as before.
WebPage::reinitializeWebPage() never applied the zoom in its creation
parameters, so a suspended
page that was revived kept the zoom it had when it was suspended. Apply it
after creating the
provisional frame, as the WebPage constructor does. This also affects pages
without site isolation.
Tests: http/tests/site-isolation/page-zoom-iframe-created-after-zoom.html
http/tests/site-isolation/text-zoom-iframe-created-after-zoom.html
ProcessSwap.PageZoomLevelAfterSwap
*
LayoutTests/http/tests/site-isolation/page-zoom-iframe-created-after-zoom-expected.txt:
Added.
*
LayoutTests/http/tests/site-isolation/page-zoom-iframe-created-after-zoom.html:
Added.
*
LayoutTests/http/tests/site-isolation/text-zoom-iframe-created-after-zoom-expected.html:
Added.
*
LayoutTests/http/tests/site-isolation/text-zoom-iframe-created-after-zoom.html:
Added.
* Source/WebCore/page/LocalFrame.cpp:
(WebCore::LocalFrame::LocalFrame):
(WebCore::LocalFrame::createMainFrame):
(WebCore::LocalFrame::createSubframe):
(WebCore::LocalFrame::createProvisionalSubframe):
(WebCore::parentPageZoomFactor): Deleted.
(WebCore::parentTextZoomFactor): Deleted.
* Source/WebCore/page/LocalFrame.h:
* Source/WebKit/Shared/ProvisionalFrameCreationParameters.h:
* Source/WebKit/Shared/ProvisionalFrameCreationParameters.serialization.in:
* Source/WebKit/UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::provisionalFrameCreationParameters):
* Source/WebKit/WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::createProvisionalFrame):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reinitializeWebPage):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ProcessSwapOnNavigation.mm:
((ProcessSwap, PageZoomLevelAfterSwap)):
Canonical link: https://commits.webkit.org/321842@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications