Skip to content

Commit

Permalink
FontVariantCaps AllCaps and AllPetite should not use simplified measu…
Browse files Browse the repository at this point in the history
…ring

https://bugs.webkit.org/show_bug.cgi?id=267814
rdar://121314557

Reviewed by Alan Baradlay.

We should not use simplified measuring for such content because
measure needs to take synthesis in consideration.

* Source/WebCore/rendering/RenderText.cpp:
(WebCore::RenderText::initiateFontLoadingByAccessingGlyphDataAndComputeCanUseSimplifiedTextMeasuring):

Canonical link: https://commits.webkit.org/279183@main
  • Loading branch information
vitorroriz committed May 23, 2024
1 parent e6d5e1a commit 9289e50
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/WebCore/rendering/RenderText.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,8 @@ void RenderText::initiateFontLoadingByAccessingGlyphDataAndComputeCanUseSimplifi
auto fontVariant = AutoVariant;
m_canUseSimplifiedTextMeasuring = canUseSimpleFontCodePath();
#if USE(FONT_VARIANT_VIA_FEATURES)
if (fontCascade.fontDescription().variantCaps() == FontVariantCaps::Small) {
auto fontVariantCaps = fontCascade.fontDescription().variantCaps();
if (fontVariantCaps == FontVariantCaps::Small || fontVariantCaps == FontVariantCaps::AllSmall || fontVariantCaps == FontVariantCaps::Petite || fontVariantCaps == FontVariantCaps::AllPetite) {
// This matches the behavior of ComplexTextController::collectComplexTextRuns(): that function doesn't perform font fallback
// on the capitalized characters when small caps is enabled, so we shouldn't here either.
fontVariant = NormalVariant;
Expand Down

0 comments on commit 9289e50

Please sign in to comment.