aria-notify-document-announcement-manual.html (1549B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>ARIA Notify API Test: Document Announcement</title> 5 <link rel="help" href="https://github.com/w3c/aria/pull/2577"> 6 <link rel="author" title="Jacques Newman" href="mailto:janewman@microsoft.com"> 7 </head> 8 <body> 9 <h1>ARIA Notify API Test: Document Announcement</h1> 10 <p>This test checks the behavior of the <code>ariaNotify</code> API with a 11 simple announcement on the document object.</p> 12 13 <h2>Setup Instructions</h2> 14 <p><strong>Setup:</strong> Use a screen reader (NVDA, JAWS, VoiceOver, etc.) or other assistive technology that 15 supports the ARIA Notify API.</p> 16 <p><strong>Instructions:</strong> Click the "Run Test" button and listen for the announced text from your screen reader.</p> 17 18 <script> 19 function tryCallAriaNotify(element, message, options = {}) { 20 if (element.ariaNotify) { 21 element.ariaNotify(message, options); 22 return 'ariaNotify called' + ` with message: "${message}" and options: ${JSON.stringify(options)}`; 23 } else { 24 return 'the ariaNotify API is not supported in this browser'; 25 } 26 } 27 </script> 28 29 <div> 30 <h3>Test: Simple Announcement</h3> 31 <p><strong>Expected:</strong> Screen reader should announce "Hello, world!" using default priority (normal).</p> 32 33 <button onclick="test()">Run Test</button> 34 <div id="status"></div> 35 36 <script> 37 function test() { 38 document.getElementById('status').textContent = tryCallAriaNotify(document, 'Hello, world!'); 39 } 40 </script> 41 </div> 42 </body> 43 44 </html>