[wp-trac] [WordPress Trac] #26504: Semantic elements for non-link links
WordPress Trac
noreply at wordpress.org
Thu Mar 5 16:05:04 UTC 2015
#26504: Semantic elements for non-link links
----------------------------+--------------------------------------------
Reporter: GaryJ | Owner:
Type: task (blessed) | Status: reopened
Priority: normal | Milestone: Future Release
Component: Administration | Version: 3.8
Severity: normal | Resolution:
Keywords: | Focuses: ui, accessibility, javascript
----------------------------+--------------------------------------------
Comment (by afercia):
Had an in-depth
[https://wordpress.slack.com/archives/accessibility/p1425509601000643
conversation on Slack Accessibility with @azaozz about no-js links],
that's the case where:
> Could be a link when JS not available, should be a button the rest of
the time.
While that's technically possible, we couldn't find a clean, solid
solution. Consider for example the "row actions" links (e.g. in the posts
or comments listings). Except "Edit" (which is always a link), with no JS
these links are fully functional and semantic, for example:
{{{
href="comment.php?c=5&action=trashcomment&_wpnonce=d635621ec8"
}}}
so, when no JS, that's a link with GET parameters and it just works. BTW,
when JS is on, it acts like a button and uses an AJAX POST.
- they should have been built as submit buttons using POST in the first
place... unless there's a specific reason to use GET. But refactoring all
the admin is out of question.
- we could double the markup and serve links + buttons then hide the links
when JS is on and hide the buttons when JS is off. But it would end up
with ugly markup and ugly PHP.
- we could transform the links into buttons with JS. A rabbit hole,
especially about events: will break any directly attached events.
The only "clean" solution we could think of is to add via JS `role=button`
on the links. This would help just users who use software that understand
ARIA. For all other users, the semantic value of those links would still
be "link".
Any thoughts more than welcome.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/26504#comment:28>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list