tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit ee505ef1c46808a97242ad01f354179421b6045a
parent 7414b93481847c6f67abcfb473c6a941f315e52c
Author: Emilio Cobos Álvarez <emilio@crisal.io>
Date:   Thu,  1 Jan 2026 21:14:00 +0000

Bug 2008003 - Don't suppress <hr> in select. r=layout-reviewers,dholbert

Single select deals with it in:

  https://searchfox.org/firefox-main/rev/fb84c9bccbfc34b91613ff9f3c955a887c7e7196/toolkit/actors/SelectChild.sys.mjs#378

This seems to render just fine as-is. I'll add a WPT reftest if there's
none.

Differential Revision: https://phabricator.services.mozilla.com/D277707

Diffstat:
Mlayout/base/nsCSSFrameConstructor.cpp | 4++--
Atesting/web-platform/tests/html/semantics/forms/the-select-element/select-hr-listbox-notref.html | 7+++++++
Atesting/web-platform/tests/html/semantics/forms/the-select-element/select-hr-listbox.html | 13+++++++++++++
3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp @@ -4994,8 +4994,8 @@ static bool ShouldSuppressFrameInSelect(const nsIContent* aParent, return true; } - // Option is always fine. - if (aChild.IsHTMLElement(nsGkAtoms::option)) { + // <option> and <hr> are always fine. + if (aChild.IsAnyOfHTMLElements(nsGkAtoms::option, nsGkAtoms::hr)) { return false; } diff --git a/testing/web-platform/tests/html/semantics/forms/the-select-element/select-hr-listbox-notref.html b/testing/web-platform/tests/html/semantics/forms/the-select-element/select-hr-listbox-notref.html @@ -0,0 +1,7 @@ +<!doctype html> +<meta charset="utf-8"> +<select size="10"> + <option>A</option> + <option>B</option> + <option>C</option> +</select> diff --git a/testing/web-platform/tests/html/semantics/forms/the-select-element/select-hr-listbox.html b/testing/web-platform/tests/html/semantics/forms/the-select-element/select-hr-listbox.html @@ -0,0 +1,13 @@ +<!doctype html> +<meta charset="utf-8"> +<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=2008003"> +<link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez"> +<link rel="author" href="https://mozilla.org" title="Mozilla"> +<link rel="mismatch" href="select-hr-listbox-notref.html"> +<title>hr renders in listbox select</title> +<select size="10"> + <option>A</option> + <hr> + <option>B</option> + <option>C</option> +</select>