Re: [csswg-drafts] [css-inline-3] vertical-align: super and font metrics (#5225)

_(I'm working on some of Gecko's inline layout code and was interested in this.)_

I tracked down WebKit's `+ 1px` on the sub/super ratios to see if there was anything indicating the purpose. It was introduced in KHTML in the pre-WebKit days in 2001:

- [5/3/2001 - e0234714](https://github.com/KDE/kdelibs/commit/e023471444a2bdd2b0f5f15fca2b9692362d317a#diff-1c1d599ed9f261d1762cba180940f0d74495fd83ec6a96d6213f391e02c42a1aR727-R731) - Introduces support for `vertical-align: sub/super` using 1/5 for both.
- [5/4/2001 - 2ca6dbfc](https://github.com/KDE/kdelibs/commit/2ca6dbfcc63b3ac2aedbb47d162efa7e46103d50#diff-1c1d599ed9f261d1762cba180940f0d74495fd83ec6a96d6213f391e02c42a1aR727-R730) - Updates the calculations to `1em/5 + 1px` and `1em/3 + 1px`.

Nothing in the commit message to indicate why the additional pixel. I'm guessing it probably just looked better in their tests at the time.

Given the long history of WebKit's and Blink's additional pixel, and the fact that Gecko will have needed to adjust anyway (0.34 → 1/3), I wonder if standardizing to WebKit's calculation makes more sense.

-- 
GitHub Notification of comment by kbhomes
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5225#issuecomment-3726742207 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 9 January 2026 02:11:44 UTC