-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
9c98cfb
commit 44d3464
Showing
6 changed files
with
22 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters