3 <script src=
"../../../resources/js-test.js"></script>
5 <label id=
"label1">Label:
<input type=
"date" id=
"date1"></label>
7 debug('Check if clicking a label focuses on a date input in it.');
8 // Force layout because we can't focus on elements without LayoutBox.
9 document
.body
.offsetLeft
;
10 shouldBeEqualToString('document.activeElement.id', 'body');
11 debug('Clicking a label.');
12 var clickEvent
= document
.createEvent('MouseEvent');
13 clickEvent
.initEvent('click', true, true);
14 document
.getElementById('label1').dispatchEvent(clickEvent
);
15 shouldBeEqualToString('document.activeElement.id', 'date1');