-
Notifications
You must be signed in to change notification settings - Fork 757
Description
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:
- I've got a testcase to poke at some edge cases here: https://bugzilla.mozilla.org/attachment.cgi?id=9408768
- Safari behaves a bit differently from Chrome/Firefox in that they seem to let the
font-sizeimpact the resolved value of1em, not just the size of rendered text. That's probably a Safari bug (CC @heycam / @nt1m ). - https://bugzilla.mozilla.org/show_bug.cgi?id=1903360 includes instructions for how to find the relevant preferences UI in Firefox, Chrome, and Safari.