| <!-- webkit-test-runner [ useFlexibleViewport=true textExtractionEnabled=true ] --> |
| <!DOCTYPE html> |
| <html> |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
| <meta charset="utf-8"> |
| <head> |
| <style> |
| body { |
| white-space: pre-wrap; |
| } |
| |
| .clickable { |
| background-color: lightblue; |
| padding: 10px; |
| margin: 5px; |
| cursor: pointer; |
| } |
| |
| .focusable { |
| border: 2px solid green; |
| padding: 5px; |
| margin: 3px; |
| } |
| |
| .interactive { |
| background-color: lightyellow; |
| padding: 8px; |
| } |
| |
| canvas { |
| width: 200px; |
| height: 200px; |
| } |
| |
| .canvas-container { |
| border: 1px dashed gray; |
| padding: 1em; |
| } |
| |
| #error-text { |
| display: none; |
| } |
| </style> |
| <script src="../../resources/ui-helper.js"></script> |
| </head> |
| <body> |
| <div role="banner"> |
| <h1 id="main-title" aria-label="Main Page Title">Welcome to Test Page</h1> |
| </div> |
| <nav role="navigation" aria-label="Main navigation"> |
| <ul> |
| <li><a href="mailto:wenson_hsieh@apple.com" onclick="return false;">Section 1</a></li> |
| <li><a href="https://example.com/" onclick="return false;">Section 2</a></li> |
| </ul> |
| </nav> |
| <main role="main"> |
| <section id="section1" aria-label="Interactive Elements"> |
| <button class="clickable" onclick="console.log('clicked')" aria-label="Test button" aria-describedby="btn-help">Click Me</button> |
| <div id="btn-help" aria-hidden="true">This button does nothing</div> |
| <input type="text" class="focusable" placeholder="Enter text here" onfocus="this.style.backgroundColor='yellow'" onblur="this.style.backgroundColor=''" aria-required="true" aria-invalid="false" /> |
| <div class="interactive" tabindex="0" role="button" onclick="this.textContent = 'Clicked!'" onkeydown="if(event.key==='Enter') this.click()" aria-pressed="false">Clickable Div</div> |
| </section> |
| <section id="section2" aria-label="ARIA Labeling Examples"> |
| <div id="label1">Name Field</div> |
| <div id="label2">Description</div> |
| <input type="text" aria-labelledby="label1" placeholder="Your name" /> |
| <div aria-labelledby="label2" role="region"> |
| <p>This region is labeled by another element.</p> |
| </div> |
| <div id="error-text">Name not found.</div> |
| <input type="text" aria-labelledby="label1" aria-describedby="error-text" placeholder="Full name" /> |
| <div id="title-label">User Profile</div> |
| <div role="group" aria-labelledby="title-label"> |
| <label for="username">Username:</label> |
| <input type="text" id="username" /> |
| </div> |
| </section> |
| </main> |
| <script> |
| addEventListener("load", async () => { |
| if (!window.testRunner) |
| return; |
| |
| testRunner.dumpAsText(); |
| testRunner.waitUntilDone(); |
| |
| document.body.textContent = await UIHelper.requestDebugText({ |
| normalize: true, |
| nodeIdentifierInclusion: "allContainers", |
| }); |
| |
| testRunner.notifyDone(); |
| }); |
| </script> |
| </body> |
| </html> |