Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 44d3464ef15e7080e9de1350c0daaa66ac4e315a https://github.com/WebKit/WebKit/commit/44d3464ef15e7080e9de1350c0daaa66ac4e315a Author: Vitor Roriz <vitor.ro...@apple.com> Date: 2024-05-01 (Wed, 01 May 2024)
Changed paths: M Source/WebCore/css/ComputedStyleExtractor.cpp M Source/WebCore/platform/graphics/FontCascade.h M Source/WebCore/platform/graphics/FontCascadeDescription.cpp M Source/WebCore/platform/graphics/FontCascadeDescription.h M Source/WebCore/platform/graphics/FontCascadeFonts.h M Source/WebCore/platform/graphics/FontSizeAdjust.h Log Message: ----------- Decoupling from-font resolution from FontCascadeFonts::primaryFont https://bugs.webkit.org/show_bug.cgi?id=273339 rdar://127132471 Reviewed by Brent Fulgham. font-size-adjust from-font resolution was fixed by [1]. It now works correctly and it uses the primary font for resolution. However, this patch changed FontCascadeFonts::primaryFont to receive a mutable (non-const) FontCascadeDescription object, such that it could resolve the from-font reference after the primary font is resolved. This means that now FontCascadeFonts::primaryFont does two different things: a) resolving and caching a font as the primary font b) resolving from-font according to the primary font if necessary The (a) part of primaryFont doesn't require a mutable FontCascadeDescription. We can update FontCascadeDescription to have a method for resolving font-size-adjust from-font at the point where we own a mutable FontCascadeDescription instead. This allows us to compute the primaryFont itself from places where we only have access to a const FontCascadeDescription. This is for example, required for solving https://bugs.webkit.org/show_bug.cgi?id=273233, where we need to access to primaryFont from FontCascadeFonts::glyphDataForVariant This patch should have no side effects, as it is a preparation for solving 273233. [1] https://commits.webkit.org/269041@main * Source/WebCore/css/ComputedStyleExtractor.cpp: (WebCore::fontSizeAdjustFromStyle): * Source/WebCore/platform/graphics/FontCascade.h: (WebCore::FontCascade::primaryFont const): * Source/WebCore/platform/graphics/FontCascadeDescription.cpp: (WebCore::FontCascadeDescription::resolveFontSizeAdjustFromFontIfNeeded): * Source/WebCore/platform/graphics/FontCascadeDescription.h: * Source/WebCore/platform/graphics/FontCascadeFonts.h: (WebCore::FontCascadeFonts::primaryFont): * Source/WebCore/platform/graphics/FontSizeAdjust.h: (WebCore::FontSizeAdjust::shouldResolveFromFont const): Canonical link: https://commits.webkit.org/278219@main To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes