blob: 731f2fd24ceb8cfb1a2adaae3c60cb917f01e7f1 [file] [log] [blame]
<!DOCTYPE>
<body id=body>
<script src="../../../resources/js-test-pre.js"></script>
<label id="label1">Label: <input type="date" id="date1"></label>
<script>
debug('Check if clicking a label focuses on a date input in it.');
// Force layout because we can't focus on elements without RenderBox.
document.body.offsetLeft;
shouldBeEqualToString('document.activeElement.id', 'body');
debug('Clicking a label.');
var clickEvent = document.createEvent('MouseEvent');
clickEvent.initEvent('click', true, true);
document.getElementById('label1').dispatchEvent(clickEvent);
shouldBeEqualToString('document.activeElement.id', 'date1');
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>