Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7c78f81680caa9f34617537bdcfaa1e6a017ea72
      
https://github.com/WebKit/WebKit/commit/7c78f81680caa9f34617537bdcfaa1e6a017ea72
  Author: Chris Dumez <[email protected]>
  Date:   2026-06-08 (Mon, 08 Jun 2026)

  Changed paths:
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ShrinkToFit.mm

  Log Message:
  -----------
  WebPageProxy::viewScaleFactorDidChange does not update m_viewScaleFactor
https://bugs.webkit.org/show_bug.cgi?id=316513

Reviewed by Abrar Rahman Protyasha and Wenson Hsieh.

WebPageProxy::viewScaleFactorDidChange() is the IPC handler that the
WebProcess uses to notify the UIProcess after auto-scaling the view to
fit the document (the path enabled by setShouldScaleViewToFitDocument(),
exposed via WKView's _WKLayoutModeDynamicSizeComputedFromMinimumDocumentSize
layout strategy). Unlike its sibling pageScaleFactorDidChange(), it
forgot to update the cached m_viewScaleFactor member. As a result,
[WKWebView _viewScale] returned a stale value after the auto-scale, and
the stale value was also propagated to newly launched WebContent
processes via WebPageCreationParameters::viewScaleFactor on process swap.

Test: WebKit.ViewScaleFactorAfterShrinkToFit

* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::viewScaleFactorDidChange):
Cache the new scale factor, mirroring pageScaleFactorDidChange().

* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ShrinkToFit.mm:
(TEST(WebKit, ViewScaleFactorAfterShrinkToFit)):
Add a regression test that uses the dynamic-size layout mode to drive
WebProcess-side auto-scale and verifies [WKWebView _viewScale] reflects
the new value.

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



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

Reply via email to