WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
212522
font-size is not computed correctly when specified by CSS clamp(). implementation incomplete
https://bugs.webkit.org/show_bug.cgi?id=212522
Summary
font-size is not computed correctly when specified by CSS clamp(). implementa...
Wes Bos
Reported
2020-05-29 07:28:22 PDT
CSS clamp() function is missing two features that the rest of the browsers have implemented: First, it does not allow for calculating the font size: ```html <h2>Clamp Me</h2> <style> h2 { font-size: clamp(30px, 20vw + 5rem, 300px); /* Or with calc(), which isn't needed: */ font-size: clamp(30px, calc(20vw + 5rem), 300px); } </style> ``` This feature is needed because viewport units as font sizes are inaccessible as they do not get bigger/smaller when the user zooms in or out. Second, the browser doesn't repaint the size of the font when the browser is resized: ```html <h2>Clamp Me</h2> <style> h2 { font-size: clamp(30px, 20vw, 300px); } </style> ``` Resize the browser, and you'll see the font size doesn't change. Reload the page at a smaller browser width and it does resize. Confirmed in Release 107 (Safari 13.2, WebKit 15610.1.14.1)
Attachments
testcase
(366 bytes, text/html)
2025-02-14 22:00 PST
,
fantasai
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2020-06-01 17:43:29 PDT
<
rdar://problem/63851634
>
Peter
Comment 2
2021-05-02 16:34:01 PDT
Any updates? Still an issue in Version 14.1 (16611.1.21.161.3)
Karl Dubost
Comment 3
2024-12-22 21:41:09 PST
***
Bug 284955
has been marked as a duplicate of this bug. ***
Karl Dubost
Comment 4
2024-12-22 21:49:56 PST
Probably there is a WPT missing for this. Maybe it will be hard to create because of its dependency on zooming
https://wpt.fyi/results/css?label=master&label=experimental&aligned&q=clamp
fantasai
Comment 5
2025-02-14 22:00:03 PST
Created
attachment 474238
[details]
testcase I think this might have been fixed during Sam's rewrite of our unit handling code. At least, I can't figure out how to reproduce it. Reporter, can you check in a recent STP or WebKit build?
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