/html/semantics/forms/the-label-element/label-attributes.sub.html| status | subtest | message |
|---|---|---|
| PASS | A label element with a 'for' attribute should only be associated with a labelable element. | |
| FAIL | A label element not in a document can not label any element in the document. | assert_not_equals: A label element not in a document should not label an element in a document. got disallowed value Element node <input id="test1"></input> |
| FAIL | The labeled control for a label element that has no 'for' attribute is the first labelable element which is a descendant of that label element. | assert_equals: The number of labels should be 0 if it's not the first labelable descendant of a label element. expected 0 but got 1 |
| PASS | The 'for' attribute points to an inexistent id. | |
| FAIL | A non-control follows by a control with same ID. | assert_equals: expected 0 but got 1 |
| FAIL | The 'for' attribute is an empty string. | assert_equals: A label element with an empty 'for' attribute should not associate with anything. expected null but got Element node <input id="" class="class2"></input> |
| PASS | A form control has multiple labels. | |
| FAIL | A labelable element is moved to outside of nested associated labels. | assert_array_equals: The labels for a form control should be returned in tree order. expected property 0 to be Element node <label id="lbl7"> <label id="lbl8"> <div id="di... but got Element… |
| FAIL | A labelable element is moved to inside of nested associated labels. | assert_equals: The form control has an ancestor with no explicit associated label, and is the first labelable descendant. expected 1 but got 2 |
| FAIL | A labelable element which is a descendant of non-labelable element is moved to outside of associated label. | assert_equals: The number of labels should be 1 since there is a label with a 'for' attribute associated with this labelable element. expected 1 but got 2 |
| FAIL | A labelable element is moved to iframe. | assert_equals: The number of labels should be 2 after the labelable element is moved to iframe. expected 2 but got 1 |
| FAIL | A div element which contains labelable element is removed. | assert_equals: The form control has an ancestor with no explicit associated label, and is the first labelable descendant. expected 1 but got 2 |
| FAIL | A labelable element not in a document can label element in the same tree. | assert_equals: The number of labels associated with a form control should be the number of label elements for which it is a labeled control. expected 2 but got 1 |
| FAIL | A labelable element inside the shadow DOM. | assert_true: ShadowRoot should be an instance of DocumentFragment. expected true got false |
| PASS | A form control has an implicit label. | |
| FAIL | A form control has no label 1. | assert_equals: The form control has an ancestor with no explicit associated label, but is *not* the first labelable descendant expected 0 but got 1 |
| FAIL | A form control has no label 2. | assert_equals: The number of labels should be 0 if the form control has an ancestor label element that the for attribute points to another control. expected 0 but got 1 |
| PASS | A label in a form without a control | |
| PASS | A label outside a form with a control inside the form | |
| PASS | A label's htmlFor attribute must reflect the for content attribute |
bundle built 2026-07-16T07:16:48.063Z