Skip to content


Browse files Browse the repository at this point in the history
Add nowrap white-space to UA Stylesheet for option element

Reviewed by Tim Nguyen.

This patch aligns WebKit with Blink / Chromium and Gecko / Firefox.


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

* Source/WebCore/css/html.css: As above
* LayoutTests/fast/forms/select/options-default-white-space.html: Add Test Case
* LayoutTests/fast/forms/select/options-default-white-space-expected.txt: Add Test Case Expectation

Canonical link:
  • Loading branch information
Ahmad-S792 authored and Ahmad Saleem committed May 30, 2023
1 parent 003e0fd commit 574b3a2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
@@ -0,0 +1,4 @@

PASS <option>'s user agent 'white-space' should be 'nowrap'.

13 changes: 13 additions & 0 deletions LayoutTests/fast/forms/select/options-default-white-space.html
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<option id=option value="hello">Hello</option>
test(() => {
}, `<option>'s user agent 'white-space' should be 'nowrap'.`);
1 change: 1 addition & 0 deletions Source/WebCore/css/html.css
Expand Up @@ -1111,6 +1111,7 @@ optgroup {

option {
font-weight: normal;
white-space: nowrap;

output {
Expand Down

0 comments on commit 574b3a2

Please sign in to comment.