blob: aa1cfa3a6b02d298922f228726d4f79e4c4111d8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
<!DOCTYPE html>
<body>
<script src="../../../resources/js-test.js"></script>
<script>
description('Check if element.focus() does not focus on disabled sub-fields.');
if (window.internals)
internals.settings.setLangAttributeAwareFormControlUIEnabled(true);
else
debug('This test requires DRT/WRT.');
var dateInput = document.createElement('input');
dateInput.lang = 'ja-jp';
dateInput.type = 'date';
dateInput.min = '2013-02-01';
dateInput.max = '2013-03-30';
document.body.appendChild(dateInput);
// Assume the date format is "yyyy/MM/dd"
dateInput.focus();
// Because the year field is fixed, the first focusable element is the
// month field.
shouldBeEqualToString('internals.shadowPseudoId(internals.youngestShadowRoot(dateInput).activeElement)', '-webkit-datetime-edit-month-field');
dateInput.blur();
dateInput.focus();
shouldBeEqualToString('internals.shadowPseudoId(internals.youngestShadowRoot(dateInput).activeElement)', '-webkit-datetime-edit-month-field');
dateInput.remove();
</script>
</body>
|