Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Treat 'rem' and 'rlh' as absolute units for font size
https://bugs.webkit.org/show_bug.cgi?id=246566 rdar://101209364 Reviewed by Darin Adler. Ported Chromium revision from: https://chromium.googlesource.com/chromium/src/+/17ea96288ad2c9abb048f5b50e02097d20c283d9 by Xiaocheng Hu <email@example.com> StyleBuilderCustom 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. See usages of FontCascadeDescription::useFixedDefaultSize(). 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. This also applies to the rlh unit, which the Chromium fix did not cover, this revision adds a WPT for it. * LayoutTests/TestExpectations: * LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/rlh-in-monospace-expected.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/rlh-in-monospace-ref.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/rlh-in-monospace.html: Added. * Source/WebCore/css/CSSPrimitiveValue.h: * Source/WebCore/style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyValueFontSize): Canonical link: https://commits.webkit.org/255594@main
- Loading branch information
Showing 6 changed files with 40 additions and 2 deletions.