Bug 1688354 [wpt PR 27298] - Treat 'rem' as an absolute unit for font size, a=testonly
commit47c07d662aad1e17b78505add6a883c8d10125e4
authorXiaocheng Hu <xiaochengh@chromium.org>
Tue, 26 Jan 2021 16:31:30 +0000 (26 16:31 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Mon, 1 Feb 2021 17:36:03 +0000 (1 17:36 +0000)
treea98c74619cc21edc6571c50973853cd391708862
parent0718232b43e613c76825d0dd58a7a64292920d35
Bug 1688354 [wpt PR 27298] - Treat 'rem' as an absolute unit for font size, a=testonly

Automatic update from web-platform-tests
Treat 'rem' as an absolute unit for font size

FontBuilder does a size adjustment for monospace that, for all elements
using monospace font family and relative font sizes (em, ex, ch etc),
their computed font-size values are scaled by a fixed factor. To make
sure this doesn't affect non-monospace children using relative font
sizes, we also divide the childrens' font sizes by the same factor.

However, this causes children using 'rem' to be also scaled, because
'rem' is also considered a font-relative length unit, even though it
doesn't depend on the parent font size.

Therefore, we fix it by treating 'rem' an absolute unit for font size.

Bug: 623842
Change-Id: I35343208ef040c0a9baa603c1380423be83ac99d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2645653
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#846868}

--

wpt-commits: 22d7220c581d8e33160bcc5bc01987c0dab6d7e5
wpt-pr: 27298
testing/web-platform/tests/css/css-fonts/rem-in-monospace-ref.html [new file with mode: 0644]
testing/web-platform/tests/css/css-fonts/rem-in-monospace.html [new file with mode: 0644]