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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/shadow/focus-shadowhost-display-none.html

Issue 1408443003: Add Element.attachShadow under the ShadowDOMV1 runtime flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rewrite a test Created 5 years, 2 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../../../resources/js-test.js"></script> 2 <script src="../../../resources/js-test.js"></script>
3 <style> 3 <style>
4 div#host:focus { display: none; } 4 div#host:focus { display: none; }
5 </style> 5 </style>
6 <div id="sandbox"></div> 6 <div id="sandbox"></div>
7 <div id="host"></div> 7 <div id="host"></div>
8 <script> 8 <script>
9 description('Check if shadow host with display:none CSS rule for :focus works. crbug.com/482830'); 9 description('Check if shadow host with display:none CSS rule for :focus works. crbug.com/482830');
10 10
11 var host; 11 var host;
12 var root; 12 var root;
13 var input; 13 var input;
14 14
15 function setupShadowDOM(delegatesFocus) { 15 function setupShadowDOM(delegatesFocus) {
16 sandbox.innerHTML = ''; 16 sandbox.innerHTML = '';
17 host = sandbox.appendChild(document.createElement('div')); 17 host = sandbox.appendChild(document.createElement('div'));
18 host.id = 'host'; 18 host.id = 'host';
19 19
20 root = host.createShadowRoot({ 'delegatesFocus': delegatesFocus }); 20 root = host.attachShadow({ 'delegatesFocus': delegatesFocus });
21 input = document.createElement('input'); 21 input = document.createElement('input');
22 root.appendChild(input); 22 root.appendChild(input);
23 23
24 host.tabIndex = 0; 24 host.tabIndex = 0;
25 } 25 }
26 26
27 function testFocusShadowHost() { 27 function testFocusShadowHost() {
28 debug('when shadow host itself is focused, it should match display:none, los e focus then becomes display:block again.'); 28 debug('when shadow host itself is focused, it should match display:none, los e focus then becomes display:block again.');
29 setupShadowDOM(false); 29 setupShadowDOM(false);
30 return new Promise( 30 return new Promise(
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } 64 }
65 input.addEventListener('blur', onBlur); 65 input.addEventListener('blur', onBlur);
66 }); 66 });
67 } 67 }
68 68
69 if (window.testRunner) { 69 if (window.testRunner) {
70 testFocusShadowHost().then(testFocusInsideShadowRoot).then(function(){ testR unner.notifyDone(); }); 70 testFocusShadowHost().then(testFocusInsideShadowRoot).then(function(){ testR unner.notifyDone(); });
71 testRunner.waitUntilDone(); 71 testRunner.waitUntilDone();
72 } 72 }
73 </script> 73 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698