| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script src="../../../resources/js-test.js"></script> | |
| 5 </head> | |
| 6 | |
| 7 <body> | |
| 8 | |
| 9 <p>When an option element became 'checked' or not-'checked', distribution should
happen.</p> | |
| 10 <p>Since an option element does not create a renderer, we cannot check this usin
g reftest.</p> | |
| 11 | |
| 12 <div id="container"> | |
| 13 <div id="host1"> | |
| 14 <option id="option1">option 1</option> | |
| 15 </div> | |
| 16 | |
| 17 <div id="host2"> | |
| 18 <option id="option2" selected>option 2</option> | |
| 19 </div> | |
| 20 </div> | |
| 21 | |
| 22 <pre id="console"></pre> | |
| 23 | |
| 24 <script> | |
| 25 jsTestIsAsync = true; | |
| 26 | |
| 27 var shadowRoot1 = host1.createShadowRoot(); | |
| 28 var shadowRoot2 = host2.createShadowRoot(); | |
| 29 | |
| 30 shadowRoot1.innerHTML = '<content select="option:checked">'; | |
| 31 shadowRoot2.innerHTML = '<content select="option:checked">'; | |
| 32 | |
| 33 var content1 = shadowRoot1.querySelector('content'); | |
| 34 var content2 = shadowRoot2.querySelector('content'); | |
| 35 | |
| 36 setTimeout(function() { | |
| 37 nodes1 = content1.getDistributedNodes(); | |
| 38 shouldBe('nodes1.length', '0'); | |
| 39 | |
| 40 nodes2 = content2.getDistributedNodes(); | |
| 41 shouldBe('nodes2.length', '1'); | |
| 42 | |
| 43 debug('Flipping :checked state'); | |
| 44 option1.setAttribute('selected', true); | |
| 45 option2.selected = false; | |
| 46 | |
| 47 nodes1 = content1.getDistributedNodes(); | |
| 48 shouldBe('nodes1.length', '1'); | |
| 49 | |
| 50 nodes2 = content2.getDistributedNodes(); | |
| 51 shouldBe('nodes2.length', '0'); | |
| 52 | |
| 53 container.innerHTML = ""; | |
| 54 finishJSTest(); | |
| 55 }, 0); | |
| 56 | |
| 57 </script> | |
| 58 </body> | |
| 59 </html> | |
| OLD | NEW |