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

Side by Side Diff: LayoutTests/fast/dom/shadow/css-focus-pseudo-match-shadow-host1.html

Issue 1187053004: Move backgroundColorOf/backgroundColorShouldBe to shadow-dom.js (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/fast/dom/shadow/css-focus-pseudo-match-shadow-host2.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../../../resources/js-test.js"></script> 2 <script src="../../../resources/js-test.js"></script>
3 <script src="resources/shadow-dom.js"></script> 3 <script src="resources/shadow-dom.js"></script>
4 <style> 4 <style>
5 div { 5 div {
6 background-color: white; 6 background-color: white;
7 } 7 }
8 8
9 div#shadow-host:focus { 9 div#shadow-host:focus {
10 background-color: green; 10 background-color: green;
11 } 11 }
12 </style> 12 </style>
13 <body> 13 <body>
14 <div id="sandbox"></div> 14 <div id="sandbox"></div>
15 </body> 15 </body>
16 <script> 16 <script>
17 function backgroundColorOf(selector) {
18 return window.getComputedStyle(getNodeInTreeOfTrees(selector)).backgroundCol or;
19 }
20
21 function backgroundColorShouldBe(selector, expected) {
22 shouldBeEqualToString('backgroundColorOf(\'' + selector + '\')', expected);
23 }
24
25 function testWithoutDelegatesFocus() 17 function testWithoutDelegatesFocus()
26 { 18 {
27 debug(':focus and shadow host without delegatesFocus for crbug/479050'); 19 debug(':focus and shadow host without delegatesFocus for crbug/479050');
28 20
29 // Setting up the DOM tree 21 // Setting up the DOM tree
30 var sandbox = document.querySelector('#sandbox'); 22 var sandbox = document.querySelector('#sandbox');
31 sandbox.innerHTML = ''; 23 sandbox.innerHTML = '';
32 sandbox.appendChild( 24 sandbox.appendChild(
33 createDOM('div', {}, 25 createDOM('div', {},
34 createDOM('input', {'id': 'outer-input1'}), 26 createDOM('input', {'id': 'outer-input1'}),
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 innerInput.focus(); 74 innerInput.focus();
83 backgroundColorShouldBe('shadow-host', 'rgb(255, 255, 255)'); 75 backgroundColorShouldBe('shadow-host', 'rgb(255, 255, 255)');
84 lightdomInput.focus(); 76 lightdomInput.focus();
85 backgroundColorShouldBe('shadow-host', 'rgb(255, 255, 255)'); 77 backgroundColorShouldBe('shadow-host', 'rgb(255, 255, 255)');
86 host.focus(); 78 host.focus();
87 backgroundColorShouldBe('shadow-host', 'rgb(0, 128, 0)'); 79 backgroundColorShouldBe('shadow-host', 'rgb(0, 128, 0)');
88 } 80 }
89 81
90 testWithoutDelegatesFocus(); 82 testWithoutDelegatesFocus();
91 </script> 83 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/shadow/css-focus-pseudo-match-shadow-host2.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698