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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/shadow/css-focus-pseudo-match-shadow-host2.html

Issue 1774113002: Move Shadow DOM V1 tests from fast/dom/shadow to shadow-dom (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 9 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: third_party/WebKit/LayoutTests/fast/dom/shadow/css-focus-pseudo-match-shadow-host2.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/css-focus-pseudo-match-shadow-host2.html b/third_party/WebKit/LayoutTests/fast/dom/shadow/css-focus-pseudo-match-shadow-host2.html
deleted file mode 100644
index 009100c5b3ffcc8ce28563127f5c60cbde5399c4..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/css-focus-pseudo-match-shadow-host2.html
+++ /dev/null
@@ -1,115 +0,0 @@
-<!DOCTYPE html>
-<script src="../../../resources/js-test.js"></script>
-<script src="resources/shadow-dom.js"></script>
-<style>
-div {
- background-color: white;
-}
-
-div#shadow-host:focus {
- background-color: green;
-}
-</style>
-<body>
-<div id="sandbox"></div>
-</body>
-<script>
-function buildSingleShadowTree(delegatesFocus) {
- var sandbox = document.querySelector('#sandbox');
- sandbox.innerHTML = '';
- sandbox.appendChild(
- createDOM('div', {},
- createDOM('input', {'id': 'outer-input'}),
- createDOM('div', {'id': 'shadow-host'},
- createDOM('input', {'id': 'lightdom-input'}),
- attachShadow(
- {'mode': 'open', 'delegatesFocus': delegatesFocus},
- createDOM('slot'),
- createDOM('input', {'id': 'inner-input'})))));
-
- sandbox.offsetTop;
-}
-
-function testSingleShadow() {
- debug('(1/6) Testing how :focus matches on shadow host with delegatesFocus=false.');
- buildSingleShadowTree(false);
-
- var host = document.querySelector('#shadow-host');
- var lightdomInput = document.querySelector('#lightdom-input');
- var innerInput = getNodeInComposedTree('shadow-host/inner-input');
- var outerInput = document.querySelector('#outer-input');
-
- outerInput.focus();
- backgroundColorShouldBe('shadow-host', 'rgb(255, 255, 255)');
- lightdomInput.focus();
- backgroundColorShouldBe('shadow-host', 'rgb(255, 255, 255)');
- innerInput.focus();
- backgroundColorShouldBe('shadow-host', 'rgb(255, 255, 255)');
- host.focus(); // host will not get focus as it is not focusable.
- backgroundColorShouldBe('shadow-host', 'rgb(255, 255, 255)');
-
- debug('(2/6) Testing how :focus matches on shadow host with tabindex=-1, delegatesFocus=false.');
- host.tabIndex = -1;
- outerInput.focus();
- backgroundColorShouldBe('shadow-host', 'rgb(255, 255, 255)');
- lightdomInput.focus();
- backgroundColorShouldBe('shadow-host', 'rgb(255, 255, 255)');
- innerInput.focus();
- backgroundColorShouldBe('shadow-host', 'rgb(255, 255, 255)');
- host.focus();
- backgroundColorShouldBe('shadow-host', 'rgb(0, 128, 0)');
-
- debug('(3/6) Testing how :focus matches on shadow host with tabindex=0, delegatesFocus=false.');
- host.tabIndex = 0;
- outerInput.focus();
- backgroundColorShouldBe('shadow-host', 'rgb(255, 255, 255)');
- lightdomInput.focus();
- backgroundColorShouldBe('shadow-host', 'rgb(255, 255, 255)');
- innerInput.focus();
- backgroundColorShouldBe('shadow-host', 'rgb(255, 255, 255)');
- host.focus();
- backgroundColorShouldBe('shadow-host', 'rgb(0, 128, 0)');
-
-
- debug('(4/6) Testing how :focus matches on shadow host with delegatesFocus=true.');
- buildSingleShadowTree(true);
-
- var host = document.querySelector('#shadow-host');
- var lightdomInput = document.querySelector('#lightdom-input');
- var innerInput = getNodeInComposedTree('shadow-host/inner-input');
- var outerInput = document.querySelector('#outer-input');
-
- outerInput.focus();
- backgroundColorShouldBe('shadow-host', 'rgb(255, 255, 255)');
- lightdomInput.focus();
- backgroundColorShouldBe('shadow-host', 'rgb(255, 255, 255)');
- innerInput.focus();
- backgroundColorShouldBe('shadow-host', 'rgb(0, 128, 0)');
- host.focus();
- backgroundColorShouldBe('shadow-host', 'rgb(0, 128, 0)');
-
- debug('(5/6) Testing how :focus matches on shadow host with tabindex=-1, delegatesFocus=true.');
- host.tabIndex = -1;
- outerInput.focus();
- backgroundColorShouldBe('shadow-host', 'rgb(255, 255, 255)');
- lightdomInput.focus();
- backgroundColorShouldBe('shadow-host', 'rgb(255, 255, 255)');
- innerInput.focus();
- backgroundColorShouldBe('shadow-host', 'rgb(0, 128, 0)');
- host.focus();
- backgroundColorShouldBe('shadow-host', 'rgb(0, 128, 0)');
-
- debug('(6/6) Testing how :focus matches on shadow host with tabindex=0, delegatesFocus=true.');
- host.tabIndex = 0;
- outerInput.focus();
- backgroundColorShouldBe('shadow-host', 'rgb(255, 255, 255)');
- lightdomInput.focus();
- backgroundColorShouldBe('shadow-host', 'rgb(255, 255, 255)');
- innerInput.focus();
- backgroundColorShouldBe('shadow-host', 'rgb(0, 128, 0)');
- host.focus();
- backgroundColorShouldBe('shadow-host', 'rgb(0, 128, 0)');
-}
-
-testSingleShadow();
-</script>

Powered by Google App Engine
This is Rietveld 408576698