| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="../../resources/js-test.js"></script> | |
| <style> | |
| .offscreen { | |
| position:relative; | |
| top:9999px; | |
| } | |
| </style> | |
| <title>Table Visible Rows</title> | |
| </head> | |
| <body> | |
| <div id="table" role="grid"> | |
| <div class="onscreen" role="row"><span role="gridcell">A</span></div> | |
| <div class="onscreen" role="row"><span role="gridcell">B</span></div> | |
| <div class="onscreen" role="row"><span role="gridcell">C</span></div> | |
| <div class="offscreen" role="row"><span role="gridcell">D</span></div> | |
| <div class="offscreen" role="row"><span role="gridcell">E</span></div> | |
| </div> | |
| <p id="description"></p> | |
| <div id="console"></div> | |
| <script> | |
| description("This tests that AXVisibleRows returns visible rows correctly."); | |
| if (window.accessibilityController) { | |
| var table = accessibilityController.accessibleElementById("table"); | |
| // All rows. | |
| var rows = table.uiElementArrayAttributeValue("AXRows").length; | |
| shouldBe("rows", "5"); | |
| // Visible rows. | |
| var visibleRows = table.uiElementArrayAttributeValue("AXVisibleRows").length; | |
| shouldBe("visibleRows", "3"); | |
| // Hide superfluous text. | |
| document.getElementById("table").style.display = "none"; | |
| } | |
| </script> | |
| </body> | |
| </html> |