| OLD | NEW |
| 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 Loading... |
| 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> |
| OLD | NEW |