w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.35k stars 639 forks source link

[cssom] Resolved value for font-size should perhaps take user's minimum font-size into account #10479

Open dholbert opened 1 week ago

dholbert commented 1 week ago

CSSOM section 9 on resolved values (i.e. the value returned by getComputedStyle) doesn't have any special case for the font-size property right now.

However: users can configure a minimum font-size to enforce in their browser settings; and in Safari and Chrome, this clamping does seem to be reflected in the values that getComputedStyle(elem).fontSize returns. In Firefox, the clamping doesn't take effect in getComputedStyle and we got a bug report on Firefox differing from other browsers in this respect: https://bugzilla.mozilla.org/show_bug.cgi?id=1903360

Perhaps we should spec this clamping behavior as part of the resolved value for font-size? (and explicitly apply the clamping in the getComputedStyle implementation) e.g. just specify that the resolved value of font-size is the used value, or something along those lines? (I'm not sure if that would bring in any additional complexity...)

Additional notes:

svgeesus commented 1 week ago

Adding myself just to track this @svgeesus