Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d221d71a6a560cb45bb3e9b23e526b6bcfa9e4b3
      
https://github.com/WebKit/WebKit/commit/d221d71a6a560cb45bb3e9b23e526b6bcfa9e4b3
  Author: Brent Fulgham <[email protected]>
  Date:   2026-05-09 (Sat, 09 May 2026)

  Changed paths:
    A 
LayoutTests/fast/text-autosizing/ios/idempotentmode/text-size-adjust-with-css-zoom-expected.txt
    A 
LayoutTests/fast/text-autosizing/ios/idempotentmode/text-size-adjust-with-css-zoom.html
    M Source/WebCore/style/StyleBuilderState.cpp

  Log Message:
  -----------
  CSS Zoom interacts oddly with explicit font-size and font-variant on iPad
https://bugs.webkit.org/show_bug.cgi?id=293617
rdar://152173269

Reviewed by Sammy Gill.

Our efforts to provide a great user experience on iPad with desktop website 
content had
an unintended consequence that resulted in strange adjustments to fonts during 
zooming.

updateFontForTextSizeAdjust() was setting computedSize directly from 
specifiedSize without
accounting for the element's zoom factor. When CSS zoom is inherited (same as 
parent),
updateFontForZoomChange() does not fire afterward to re-apply it, leaving the 
computed
font size without zoom. This caused incorrect font metrics for elements with 
explicit
text-size-adjust inside zoomed containers, breaking font-variant, font-weight, 
and
font-style rendering on iPadOS desktop mode.

This change fixes this by computing the zoom factor (usedZoom * textZoomFactor) 
directly
in updateFontForTextSizeAdjust(), bypassing minimum font size clamping which 
should not
constrain author-specified text-size-adjust values. We also add an early return 
in
updateFontForZoomChange() when text-size-adjust has already computed the 
correct zoomed
size, so it doesn't overwrite the result when zoom differs from the parent.

Test: 
fast/text-autosizing/ios/idempotentmode/text-size-adjust-with-css-zoom.html

* 
LayoutTests/fast/text-autosizing/ios/idempotentmode/text-size-adjust-with-css-zoom-expected.txt:
 Added.
* 
LayoutTests/fast/text-autosizing/ios/idempotentmode/text-size-adjust-with-css-zoom.html:
 Added.
* Source/WebCore/style/StyleBuilderState.cpp:
(WebCore::Style::BuilderState::updateFontForTextSizeAdjust):
(WebCore::Style::BuilderState::updateFontForZoomChange):

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



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

Reply via email to