RESOLVED FIXED 168358
<input>.labels is empty if type changes from text->hidden->checkbox
https://bugs.webkit.org/show_bug.cgi?id=168358
Summary <input>.labels is empty if type changes from text->hidden->checkbox
Simon Pieters (:zcorpan)
Reported 2017-02-15 00:24:19 PST
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: https://github.com/w3c/web-platform-tests/pull/4804 HTML Standard: https://github.com/whatwg/html/pull/2355
Attachments
Patch (7.25 KB, patch)
2017-02-16 19:31 PST, Chris Dumez
no flags
Chris Dumez
Comment 1 2017-02-16 19:31:22 PST
WebKit Commit Bot
Comment 2 2017-02-16 20:32:26 PST
Comment on attachment 301870 [details] Patch Clearing flags on attachment: 301870 Committed r212522: <http://trac.webkit.org/changeset/212522>
WebKit Commit Bot
Comment 3 2017-02-16 20:32:32 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.