Skip to content

Align <area> with no href but js event attached with <a> with no href but js event attached - #61929

Open
giacomo-petri wants to merge 5 commits into
masterfrom
giacomo-petri-area-js-event-tentative
Open

Align <area> with no href but js event attached with <a> with no href but js event attached#61929
giacomo-petri wants to merge 5 commits into
masterfrom
giacomo-petri-area-js-event-tentative

Conversation

@giacomo-petri

Copy link
Copy Markdown
Contributor

Closes: web-platform-tests/interop-accessibility#245

Relates to:

This PR adds tests for the area element without an href attribute but with a JS event handler attached.
It assumes that its behavior should be consistent with an a element without an href attribute but with a JS event handler attached.

@giacomo-petri giacomo-petri changed the title Giacomo petri area js event tentative Align <area> with no href but js event attached with <a> with no href but js event attached Aug 13, 2026
@jnurthen

Copy link
Copy Markdown
Contributor

@HaTheo - can you please take a look

@sideshowbarker
sideshowbarker removed their request for review August 21, 2026 08:35
Comment thread html-aam/area-role-tentative.html Outdated
- 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

@cookiecrook cookiecrook left a comment

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.

Approval pending suggestion to switch from alert to log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Align <area> behavior with <a> expectations

4 participants