Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4fa13fd953bf5c72e00e755955a75784d4483dbc
      
https://github.com/WebKit/WebKit/commit/4fa13fd953bf5c72e00e755955a75784d4483dbc
  Author: Vitor Roriz <[email protected]>
  Date:   2025-12-08 (Mon, 08 Dec 2025)

  Changed paths:
    A LayoutTests/fast/text/letter-spacing-em-text-zoom-expected.html
    A LayoutTests/fast/text/letter-spacing-em-text-zoom.html
    A LayoutTests/fast/text/margin-em-text-zoom-expected.html
    A LayoutTests/fast/text/margin-em-text-zoom.html
    A LayoutTests/fast/text/word-spacing-em-text-zoom-expected.html
    A LayoutTests/fast/text/word-spacing-em-text-zoom.html
    M Source/WebCore/style/values/box/StyleMargin.cpp
    M Source/WebCore/style/values/inline/StyleLineHeight.cpp
    M Source/WebCore/style/values/primitives/StyleLengthResolution.cpp
    M Source/WebCore/style/values/text/StyleLetterSpacing.cpp

  Log Message:
  -----------
  Refactoring text zoom : apply text zoom to font-relative units during length 
resolution
https://bugs.webkit.org/show_bug.cgi?id=303672

Reviewed by Brent Fulgham.

Previously, text zoom multiplication for em-based and other font-relative units
was handled individually per property (line-height, word-spacing, 
letter-spacing, margin).
This approach was error-prone and incomplete, as it required each property to
remember to multiply by text zoom when evaluationTimeZoomEnabled is true.

This patch centralizes text zoom application for all font-relative units
(em, rem, ex, rex, ch, rch, cap, rcap, ic, ric) computeNonCalcLengthDouble.

The fix applies when:
1. evaluationTimeZoomEnabled is true
2. rangeZoomOption is Unzoomed
3. The unit is font-relative

We explicitly use BuilderState::zoomWithTextZoomFactor() instead of
conversionData.zoom() to guarantee only text zoom is applied, not page zoom
or other zoom mechanisms. When evaluationTimeZoomEnabled is true,
zoomWithTextZoomFactor() returns (1.0f * textZoomFactor), ensuring independence
from page zoom.

Tests: fast/text/letter-spacing-em-text-zoom.html
       fast/text/margin-em-text-zoom.html
       fast/text/word-spacing-em-text-zoom.html

* LayoutTests/fast/text/letter-spacing-em-text-zoom-expected.html: Added.
* LayoutTests/fast/text/letter-spacing-em-text-zoom.html: Added.
* LayoutTests/fast/text/margin-em-text-zoom-expected.html: Added.
* LayoutTests/fast/text/margin-em-text-zoom.html: Added.
* LayoutTests/fast/text/word-spacing-em-text-zoom-expected.html: Added.
* LayoutTests/fast/text/word-spacing-em-text-zoom.html: Added.
* Source/WebCore/style/values/box/StyleMargin.cpp:
(WebCore::Style::CSSValueConversion<MarginEdge>::operator):
* Source/WebCore/style/values/inline/StyleLineHeight.cpp:
(WebCore::Style::CSSValueConversion<LineHeight>::operator):
* Source/WebCore/style/values/primitives/StyleLengthResolution.cpp:
(WebCore::Style::adjustZoomStateForFontRelativeUnitsIfNeeded):
(WebCore::Style::computeNonCalcLengthDouble):
* Source/WebCore/style/values/text/StyleLetterSpacing.cpp:
(WebCore::Style::CSSValueConversion<LetterSpacing>::operator):
 Fixed missing rangeZoomOptions parameter

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



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

Reply via email to