Page MenuHomePhabricator

Button semantics in Phonos should be added via JS
Open, LowPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What should have happened instead?:
Hey, great job on your work with Phonos, I really appreciate it.

Since without Phonos JS the element that links to the audio is just a link, button semantics should be added via JS and not be present in HTML at all times. Otherwise we have a WCAG violation. Styling should probably also be less button-like when it doesn’t function as a button, but that’s less of a concern.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
JWheeler-WMF subscribed.

Moving to commtech backlog as this is also potentially on language team radar.

From my own lookup of what causes this, this seems to be caused by the following code in OOUI itself:
https://gerrit.wikimedia.org/g/oojs/ui/+/8e4947086a62a6516df6f2eb125a02d440ebb94b/php/mixins/ButtonElement.php#44

role="button" gets set on all <a> elements even if they actually have a href="…" that makes them valid links. Since Phonos uses OOUI there, OOUI sets an improper role value without considering what href the element has. @Jdlrobson, will Codex migration proposed in T359605: Migrate Phonos from OOUI to Codex help with this accessibility issue?

@Jdlrobson, will Codex migration proposed in T359605: Migrate Phonos from OOUI to Codex help with this accessibility issue?

Yes. Should do!