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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/shadow/delegatesFocus-highlight-sibling.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 <script src="resources/shadow-dom.js"></script> 3 <script src="resources/shadow-dom.js"></script>
4 <!-- Adapted from http://jsbin.com/dexinu/6/edit for layout test --> 4 <!-- Adapted from http://jsbin.com/dexinu/6/edit for layout test -->
5 5
6 <template id="XMenuTemplate"> 6 <template id="XMenuTemplate">
7 <style> 7 <style>
8 :host { 8 :host {
9 display: inline-block; 9 display: inline-block;
10 position: relative; 10 position: relative;
(...skipping 27 matching lines...) Expand all
38 <x-menu id="XMenu4" tabindex="0" delegatesFocus></x-menu> 38 <x-menu id="XMenu4" tabindex="0" delegatesFocus></x-menu>
39 </section> 39 </section>
40 40
41 <script> 41 <script>
42 function RegisterXMenu() { 42 function RegisterXMenu() {
43 var template = document.getElementById('XMenuTemplate'); 43 var template = document.getElementById('XMenuTemplate');
44 44
45 var xMenuProto = Object.create(HTMLElement.prototype); 45 var xMenuProto = Object.create(HTMLElement.prototype);
46 xMenuProto.createdCallback = function() { 46 xMenuProto.createdCallback = function() {
47 var delegatesFocus = this.hasAttribute('delegatesFocus'); 47 var delegatesFocus = this.hasAttribute('delegatesFocus');
48 this.createShadowRoot({ 'delegatesFocus': delegatesFocus }) 48 this.attachShadow({ 'delegatesFocus': delegatesFocus })
49 .appendChild( 49 .appendChild(
50 document.importNode(template.content, true) 50 document.importNode(template.content, true)
51 ); 51 );
52 }; 52 };
53 document.registerElement('x-menu', { 53 document.registerElement('x-menu', {
54 prototype: xMenuProto 54 prototype: xMenuProto
55 }); 55 });
56 } 56 }
57 57
58 function test() { 58 function test() {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 shouldBeEqualToString('document.activeElement.id', 'XMenu1'); 120 shouldBeEqualToString('document.activeElement.id', 'XMenu1');
121 backgroundColorShouldBe('XMenu1', 'rgb(170, 170, 170)'); 121 backgroundColorShouldBe('XMenu1', 'rgb(170, 170, 170)');
122 backgroundColorShouldBe('XMenu2', 'rgb(170, 170, 170)'); 122 backgroundColorShouldBe('XMenu2', 'rgb(170, 170, 170)');
123 backgroundColorShouldBe('XMenu3', 'rgb(170, 170, 170)'); 123 backgroundColorShouldBe('XMenu3', 'rgb(170, 170, 170)');
124 backgroundColorShouldBe('XMenu4', 'rgb(170, 170, 170)'); 124 backgroundColorShouldBe('XMenu4', 'rgb(170, 170, 170)');
125 } 125 }
126 126
127 RegisterXMenu(); 127 RegisterXMenu();
128 test(); 128 test();
129 </script> 129 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698