Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(679)

Unified Diff: LayoutTests/fast/dom/shadow/focus-slide-on-shadow-host.html

Issue 1152623012: WIP: delegatesFocus (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/dom/shadow/focus-slide-on-shadow-host.html
diff --git a/LayoutTests/fast/dom/shadow/focus-slide-on-shadow-host.html b/LayoutTests/fast/dom/shadow/focus-slide-on-shadow-host.html
deleted file mode 100644
index 88e7029ebac176f6d6bc46db6237ec5e86a12e07..0000000000000000000000000000000000000000
--- a/LayoutTests/fast/dom/shadow/focus-slide-on-shadow-host.html
+++ /dev/null
@@ -1,111 +0,0 @@
-<!DOCTYPE html>
-<script src="../../../resources/js-test.js"></script>
-<script src="resources/shadow-dom.js"></script>
-<body>
-<pre id="console"></pre>
-<input id="defaultFocus">
-<div id="sandbox"></div>
-</body>
-<script>
-description('Click inside focusable shadow host should focus the host.');
-
-function prepareDOMTree(parent)
-{
- parent.appendChild(
- createDOM('div', {'id': 'shadowHost', 'tabindex': '0'},
- createShadowRoot(
- createDOM('div', {'id': 'innerDiv'},
- document.createTextNode('Blink')),
- createDOM('input', {'id': 'inputA'}),
- createDOM('input', {'id': 'inputB'}))));
-
- parent.offsetLeft;
-}
-
-var host;
-var innerDiv;
-var inputA;
-var inputB;
-
-function clickOn(el) {
- eventSender.mouseMoveTo(el.offsetLeft + 8, el.offsetTop + 8);
- eventSender.mouseDown();
- eventSender.mouseUp();
-}
-
-function resetFocus() {
- document.querySelector('#defaultFocus').focus();
-}
-
-function checkInnermostActiveElement(id) {
- if (isInnermostActiveElement(id))
- debug('PASS innermost active element is ' + id);
-}
-
-function runTest() {
- var sandbox = document.querySelector('#sandbox');
- prepareDOMTree(sandbox);
- resetFocus();
-
- host = getNodeInTreeOfTrees('shadowHost');
- innerDiv = getNodeInTreeOfTrees('shadowHost/innerDiv');
- inputA = getNodeInTreeOfTrees('shadowHost/inputA');
- inputB = getNodeInTreeOfTrees('shadowHost/inputB');
-
- debug('click on inner div should focus shadow host');
- clickOn(innerDiv);
- checkInnermostActiveElement('shadowHost');
-
- inputA.focus();
- checkInnermostActiveElement('shadowHost/inputA');
- clickOn(innerDiv);
- checkInnermostActiveElement('shadowHost');
-
- inputB.focus();
- clickOn(innerDiv);
- checkInnermostActiveElement('shadowHost');
-
- debug('click on inner div should focus inner focusable (with tabStop = false)');
- host.tabStop = false;
- resetFocus();
-
- inputA.value = 'wonderful'; // len = 9
- inputB.value = 'beautiful';
-
- clickOn(innerDiv);
- checkInnermostActiveElement('shadowHost/inputA');
-
- // If focus slides from shadow host, all the content will be selected.
- shouldBe('inputA.selectionStart', '0');
- shouldBe('inputA.selectionEnd', '9');
-
- // Clicking on non-focusable area inside shadow should not change the focus state.
- clickOn(innerDiv);
- checkInnermostActiveElement('shadowHost/inputA');
- shouldBe('inputA.selectionStart', '0');
- shouldBe('inputA.selectionEnd', '9');
-
- // Clicking on focusable directly will cause the element to be focused.
- clickOn(inputA);
- checkInnermostActiveElement('shadowHost/inputA');
- clickOn(innerDiv);
- checkInnermostActiveElement('shadowHost/inputA');
- shouldBe('inputA.selectionStart', '1');
- shouldBe('inputA.selectionEnd', '1');
-
- clickOn(inputB);
- checkInnermostActiveElement('shadowHost/inputB');
- clickOn(innerDiv);
- checkInnermostActiveElement('shadowHost/inputB');
- shouldBe('inputB.selectionStart', '1');
- shouldBe('inputB.selectionEnd', '1');
-}
-
-if (window.testRunner)
- testRunner.dumpAsText();
-
-if (!window.eventSender)
- testFailed('');
-
-window.onload = runTest;
-</script>

Powered by Google App Engine
This is Rietveld 408576698