| 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 optgroup element became 'enabled' or not-'enabled', distribution shou
ld happen.</p> | |
| 10 <p>Since an optgroup element does not create a renderer, we cannot check this us
ing reftest.</p> | |
| 11 | |
| 12 <div id="container"> | |
| 13 <div id="host1"> | |
| 14 <optgroup id="optgroup1">optgroup 1</optgroup> | |
| 15 <optgroup id="optgroup2">optgroup 2</optgroup> | |
| 16 </div> | |
| 17 | |
| 18 <div id="host2"> | |
| 19 <optgroup id="optgroup3" disabled>optgroup 3</optgroup> | |
| 20 <optgroup id="optgroup4" disabled>optgroup 4</optgroup> | |
| 21 </div> | |
| 22 </div> | |
| 23 | |
| 24 <pre id="console"></pre> | |
| 25 | |
| 26 <script> | |
| 27 jsTestIsAsync = true; | |
| 28 | |
| 29 var shadowRoot1 = host1.createShadowRoot(); | |
| 30 var shadowRoot2 = host2.createShadowRoot(); | |
| 31 | |
| 32 shadowRoot1.innerHTML = '<content select=":enabled">'; | |
| 33 shadowRoot2.innerHTML = '<content select=":enabled">'; | |
| 34 | |
| 35 var content1 = shadowRoot1.querySelector('content'); | |
| 36 var content2 = shadowRoot2.querySelector('content'); | |
| 37 | |
| 38 setTimeout(function() { | |
| 39 optgroup2.setAttribute('disabled', true); | |
| 40 optgroup4.removeAttribute('disabled'); | |
| 41 | |
| 42 nodes1 = content1.getDistributedNodes(); | |
| 43 shouldBe('nodes1.length', '1'); | |
| 44 shouldBe('nodes1.item(0).innerHTML', '"optgroup 1"'); | |
| 45 | |
| 46 nodes2 = content2.getDistributedNodes(); | |
| 47 shouldBe('nodes2.length', '1'); | |
| 48 shouldBe('nodes2.item(0).innerHTML', '"optgroup 4"'); | |
| 49 | |
| 50 container.innerHTML = ""; | |
| 51 finishJSTest(); | |
| 52 }, 0); | |
| 53 | |
| 54 </script> | |
| 55 </body> | |
| 56 </html> | |
| OLD | NEW |