Bug 267814

Summary: Incorrect inline element’s size when using font-variant-caps: all-small-caps with font-synthesis
Product: WebKit Reporter: Roman Komarov <kizmarh>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: davidcjames, dev, fantasai.bugs, karlcow, vitor.roriz, webkit-bug-importer, zalan
Priority: P2 Keywords: BrowserCompat, InRadar
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Screenshot of the test case none

Roman Komarov
Reported 2024-01-20 06:58:09 PST
To reproduce: apply something like `font-variant-caps: all-small-caps` to a text with a font that does not support that font feature, resulting in font synthesis taking place. Example: https://codepen.io/kizu/pen/GReEpWp In Chrome and Firefox the element's size is properly reduced, while in Safari only the text is resized, with the box keeping its dimensions before resizing. Using the font that has proper glyphs for the small caps does not result in this bug, so I think this only happens with font synthesis: https://codepen.io/kizu/pen/jOJwbmG (working for me). Attaching a screenshot from Safari Technology preview.
Attachments
Screenshot of the test case (7.08 KB, image/png)
2024-01-20 06:58 PST, Roman Komarov
no flags
Roman Komarov
Comment 1 2024-01-20 06:58:39 PST
Created attachment 469482 [details] Screenshot of the test case
Radar WebKit Bug Importer
Comment 2 2024-01-20 07:13:26 PST
David James
Comment 3 2024-05-07 08:13:29 PDT
I stumbled across this problem independently when using `font-family: "KaTeX_Main"`. My initial hypothesis was "this makes me think Safari decides on the width first and only later changes the font to all caps".
Vitor Roriz
Comment 4 2024-05-22 17:36:52 PDT
EWS
Comment 5 2024-05-22 23:21:16 PDT
Committed 279183@main (9289e50fcd59): <https://commits.webkit.org/279183@main> Reviewed commits have been landed. Closing PR #28959 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.