<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - <input>.labels is empty if type changes from text->hidden->checkbox"
href="https://bugs.webkit.org/show_bug.cgi?id=168358">168358</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td><input>.labels is empty if type changes from text->hidden->checkbox
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>Product</th>
<td>WebKit
</td>
</tr>
<tr>
<th>Version</th>
<td>Safari Technology Preview
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Unspecified
</td>
</tr>
<tr>
<th>OS</th>
<td>Unspecified
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>Normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P2
</td>
</tr>
<tr>
<th>Component</th>
<td>HTML DOM
</td>
</tr>
<tr>
<th>Assignee</th>
<td>webkit-unassigned@lists.webkit.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>zcorpan@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>cdumez@apple.com
</td>
</tr></table>
<p>
<div>
<pre>Consider
<!doctype html>
<p><label><input></label></p>
<script>
const input = document.querySelector('input');
const labels = input.labels;
console.assert(labels.length === 1);
input.type = 'hidden';
console.assert(labels.length === 0); // the label is no longer the input's labeled control
console.assert(input.labels === null);
input.type = 'checkbox';
// WebKit fails this assert:
console.assert(labels.length === 1); // the label is once again the input's labeled control
console.assert(input.labels === labels); // same value as returned originally
</script>
<input>.labels should be live, but after changing type from "text" to "hidden" and then to "checkbox", labels.length is 0. Expected 1.
web-platform-tests: <a href="https://github.com/w3c/web-platform-tests/pull/4804">https://github.com/w3c/web-platform-tests/pull/4804</a>
HTML Standard: <a href="https://github.com/whatwg/html/pull/2355">https://github.com/whatwg/html/pull/2355</a></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>