blob: 7847f73e2dda840e9d0119881b82a6cb73a1b1f7 [file]
<!DOCTYPE html>
<html>
<body>
<script src="../../js/resources/js-test-pre.js"></script>
<script src="../resources/common.js"></script>
<input id="tabindex30" tabindex="30">
<input id="tabindex20-1" tabindex="20">
<input id="time-with-tabindex20" tabindex="20" type="time">
<input id="tabindex20-3" tabindex="20">
<input id="tabindex10" tabindex="10">
<script>
if (!window.eventSender || !window.internals)
debug('This requires DRT/WRT.');
var firstSubField = "-webkit-datetime-edit-hour-field";
var lastSubField = "-webkit-datetime-edit-ampm-field";
var tab = '\t';
var shift = ['shiftKey'];
$('tabindex10').focus();
var shadowRoot = internals.youngestShadowRoot($('time-with-tabindex20'));
debug('Forword:');
shouldBeEqualToString('eventSender.keyDown(tab); document.activeElement.id', 'tabindex20-1');
shouldBeEqualToString('eventSender.keyDown(tab); document.activeElement.id', 'time-with-tabindex20');
shouldBe('shadowRoot.activeElement.getAttribute("pseudo")', 'firstSubField');
shouldBe('eventSender.keyDown(tab); eventSender.keyDown(tab); shadowRoot.activeElement.getAttribute("pseudo")', 'lastSubField');
shouldBeEqualToString('eventSender.keyDown(tab); document.activeElement.id', 'tabindex20-3');
shouldBeEqualToString('eventSender.keyDown(tab); document.activeElement.id', 'tabindex30');
debug('');
debug('Backword:');
shouldBeEqualToString('eventSender.keyDown(tab, shift); document.activeElement.id', 'tabindex20-3');
shouldBeEqualToString('eventSender.keyDown(tab, shift); document.activeElement.id', 'time-with-tabindex20');
shouldBe('shadowRoot.activeElement.getAttribute("pseudo")', 'lastSubField');
shouldBe('eventSender.keyDown(tab, shift); eventSender.keyDown(tab, shift); shadowRoot.activeElement.getAttribute("pseudo")', 'firstSubField');
shouldBeEqualToString('eventSender.keyDown(tab, shift); document.activeElement.id', 'tabindex20-1');
</script>
<script src="../../js/resources/js-test-post.js"></script>
</body>
</html>