WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WORKSFORME
296524
Text becomes larger when overflowing inside a block with width: fit-content
https://bugs.webkit.org/show_bug.cgi?id=296524
Summary
Text becomes larger when overflowing inside a block with width: fit-content
thefrostypixel
Reported
2025-07-26 11:11:31 PDT
Created
attachment 476185
[details]
A screenshot showing Safari calculating the elements font-size as 27px with it's source being the 10px set in the inline style. On iOS, if an element with display set to block or inline-block, width set to min-content, fit-content or max-content and a set font-size has at least two child nodes that both contain something (either two elements, two text nodes or an element and a text node in either order) that together overflow the screen horizontally, then it's text will become larger than it should be. Here is an example, the upper line of text has the correct `font-size` will the lower line as too large. <meta name="viewport" content="initial-scale=1"> <div style="font-size: 10px;">AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<a>A</a></div> <!-- 10px text --> <div style="width: fit-content; font-size: 10px;">AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<a>A</a></div> <!-- 17px text -->
Attachments
A screenshot showing Safari calculating the elements font-size as 27px with it's source being the 10px set in the inline style.
(87.38 KB, image/png)
2025-07-26 11:11 PDT
,
thefrostypixel
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2025-08-02 11:12:11 PDT
<
rdar://problem/157377363
>
Simon Fraser (smfr)
Comment 2
2025-08-04 09:30:58 PDT
This is text autosizing ("font boosting"). You can disable it with `-webkit-text-size-adjust: none`.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug