OLD | NEW |
1 <!-- | 1 <!-- |
2 * Copyright 2015 The Chromium Authors. All rights reserved. Use of this | 2 * Copyright 2015 The Chromium Authors. All rights reserved. Use of this |
3 * source code is governed by a BSD-style license that can be found in the | 3 * source code is governed by a BSD-style license that can be found in the |
4 * LICENSE file. | 4 * LICENSE file. |
5 --> | 5 --> |
6 <html> | 6 <html> |
7 <head> | 7 <head> |
8 <title>Automation Tests - Tree change</title> | 8 <title>Automation Tests - Tree change</title> |
9 </head> | 9 </head> |
10 <body> | 10 <body> |
11 <ul id="list"> | 11 <ul id="list"> |
12 <li>One</li> | 12 <li>One</li> |
13 <li>Two</li> | 13 <li>Two</li> |
14 </ul> | 14 </ul> |
15 <button id="add">Add</button> | 15 <button id="add">Add</button> |
16 <button id="remove">Remove</button> | 16 <button id="remove">Remove</button> |
| 17 <button id="live">Live</button> |
| 18 |
| 19 <div id="dead_region1"></div> |
| 20 <div id="live_region" aria-live="polite"></div> |
| 21 <div id="dead_region2"></div> |
17 | 22 |
18 <script> | 23 <script> |
19 document.getElementById('add').addEventListener('click', function() { | 24 document.getElementById('add').addEventListener('click', function() { |
20 var li = document.createElement('li'); | 25 var li = document.createElement('li'); |
21 li.innerText = "New"; | 26 li.innerText = 'New'; |
22 document.getElementById('list').appendChild(li); | 27 document.getElementById('list').appendChild(li); |
23 }); | 28 }); |
24 document.getElementById('remove').addEventListener('click', function() { | 29 document.getElementById('remove').addEventListener('click', function() { |
25 var list = document.getElementById('list'); | 30 var list = document.getElementById('list'); |
26 list.removeChild(list.lastElementChild); | 31 list.removeChild(list.lastElementChild); |
27 }); | 32 }); |
| 33 document.getElementById('live').addEventListener('click', function() { |
| 34 var p1 = document.createElement('p'); |
| 35 p1.innerText = 'Dead'; |
| 36 document.getElementById('dead_region1').appendChild(p1); |
| 37 |
| 38 var p = document.createElement('p'); |
| 39 p.innerText = 'Live'; |
| 40 document.getElementById('live_region').appendChild(p); |
| 41 |
| 42 var p2 = document.createElement('p'); |
| 43 p2.innerText = 'Dead'; |
| 44 document.getElementById('dead_region2').appendChild(p2); |
| 45 }); |
28 </script> | 46 </script> |
29 | 47 |
30 </body> | 48 </body> |
31 </html> | 49 </html> |
OLD | NEW |