Skip to content

Commit

Permalink
Test that lh units are calculated before select fixup
Browse files Browse the repository at this point in the history
Per resolution in [1], lh units should be computed before any fixups to
line-height for form controls. Add a test for <select> elements.

[1] w3c/csswg-drafts#3257 (comment)

Bug: 937104
Change-Id: Id9987dc1d9a2c7b7a6e006cbfdd431e07379196b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3955838
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1059314}
  • Loading branch information
Rune Lillesveen authored and chromium-wpt-export-bot committed Oct 14, 2022
1 parent 65a367d commit 1f54f75
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions css/css-values/lh-unit-004.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Values and Units Test: lh not affected by &lt;select&gt; fixup</title>
<link rel="help" href="https://drafts.csswg.org/css-values-4/#font-relative-lengths">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
select {
line-height: 100px;
width: 5lh;
}
</style>
<select id="lh"></select>
<script>
test(() => {
assert_equals(getComputedStyle(lh).width, "500px");
}, "lh must be relative to computed line-height before select element fixup");
</script>

0 comments on commit 1f54f75

Please sign in to comment.