Skip to content

Commit 8b12d3c

Browse files
emiliomoz-wptsync-bot
authored andcommitted
Don't suppress content in listbox select.
Options can now per spec be wrapped in <div>s etc. Just avoid removing those at frame construction time. Now that we don't suppress stuff we need to hide the ::-moz-select-content and picker icons via UA sheet properly, since those used to get this treatment. Remove a bunch of reftests that are invalid now that we don't suppress abspos <div>s etc, and add some WPTs which cover this. The innerText getter stuff now matches other browsers. Differential Revision: https://phabricator.services.mozilla.com/D313991 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=2056610 gecko-commit: 7818a5d22b19d3f8fbd6cb4dee2d1e89e0a29e47 gecko-commit-git: 4e53d86c35a6761fc75c9623562e57f17eb30b29 gecko-reviewers: keithamus, layout-reviewers, firefox-style-system-reviewers, dshin
1 parent 59a5216 commit 8b12d3c

7 files changed

Lines changed: 69 additions & 1 deletion

File tree

html/dom/elements/the-innertext-and-outertext-properties/getter-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ testText("<select><optgroup class='poke-optgroup'></select>", "", "<optgroup> co
203203
testText("<select><optgroup><option>abc</select>", "abc", "<optgroup> containing <option>");
204204
testText("<select><option class='poke-div'>123</select>", "123\nabc", "<div> in <option>");
205205
testText("<div>a<optgroup></optgroup>bc", "a\nbc", "empty <optgroup> in <div>");
206-
testText("<div>a<optgroup>123</optgroup>bc", "a\nbc", "<optgroup> in <div>");
206+
testText("<div>a<optgroup>123</optgroup>bc", "a\n123\nbc", "<optgroup> in <div>");
207207
testText("<div>a<option></option>bc", "a\nbc", "empty <option> in <div>");
208208
testText("<div>a<option>123</option>bc", "a\n123\nbc", "<option> in <div>");
209209
testText("<select><option>one</option><div><optgroup label=optgroup><div><option><span>two", "one\ntwo");
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!doctype html>
2+
<title>Absolutely positioned descendants of a listbox select render</title>
3+
<style>
4+
select {
5+
appearance: none;
6+
border: 1px solid black;
7+
padding: 0;
8+
background: green;
9+
color: green;
10+
width: 60px;
11+
}
12+
</style>
13+
<select size="2">
14+
<option>a</option>
15+
</select>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!doctype html>
2+
<title>Absolutely positioned descendants of a listbox select render</title>
3+
<link rel="match" href="listbox-abspos-descendant-ref.html">
4+
<link rel="help" href="https://bugzil.la/2056610">
5+
<style>
6+
select {
7+
appearance: none;
8+
border: 1px solid black;
9+
padding: 0;
10+
background: white;
11+
width: 60px;
12+
}
13+
</style>
14+
<select size="2" style="position:relative">
15+
<option>a</option>
16+
<div style="position:absolute; inset:0; background:green"></div>
17+
</select>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!doctype html>
2+
<title>A display:contents option renders in a listbox select</title>
3+
<style>select { width: 60px; } option { padding-inline: 0; }</style>
4+
<select size="4">
5+
<option>a</option>
6+
<span>b</span>
7+
<option>c</option>
8+
</select>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!doctype html>
2+
<title>A display:contents option renders in a listbox select</title>
3+
<link rel="match" href="listbox-option-display-contents-ref.html">
4+
<link rel="help" href="https://bugzil.la/2056610">
5+
<style>select { width: 60px; } option { padding-inline: 0; }</style>
6+
<select size="4">
7+
<option>a</option>
8+
<option style="display:contents">b</option>
9+
<option>c</option>
10+
</select>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!doctype html>
2+
<title>Options wrapped in a &lt;div&gt; render in a listbox select</title>
3+
<style>select { width: 60px; } option { padding-inline: 0; }</style>
4+
<select size="4">
5+
<option>a</option>
6+
<option>b</option>
7+
<option>c</option>
8+
</select>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!doctype html>
2+
<title>Options wrapped in a &lt;div&gt; render in a listbox select</title>
3+
<link rel="match" href="listbox-option-in-div-ref.html">
4+
<link rel="help" href="https://bugzil.la/2056610">
5+
<style>select { width: 60px; } option { padding-inline: 0; }</style>
6+
<select size="4">
7+
<div><option>a</option></div>
8+
<div><option>b</option></div>
9+
<div><option>c</option></div>
10+
</select>

0 commit comments

Comments
 (0)