Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions html-aam/area-role-tentative.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!doctype html>
<html>
<head>
<title>HTMLAreaElement Role Verification Tests</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/wai-aria/scripts/aria-utils.js"></script>
</head>
<body>

<map name="areamap">
<area shape="rect" coords="0,0,15,15" href="#" alt="x" data-testname="el-area" data-expectedrole="link" class="ex">
<!--
GP start tentative, trying to align <area> with no href but js event associated to <a> behaviour:
- https://github.com/w3c/aria/pull/2863
- https://github.com/w3c/aria/issues/2867
- https://github.com/web-platform-tests/interop-accessibility/issues/245
-->
<area shape="rect" coords="0,15,15,31" alt="x" data-testname="el-area-no-href[onclick]" data-expectedrole="link" class="ex" onclick="alert('test')">

@cookiecrook cookiecrook Aug 27, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though it shouldn't get clicked in the test, console.log() (vs alert()) would ensure a non-blocking result if it did.

Suggested change
<area shape="rect" coords="0,15,15,31" alt="x" data-testname="el-area-no-href[onclick]" data-expectedrole="link" class="ex" onclick="alert('test')">
<area shape="rect" coords="0,15,15,31" alt="x" data-testname="el-area-no-href[onclick]" data-expectedrole="link" class="ex" onclick="console.log(this.getAttribute('data-testname'));">

Please verify this before merging... I did not run the test or click the link to verify the console log, but I think it should work.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

console.log('WPT test'); is also fine.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alert replaced with console.log. I'm not sure what is causing the check to fail

<!-- GP end tentative -->
<area shape="rect" coords="15,15,31,31" alt="x" data-testname="el-area-no-href" class="ex-generic">
</map>
<img usemap="#areamap" style="width: 32px; height: 32px;" alt="x" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==">

<script>
AriaUtils.verifyRolesBySelector(".ex");
AriaUtils.verifyGenericRolesBySelector(".ex-generic");
</script>

</body>
</html>
2 changes: 1 addition & 1 deletion html-aam/area-role.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
</script>

</body>
</html>
</html>
Loading