Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 892f04447eea322ed3964a3a6f0cec0be2315cae
      
https://github.com/WebKit/WebKit/commit/892f04447eea322ed3964a3a6f0cec0be2315cae
  Author: Vitor Roriz <[email protected]>
  Date:   2026-05-19 (Tue, 19 May 2026)

  Changed paths:
    M Source/WebCore/page/LocalFrameViewLayoutContext.cpp
    M Source/WebCore/rendering/RenderView.h
    M Source/WebKit/WebProcess/WebPage/WebPage.h
    M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ios/TextAutosizingBoost.mm

  Log Message:
  -----------
  [iOS Text Autosizing] google.com search suggestion font size increases upon 
rotation from portrait to landscape, doesn't decrease after rotating back to 
portrait
https://bugs.webkit.org/show_bug.cgi?id=314924
rdar://113801810

Reviewed by Antti Koivisto.

iOS autosizes small text on wide pages so it stays readable, and caches that
result per block. On rotation the cache must be cleared, but today the clear
runs before the first post-rotation layout, which can still see stale block
widths. Autosize runs against those stale widths, inflates the font, and
caches the inflated value. Autosize only inflates, never deflates, so the
inflated font persists.

Defer the clear to after a layout, and skip autosize on any layout that may
still see stale widths. The clear restores the specified font size via
setStyle, which dirties the tree and triggers a second synchronous layout
still inside the resize transaction, so autosize must be skipped on that one
too.

The second skip is conditional on the clear having actually dirtied
something; otherwise a rotation where nothing was autosized would leave the
flag set and silently disable autosize on a future layout.

* Source/WebCore/page/LocalFrameViewLayoutContext.cpp:
(WebCore::LocalFrameViewLayoutContext::performLayout):
* Source/WebCore/rendering/RenderView.h:
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::scheduleTextAutosizingResetAfterLayout):
(WebKit::WebPage::viewportConfigurationChanged):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ios/TextAutosizingBoost.mm:

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



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

Reply via email to