Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 584bb2e4b5da80e2335ba120480000c1710c4cc2
      
https://github.com/WebKit/WebKit/commit/584bb2e4b5da80e2335ba120480000c1710c4cc2
  Author: Cameron McCormack <[email protected]>
  Date:   2026-09-20 (Sun, 20 Sep 2026)

  Changed paths:
    A 
LayoutTests/http/tests/site-isolation/page-zoom-does-not-scale-cross-origin-iframe-expected.txt
    A 
LayoutTests/http/tests/site-isolation/page-zoom-does-not-scale-cross-origin-iframe.html
    A 
LayoutTests/http/tests/site-isolation/resources/report-inner-width-and-window-clip-width.html
    M LayoutTests/platform/mac-wk2/TestExpectations
    M Source/WebCore/page/Frame.cpp
    M Source/WebCore/page/Frame.h
    M Source/WebCore/page/LocalFrame.cpp
    M Source/WebCore/page/LocalFrame.h
    M Source/WebCore/page/Page.cpp
    M Source/WebCore/page/RemoteFrame.cpp
    M Source/WebCore/page/RemoteFrame.h
    M Source/WebCore/page/RemoteFrameLayoutInfo.cpp
    M Source/WebCore/page/RemoteFrameLayoutInfo.h
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in

  Log Message:
  -----------
  [Site Isolation] Page zoom is applied twice inside a cross-origin iframe
https://bugs.webkit.org/show_bug.cgi?id=318732
rdar://181534816

Reviewed by Matt Woodrow and Abrar Rahman Protyasha.

Style::resolveForDocument sets the zoom of a frame's RenderView to the
frame's page zoom factor and sets its scale transform to
frameScaleFactor, to account for any CSS zoom on the frame owner and its
ancestors.

frameScaleFactor divides the frame owner's used zoom by the main frame's
page zoom to remove its effect, but when the main frame is not local we
fail to do it. The effect is that the page zoom is incorrectly applied
twice.

Change this so that we divide out the page zoom factor when computing
the frame scale factor for a child frame.

Test: 
http/tests/site-isolation/page-zoom-does-not-scale-cross-origin-iframe.html

* 
LayoutTests/http/tests/site-isolation/page-zoom-does-not-scale-cross-origin-iframe-expected.txt:
 Added.
* 
LayoutTests/http/tests/site-isolation/page-zoom-does-not-scale-cross-origin-iframe.html:
 Added.
* 
LayoutTests/http/tests/site-isolation/resources/report-inner-width-and-window-clip-width.html:
 Added.
* LayoutTests/platform/mac-wk2/TestExpectations:
* Source/WebCore/page/Frame.cpp:
(WebCore::Frame::frameScaleFactor const):
* Source/WebCore/page/Frame.h:
* Source/WebCore/page/LocalFrame.cpp:
(WebCore::LocalFrame::frameScaleFactorForChild const):
(WebCore::LocalFrame::usedZoomForChild const): Deleted.
* Source/WebCore/page/LocalFrame.h:
* Source/WebCore/page/Page.cpp:
(WebCore::Page::syncLocalFrameInfoToRemote):
* Source/WebCore/page/RemoteFrame.cpp:
(WebCore::RemoteFrame::frameScaleFactorForChild const):
(WebCore::RemoteFrame::usedZoomForChild const): Deleted.
* Source/WebCore/page/RemoteFrame.h:
* Source/WebCore/page/RemoteFrameLayoutInfo.cpp:
(WebCore::RemoteFrameLayoutInfo::RemoteFrameLayoutInfo):
(WebCore::operator==):
(WebCore::operator<<):
* Source/WebCore/page/RemoteFrameLayoutInfo.h:
(WebCore::RemoteFrameLayoutInfo::frameScaleFactor const):
(WebCore::RemoteFrameLayoutInfo::usedZoom const): Deleted.
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:

Canonical link: https://commits.webkit.org/321480@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to