Bug 273339
| Summary: | FontCascadeFonts::primaryFont should work with a const FontCascadeDescription | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Vitor Roriz <vitor.roriz> |
| Component: | Text | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | commit-queue, fantasai.bugs, vitor.roriz, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Other | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | 273491 | ||
| Bug Blocks: | |||
Vitor Roriz
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 fromFont 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 access 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 primaryFont from FontCascadeFonts::glyphDataForVariant
[1] https://commits.webkit.org/269524@main
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/127132471>
Vitor Roriz
(In reply to Vitor Roriz from comment #0)
> 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 fromFont 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 access 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 primaryFont from FontCascadeFonts::glyphDataForVariant
>
> [1] https://commits.webkit.org/269524@main
ops, I've linked the wrong commit. I was referring to https://github.com/WebKit/WebKit/commit/89bdb0336c3b32a4130822ed976d858538e0d596
Vitor Roriz
Pull request: https://github.com/WebKit/WebKit/pull/27829
EWS
Committed 278130@main (f923c324da2f): <https://commits.webkit.org/278130@main>
Reviewed commits have been landed. Closing PR #27829 and removing active labels.
WebKit Commit Bot
Re-opened since this is blocked by bug 273491
Vitor Roriz
Pull request: https://github.com/WebKit/WebKit/pull/27936
EWS
Committed 278219@main (44d3464ef15e): <https://commits.webkit.org/278219@main>
Reviewed commits have been landed. Closing PR #27936 and removing active labels.