Commit bcb42ec4 authored by Joey Arhar's avatar Joey Arhar Committed by Chromium LUCI CQ

Change <option> white-space from pre to nowrap

When the option element is rendered, neither spaces nor line breaks are
preserved in the text, so nowrap makes more sense than pre.

Firefox currently has nowrap, whereas safari has pre.

Bug: 561071
Change-Id: I5293453192b379761649de76eeb29130086747a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2587607
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Reviewed-by: default avatarMason Freed <masonfreed@chromium.org>
Cr-Commit-Position: refs/heads/master@{#838167}
parent 1d698f3c
...@@ -847,7 +847,7 @@ option { ...@@ -847,7 +847,7 @@ option {
font-weight: normal; font-weight: normal;
display: block; display: block;
padding: 0 2px 1px 2px; padding: 0 2px 1px 2px;
white-space: pre; white-space: nowrap;
min-height: 1.2em; min-height: 1.2em;
} }
......
<!DOCTYPE html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<select>
<option id=option value="hello">Hello</option>
</select>
<script>
test(() => {
assert_equals(
window.getComputedStyle(option)['white-space'],
'nowrap');
}, `<option>'s user agent 'white-space' should be 'nowrap'.`);
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment