[Webkit-unassigned] [Bug 168358] New: <input>.labels is empty if type changes from text->hidden->checkbox

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 15 00:24:19 PST 2017


https://bugs.webkit.org/show_bug.cgi?id=168358

            Bug ID: 168358
           Summary: <input>.labels is empty if type changes from
                    text->hidden->checkbox
    Classification: Unclassified
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: HTML DOM
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: zcorpan at gmail.com
                CC: cdumez at apple.com

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

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170215/ff0b23a0/attachment.html>


More information about the webkit-unassigned mailing list