| Index: LayoutTests/fast/dom/shadow/focusable-elements-with-tabstop.html
|
| diff --git a/LayoutTests/fast/dom/shadow/focusable-elements-with-tabstop.html b/LayoutTests/fast/dom/shadow/focusable-elements-with-tabstop.html
|
| deleted file mode 100644
|
| index c5d0818280e914ce602e77422ef6871c811d3bb2..0000000000000000000000000000000000000000
|
| --- a/LayoutTests/fast/dom/shadow/focusable-elements-with-tabstop.html
|
| +++ /dev/null
|
| @@ -1,199 +0,0 @@
|
| -<!DOCTYPE html>
|
| -<html>
|
| -<head>
|
| -<script src="../../../resources/js-test.js"></script>
|
| -<script src="resources/shadow-dom.js"></script>
|
| -</head>
|
| -<body>
|
| -<p>This tests TAB focus navigation with tabStop property on focusable elements</p>
|
| -<pre id="console"></pre>
|
| -<div id="sandbox"></div>
|
| -<script>
|
| -function prepareFocusableElements(parent) {
|
| - parent.appendChild(
|
| - createDOM('div', {'id': 'container'},
|
| - createDOM('input', {'id': 'input-before'}),
|
| - createDOM('button', {'id': 'button-focusable'}),
|
| - createDOM('input', {'id': 'input-focusable'}),
|
| - createDOM('input', {'id': 'input-after'})));
|
| - parent.offsetTop;
|
| -}
|
| -
|
| -function prepareButtonWithShadow(parent) {
|
| - parent.appendChild(
|
| - createDOM('div', {'id': 'button-container'},
|
| - createDOM('input', {'id': 'button-before'}),
|
| - createDOM('button', {'id': 'button-host'},
|
| - createShadowRoot(
|
| - createDOM('input', {'id': 'button-inner'}))),
|
| - createDOM('input', {'id': 'button-after'})));
|
| - parent.offsetTop;
|
| -}
|
| -
|
| -function prepareAnchorWithShadow(parent) {
|
| - parent.appendChild(
|
| - createDOM('div', {'id': 'anchor-container'},
|
| - createDOM('input', {'id': 'anchor-before'}),
|
| - createDOM('a', {'id': 'anchor-host'},
|
| - createShadowRoot(
|
| - createDOM('input', {'id': 'anchor-inner'}))),
|
| - createDOM('input', {'id': 'anchor-after'})));
|
| -
|
| - parent.offsetTop;
|
| -}
|
| -
|
| -var button_host;
|
| -var anchor_host;
|
| -
|
| -function testFocusableElementsWithIsTabStop() {
|
| - debug("Testing tab focus navigation order on focusable nodes");
|
| -
|
| - prepareFocusableElements(sandbox);
|
| -
|
| - debug("Normal tab order without tabStop");
|
| -
|
| - var expectedOrder = [
|
| - 'input-before',
|
| - 'button-focusable',
|
| - 'input-focusable',
|
| - 'input-after'
|
| - ];
|
| -
|
| - testFocusNavigationForward(expectedOrder);
|
| - expectedOrder.reverse();
|
| - testFocusNavigationBackward(expectedOrder);
|
| -
|
| - debug("Normal tab order with tabStop=false");
|
| -
|
| - button_focusable = document.getElementById("button-focusable");
|
| - button_focusable.tabStop = false;
|
| - input_focusable = document.getElementById("input-focusable");
|
| - input_focusable.tabStop = false;
|
| -
|
| - expectedOrder = [
|
| - 'input-before',
|
| - // These will be skipped with tabStop = false.
|
| - // 'button-focusable',
|
| - // 'input-focusable',
|
| - 'input-after'
|
| - ];
|
| -
|
| - testFocusNavigationForward(expectedOrder);
|
| - expectedOrder.reverse();
|
| - testFocusNavigationBackward(expectedOrder);
|
| -}
|
| -
|
| -function testButton() {
|
| - debug("Testing tabStop property on button");
|
| -
|
| - prepareButtonWithShadow(sandbox);
|
| -
|
| - debug("Normal tab order without tabindex");
|
| -
|
| - button_host = document.getElementById("button-host");
|
| - shouldBe('button_host.tabStop', 'true');
|
| -
|
| - var expectedOrder = [
|
| - 'button-before',
|
| - 'button-host',
|
| - 'button-host/button-inner',
|
| - 'button-after'
|
| - ];
|
| -
|
| - testFocusNavigationForward(expectedOrder);
|
| - expectedOrder.reverse();
|
| - testFocusNavigationBackward(expectedOrder);
|
| -
|
| - debug("Testing tabStop property on button with tabStop = false");
|
| - button_host.tabStop = false;
|
| -
|
| - expectedOrder = [
|
| - 'button-before',
|
| - // 'button-host', // host should be skipped when tabStop=false
|
| - 'button-host/button-inner',
|
| - 'button-after'
|
| - ];
|
| -
|
| - testFocusNavigationForward(expectedOrder);
|
| - expectedOrder.reverse();
|
| - testFocusNavigationBackward(expectedOrder);
|
| -}
|
| -
|
| -function testAnchor() {
|
| - debug("Testing tabStop property on anchor without href");
|
| -
|
| - prepareAnchorWithShadow(sandbox);
|
| -
|
| - // This is questionable, but true; <a> without href returns 0 for tabIndex.
|
| - anchor_host = document.getElementById("anchor-host");
|
| - shouldBe('anchor_host.tabStop', 'true');
|
| -
|
| - var expectedOrder = [
|
| - 'anchor-before',
|
| - 'anchor-host/anchor-inner',
|
| - 'anchor-after'
|
| - ];
|
| -
|
| - testFocusNavigationForward(expectedOrder);
|
| - expectedOrder.reverse();
|
| - testFocusNavigationBackward(expectedOrder);
|
| -
|
| - debug("Testing tabStop property on anchor with href");
|
| -
|
| - anchor_host.setAttribute('href', '#');
|
| - anchor_host.offsetTop;
|
| - shouldBe('anchor_host.tabStop', 'true');
|
| -
|
| - expectedOrder = [
|
| - 'anchor-before',
|
| - 'anchor-host',
|
| - 'anchor-host/anchor-inner',
|
| - 'anchor-after'
|
| - ];
|
| -
|
| - testFocusNavigationForward(expectedOrder);
|
| - expectedOrder.reverse();
|
| - testFocusNavigationBackward(expectedOrder);
|
| -
|
| - debug("Testing tabStop property on anchor with href but tabStop = false");
|
| -
|
| - anchor_host.tabStop = false;
|
| -
|
| - expectedOrder = [
|
| - 'anchor-before',
|
| - // 'anchor-host', // host should be skipped when tabStop=false
|
| - 'anchor-host/anchor-inner',
|
| - 'anchor-after'
|
| - ];
|
| -
|
| - testFocusNavigationForward(expectedOrder);
|
| - expectedOrder.reverse();
|
| - testFocusNavigationBackward(expectedOrder);
|
| -}
|
| -
|
| -function run_tests() {
|
| - if (window.testRunner)
|
| - testRunner.dumpAsText();
|
| -
|
| - if (!window.eventSender) {
|
| - testFailed('');
|
| - return;
|
| - }
|
| -
|
| - testRunner.overridePreference("WebKitTabToLinksPreferenceKey", true);
|
| -
|
| - testFocusableElementsWithIsTabStop();
|
| - sandbox.innerHTML = '';
|
| -
|
| - testButton();
|
| - sandbox.innerHTML = '';
|
| -
|
| - testAnchor();
|
| -
|
| - debug('Test finished.');
|
| -}
|
| -
|
| -run_tests();
|
| -</script>
|
| -</body>
|
| -</html>
|
|
|