| <!DOCTYPE html> |
| <html> |
| <head> |
| <script src="../resources/js-test-pre.js"></script> |
| <title>aria-labelledby Overrides aria-labeledby</title> |
| </head> |
| <body> |
| |
| <div id="test"> |
| <a aria-labeledby="x1 x2" aria-labelledby="y1 y2" href="#" id="link">X</a> |
| <!-- Incorrectly spelled aria-labelledby attribute labels. --> |
| <span id="x1">I</span> |
| <span id="x2">J</span> |
| <!-- Correctly spelled aria-labelledby attribute labels. --> |
| <span id="y1">Y</span> |
| <span id="y2">Z</span> |
| </div> |
| |
| <p id="description"></p> |
| <div id="console"></div> |
| |
| <script> |
| description("This tests that aria-labelledby overrides aria-labeledby correctly."); |
| |
| if (window.accessibilityController) { |
| var linkDescription = accessibilityController.accessibleElementById("link").description; |
| |
| shouldBe("linkDescription", "'AXDescription: Y Z'"); |
| |
| // Hide superfluous text. |
| document.getElementById("test").style.display = "none"; |
| } |
| </script> |
| |
| <script src="../resources/js-test-post.js"></script> |
| </body> |
| </html> |