| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../resources/js-test.js"></script> | 4 <script src="../resources/js-test.js"></script> |
| 5 <script src="../resources/accessibility-helper.js"></script> | 5 <script src="../resources/accessibility-helper.js"></script> |
| 6 </head> | 6 </head> |
| 7 <body id="body"> | 7 <body id="body"> |
| 8 | 8 |
| 9 <fieldset> | 9 <fieldset id="fieldset"> |
| 10 <legend>Choose a shipping method:</legend> | 10 <legend>Choose a shipping method:</legend> |
| 11 <input id="overnight" type="radio" name="shipping" value="overnight" />Overn
ight | 11 <div role="group"><input id="overnight" type="radio" name="shipping" value="
overnight" />Overnight</div> |
| 12 </fieldset> | 12 </fieldset> |
| 13 | 13 |
| 14 <div>End of test</div> | 14 <div>End of test</div> |
| 15 | 15 |
| 16 <p id="description"></p> | 16 <p id="description"></p> |
| 17 <div id="console"></div> | 17 <div id="console"></div> |
| 18 | 18 |
| 19 <script> | 19 <script> |
| 20 | 20 |
| 21 description("This tests that a fieldset's title ui element is the legend."); | 21 description("This tests that a fieldset's title ui element is the legend."); |
| 22 | 22 |
| 23 if (window.accessibilityController) { | 23 if (window.accessibilityController) { |
| 24 document.body.focus(); | 24 var fieldset = accessibilityController.accessibleElementById("fieldset")
; |
| 25 var body = accessibilityController.focusedElement; | |
| 26 var fieldset = body.childAtIndex(0); | |
| 27 var titleUIElement = fieldset.nameElementAtIndex(0); | 25 var titleUIElement = fieldset.nameElementAtIndex(0); |
| 28 | 26 |
| 29 // Print out the tree of accessible objects, indicating the titleUIEleme
nt so | 27 // Print out the tree of accessible objects, indicating the titleUIEleme
nt so |
| 30 // that each platform can verify their expected object has been found | 28 // that each platform can verify their expected object has been found |
| 31 buildAccessibilityTree(body, 0, 0, 0, titleUIElement, "<< fieldset's tit
leUIElement"); | 29 buildAccessibilityTree(accessibilityController.rootElement, 0, 0, 0, tit
leUIElement, "<< fieldset's titleUIElement"); |
| 32 | 30 |
| 33 // Verify that we have gotten the titleUIElement and it has the expected
text, | 31 // Verify that we have gotten the titleUIElement and it has the expected
text, |
| 34 // which should be in the last descendant regardless of platform. | 32 // which should be in the last descendant regardless of platform. |
| 35 shouldBeTrue("titleUIElement != null"); | 33 shouldBeTrue("titleUIElement != null"); |
| 36 var titleUIElementText = titleUIElement; | 34 var titleUIElementText = titleUIElement; |
| 37 while (titleUIElementText && titleUIElementText.childrenCount) | 35 while (titleUIElementText && titleUIElementText.childrenCount) |
| 38 titleUIElementText = titleUIElementText.childAtIndex(0); | 36 titleUIElementText = titleUIElementText.childAtIndex(0); |
| 39 | 37 |
| 40 shouldBe("titleUIElementText.name", "'Choose a shipping method:'"); | 38 shouldBe("titleUIElementText.name", "'Choose a shipping method:'"); |
| 41 } | 39 } |
| 42 </script> | 40 </script> |
| 43 | 41 |
| 44 </body> | 42 </body> |
| 45 </html> | 43 </html> |
| OLD | NEW |