1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../../../resources/js-test.js"></script>
5 <script src=
"../resources/common.js"></script>
6 <script src=
"../resources/label-test-util.js"></script>
9 <p id=
"description"></p>
10 <div id=
"console"></div>
12 description('Test labelable elements have labels attribute and others do not.');
14 var tester
= setupLabelsTest(withParentLabel
);
15 for (var name
in tester
.dataSet
) {
16 var data
= tester
.dataSet
[name
];
17 var element
= data
.element
;
18 if (!data
.isSupported
&& !data
.inputType
) {
19 debug('\nUnsupported: ' + name
+ ' ' + element
);
20 shouldBeUndefined('element.labels');
21 shouldNotBe('element.labels', 'null');
22 } else if (!data
.isLabelable
) {
23 debug('\nNot labelable: ' + name
+ ' ' + element
);
25 // Note: labels attribute of input element isn't undefined,
26 // because HTMLInputElement.idl defines labels attribute.
27 shouldBe('element.labels', 'null');
29 shouldBeUndefined('element.labels');
30 shouldNotBe('element.labels', 'null');
33 debug('\nLabelable: ' + name
+ ' ' + element
);
34 shouldBe('element.labels.length', '1');