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

Side by Side Diff: LayoutTests/fast/dom/shadow/create-shadow-root-with-parameter.html

Issue 1168323002: Support parameter passing for shadow-dom.js's createShadowRoot (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix for comment, and update test expectation. 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/create-shadow-root-with-parameter-expected.txt » ('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 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../../resources/js-test.js"></script> 4 <script src="../../../resources/js-test.js"></script>
5 <script src="resources/shadow-dom.js"></script>
5 </head> 6 </head>
6 <body> 7 <body>
7 <div id="host1"></div> 8 <div id="host1"></div>
8 <div id="host2"></div> 9 <div id="host2"></div>
9 <div id="host3"></div> 10 <div id="host3"></div>
10 <div id="host4"></div> 11 <div id="host4"></div>
11 </body> 12 </body>
12 <script> 13 <script>
13 debug('Create open shadow root.'); 14 debug('Create open shadow root.');
14 var host1 = document.querySelector('#host1'); 15 var host1 = document.querySelector('#host1');
15 var root1 = host1.createShadowRoot({mode: 'open'}); 16 var root1 = host1.createShadowRoot({mode: 'open'});
16 shouldBeNonNull(root1); 17 shouldBeNonNull(root1);
17 18
18 debug('Create closed shadow root.'); 19 debug('Create closed shadow root.');
19 var host2 = document.querySelector('#host2'); 20 var host2 = document.querySelector('#host2');
20 // TODO(kochi): Closed mode is not implemented yet. crbug.com/459136 21 // TODO(kochi): Closed mode is not implemented yet. crbug.com/459136
21 shouldThrow("host2.createShadowRoot({mode: 'closed'})"); 22 shouldThrow("host2.createShadowRoot({mode: 'closed'})");
22 23
23 debug('Create shadow root with empty parameter.'); 24 debug('Create shadow root with empty parameter.');
24 var host3 = document.querySelector('#host3'); 25 var host3 = document.querySelector('#host3');
25 var root3 = host3.createShadowRoot({}); 26 var root3 = host3.createShadowRoot({});
26 shouldBeNonNull(root3); 27 shouldBeNonNull(root3);
27 28
28 debug('Create shadow root whose mode is neither open nor closed.'); 29 debug('Create shadow root whose mode is neither open nor closed.');
29 var host4 = document.querySelector('#host4'); 30 var host4 = document.querySelector('#host4');
30 shouldThrow("host4.createShadowRoot({mode: 'illegal'})"); 31 shouldThrow("host4.createShadowRoot({mode: 'illegal'})");
32
33 debug('Create open shadow root with shadow-dom.js utility.');
34 document.body.appendChild(
35 createDOM('div', {id: 'host5'},
36 createShadowRoot({mode: 'open'})));
37 var host5 = document.querySelector('#host5');
38 var root5 = host5.shadowRoot;
39 shouldBeNonNull(root5);
31 </script> 40 </script>
32 </html> 41 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/shadow/create-shadow-root-with-parameter-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698