W3C home > Mailing lists > Public > www-style@w3.org > January 2016

Re: [css-size-adjust] Expose the adjusted font-size and adjustment percentage

From: Philip Rogers <pdr@chromium.org>
Date: Wed, 13 Jan 2016 22:54:55 -0800
Message-ID: <CAJgFLLt2nKujXxD83UiABQr_CdmY7C0v5PWPwFVzY90C8faoWQ@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: www-style <www-style@w3.org>
Thanks Tab and Boris. I can give this a shot in Blink (returning the
computed font-size value). It's important that we expose the
percentage/multiplier at the same time though, so authors aren't left
without a workaround.

The updated proposal is then:
1) Spec getComputedStyle(...)["font-size"] to return the computed font size
(without adjustment).
2) Spec getComputedStyle(...)["text-size-adjust"] to return the used
text-size-adjust percentage if text-size-adjust: auto or none is specified.
If text-size-adjust: none is specified,
getComputedStyle(...)["text-size-adjust"] would return 100%. If
text-size-adjust: auto is specified,
getComputedStyle(...)["text-size-adjust"] would return the percentage
calculated by the default size adjustment algorithm of the user agent, or
100% if no adjustment occurs.

Here's a concrete example where the user agent increases the font-size from
12px to 36px:
<span id="span" style="font-size: 12px; text-size-adjust: auto;">
    Hello world
window.getComputedStyle(span)["font-size"] would return 12px
window.getComputedStyle(span)["text-size-adjust"] would return 300%

On Wed, Jan 13, 2016 at 1:27 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 1/11/16 8:02 PM, Philip Rogers wrote:
>> I searched the httparchive and found getComputedStyle(...)['font-size']
>> is incredibly common so any change here (either way) will likely break
>> content.
> It really depends on what's being done with the result, right?
> I know of two sites, fullstory.com <http://fullstory.com> and
>> google feedback, which do depend on the current blink/webkit behavior.
> :(
> How do you think the no-op/roundtrip property of getComputedStyle
>> compares with the web compatibility concern?
> It's hard to say, especially since not having this property can also cause
> web compat issues...
> -Boris
Received on Thursday, 14 January 2016 06:55:45 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:59 UTC