summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/rendering/replaced-elements/the-option-element/option-with-br.html
blob: 3b8d992cc2a07dfd902dbb1011e2c348e862baaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!DOCTYPE html>
<meta charset="utf-8">
<title>option element with br child</title>
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#concept-option-label">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-option-text">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-select-element-2">

<link rel="match" href="option-with-br-ref.html">

<p>This test passes if the option element displays three options:</p>

<pre>a
b
ab</pre>

<p>Importantly the third option must not be split across two lines.</p>

<select multiple>
  <option>a</option>
  <option>b</option>
  <option id="manipulate-me"></option>
</select>

<script>
"use strict";
const option = document.querySelector("#manipulate-me");

option.appendChild(document.createTextNode("a"));
option.appendChild(document.createElement("br"));
option.appendChild(document.createTextNode("b"));
</script>