From 14401ce76c8bf36057a6992c0c9ac64f1457a87c Mon Sep 17 00:00:00 2001 From: Anders Hartvoll Ruud Date: Tue, 26 May 2020 18:01:46 -0700 Subject: [PATCH] Perform monospace-related adjustment using true parent style There is currently some code in FontBuilder that tweaks the specified font size if the current generic font family changes to or from monospace. This code assumes that the FontDescription stored on the ComputedStyle pre-CreateFont is the inherited FontDescription, but this is no longer (always) true. This means that declarations like font-size:1em can be applied (and subjected to CreateFont) twice, which means that the second call to CheckForGenericFamilyChange won't detect a change in the monospace-ness, hence the specified size will fail to adjust. This CL fixes this by propagating the actual parent style to CheckForGenericFamilyChange. Bug: 1086082, 1086680 Change-Id: Ia61a2327890f27497e4ea5f41dec00a5e0a450d3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2216511 Reviewed-by: Xiaocheng Hu Commit-Queue: Anders Hartvoll Ruud Cr-Commit-Position: refs/heads/master@{#772032} --- .../font-size-monospace-adjust-ref.html | 5 +++++ css/css-fonts/font-size-monospace-adjust.html | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 css/css-fonts/font-size-monospace-adjust-ref.html create mode 100644 css/css-fonts/font-size-monospace-adjust.html diff --git a/css/css-fonts/font-size-monospace-adjust-ref.html b/css/css-fonts/font-size-monospace-adjust-ref.html new file mode 100644 index 00000000000000..098fca5ea76ff3 --- /dev/null +++ b/css/css-fonts/font-size-monospace-adjust-ref.html @@ -0,0 +1,5 @@ + + + diff --git a/css/css-fonts/font-size-monospace-adjust.html b/css/css-fonts/font-size-monospace-adjust.html new file mode 100644 index 00000000000000..f1a0b7294d3502 --- /dev/null +++ b/css/css-fonts/font-size-monospace-adjust.html @@ -0,0 +1,19 @@ + + + + + +