Bug 1641096 [wpt PR 23784] - Perform monospace-related adjustment using true parent style, a=testonly
authorAnders Hartvoll Ruud <andruud@chromium.org>
Sat, 30 May 2020 09:50:59 +0000
changeset 597311 9204ba25e6ba4b98f3acdc615231449e64efdb71
parent 597310 924f71218235f1f4e37444cf8c86738d19e0c8c3
child 597312 dde2d9a599b4be71f8d92559e6c87acf369b504a
push id13310
push userffxbld-merge
push dateMon, 29 Jun 2020 14:50:06 +0000
treeherdermozilla-beta@15a59a0afa5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1641096, 23784, 1086082, 1086680, 2216511, 772032
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1641096 [wpt PR 23784] - Perform monospace-related adjustment using true parent style, a=testonly Automatic update from web-platform-tests 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 <xiaochengh@chromium.org> Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Cr-Commit-Position: refs/heads/master@{#772032} -- wpt-commits: 14401ce76c8bf36057a6992c0c9ac64f1457a87c wpt-pr: 23784
testing/web-platform/tests/css/css-fonts/font-size-monospace-adjust-ref.html
testing/web-platform/tests/css/css-fonts/font-size-monospace-adjust.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-fonts/font-size-monospace-adjust-ref.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<style>
+  textarea { font-size: 3em; }
+</style>
+<textarea>Textarea</textarea>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-fonts/font-size-monospace-adjust.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<link rel="help" href="https://crbug.com/1086082">
+<link rel="match" href="font-size-monospace-adjust-ref.html">
+<style>
+  textarea {
+    font-size: 3em;
+    transition: margin-bottom 1e10s steps(2, start);
+    margin-bottom: 10px;
+  }
+
+  .margin {
+    margin-bottom: 20px;
+  }
+</style>
+<textarea id=textarea>Textarea</textarea>
+<script>
+  document.documentElement.offsetTop;
+  textarea.classList.toggle('margin');
+</script>