summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/label/contenteditable-label-focus-tab.html
blob: ebb4193bc73a8e05e464236baefff774bc44e2ef (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
<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/js-test.js"></script>
<script>
function runTest() {
    var label = document.getElementById('label');
    var button = document.getElementById('button');
    label.focus();
    debug('Focus should be on the label');
    shouldBe('document.activeElement', 'label');
    eventSender.keyDown('\t');
    debug('Focus should be on the button after pressing tab');
    shouldBe('document.activeElement', 'button');
    eventSender.keyDown('\t', ['shiftKey']);
    debug('Focus should be on the label after pressing shift+tab');
    shouldBe('document.activeElement', 'label');
}
</script>
</head>
<body onload="runTest()">
<label id="label" contenteditable>I'm editable.</label>
<button id="button">Just a button</button>
</body>
</html>