Anonymous
Not logged in
Talk
Contributions
Create account
Log in
Tales from Chyria
Search
Editing
Module talk:Message box
(section)
From Tales from Chyria
Namespaces
Module
Discussion
More
More
Page actions
Read
Edit source
New topic
History
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Aria roles == {{archive top|status=SUMMARISED BELOW|outcome=<span class="fn nickname" style="color:#CD0000">[[User:Waddie96|waddie96]] β ([[User talk:Waddie96|talk]])</span> 19:14, 2 September 2025 (UTC)}} <!-- {{edit request}} --> The elements with <code>role=none</code> (synonym for <code>presentation</code> which is not recommended for use) is not be hidden from the accessibility API ''but'' their ''implicit'' semantics are hidden. Meaning the contents of an Ambox for instance will not have the implicit semantics of a HTML data <code><table<nowiki/>></code>. So the content given in {{para|text}} will simply be presented to the accessibility API technology as {{tag|div|content=Content}} instead of {{tag|table|content=Content}} which is what we want, yes. However, the accessibility technology, i.e. screen reader, etc., will not have any idea what this text is or what it represents since the {{tag|div|o}} element that it 'sees' has no implicit <code>role</code>, such as with {{tag|p|content=Content}} for instance, and there is no <code>aria-label</code> given... So I suggest we give it these values, especially since: {{tq2|<nowiki>If presentation or none is applied to a <table> element, the descendant <caption>, <thead>, <tbody>, <tfoot>, <tr>, <th>, and <td> elements inherit the role and are thus not exposed to assistive technologies.</nowiki>'''<nowiki>But, elements inside of the <th> and <td> elements, including nested tables, are exposed to assistive technologies.</nowiki>'''}} β taken from [https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/presentation_role]. I interpret this as meaning that the {{tag|img|o}} element inside the first {{tag|td|o}} element will be exposed, and it is simply an image/icon with no benefit to the screen reader or the visually impaired... so give the image {{tag|td|o}} element with class <code>mbox-image</code> the HTML attribute: <code>aria-hidden="true"</code>; so that it is '''completely''' hidden from the accessibility technology. The next {{tag|td|o}} nests our <code>mbox-text</code> class with the actual stuff we want to expose. But we want to give it meaning too. The role should be: <code>role="note"</code> as it's a note semantically speaking and does not fit any other ARIA <code>role</code>, and the child elements of that will all be exposed to the API as whatever has placed in the text parameter anyway (as confirmed in the quote above). Finally I suggest giving it an <code>aria-label="Notice"</code> if {{para|type|notice}} or <code>style</code> or <code>content</code>, and possibly <code>aria-label="Warning"</code> if <code>delete</code> or <code>speedy</code>. So it'll read out with a screen reader for example as: {{kbd|Note. Notice. Content...}} Option 2... the parent element may actually be what we need to expose because it's nesting the whole dang thing? I don't think it matters since the parent elements of the text element are hidden from the API but another solution possibility could be setting the entire {{tag|table|o}}'s role to <code>role="note"</code> and giving it an <code>aria-label="Notice"</code>, and then still hiding the image, and then leaving the text element alone, however I'm unsure if the note role is inherited by child elements like the none/presentation role is. <span style="color:#CD0000">[[User:Waddie96|waddie96]] β ([[User talk:Waddie96|talk]])</span> 00:19, 29 August 2025 (UTC) :How about we wait to suss out how we want to deal with any accessibility questions here after I've got everything in divs, as in the section just above. Anyway, I think the last time I looked at this, the most similar was role=note for what message boxes represent. I am pretty sure I am not a fan of adding labels here, which should be when the content needs naming, and this does not. [[User:Izno|Izno]] ([[User talk:Izno|talk]]) 03:24, 29 August 2025 (UTC) :(In fact, the div version already removes the presentation role.) [[User:Izno|Izno]] ([[User talk:Izno|talk]]) 05:18, 29 August 2025 (UTC) ::Cool. Please do ping me in discussions when this is revived. I've read extensively for many hours for something else and I'm quite well versed in it now. Yes, <code>role="note"</code> is the most appropriate role. Also, after testing it in the enwiki context using a few different screenreaders I tend to agree with you that an <code>aria-label</code> in this case is unnecessary "fluff" to the accessibility tree for the mbox, since as you stated the text describes itself. π <span style="color:#CD0000">[[User:Waddie96|waddie96]] β ([[User talk:Waddie96|talk]])</span> 14:56, 29 August 2025 (UTC) ::Awesome. Can it give the image the HTML attr <code>aria-hidden="true"</code> too? Please π <span style="color:#CD0000">[[User:Waddie96|waddie96]] β ([[User talk:Waddie96|talk]])</span> 14:59, 29 August 2025 (UTC) {{archive bottom}} ::Wow, thought I'd summarise: ::#Change the ARIA role given to the parent {{tag|table|o}} element to {{code|role{{=}}none|lang=html}}. Synonymous to <code>presentation</code>, i.e. identical function of removing all semantic meaning of table element and its direct children, but the latter is soon-to-be deprecated HTML. <!-- CANCEL ###Give the {{tag|td|o}} element that has {{attr|class|mbox-text}} the {{attr|role|note}} role. --> ::#Hide the images please: wrap the default image, and especially the custom left and right images (since the default at least has a null {{para|alt}}) with <syntaxhighlight inline lang=wikitext><span aria-hidden="true">...</span></syntaxhighlight>. ::Sorry, I'd edit the module in sandbox and give diffs but I have no idea how to code in Lua. Thank you! <span class="fn nickname" style="color:#CD0000">[[User:Waddie96|waddie96]] β ([[User talk:Waddie96|talk]])</span> 19:14, 2 September 2025 (UTC) :::I think Izno suggested waiting until the div conversion was done, and then looking to see if anything like this is needed? — Martin <small>([[User:MSGJ|MSGJ]] Β· [[User talk:MSGJ|talk]])</small> 14:33, 4 September 2025 (UTC) ::::Yes apologies. I see that now. <span class="fn nickname" style="color:#CD0000">[[User:Waddie96|waddie96]] β ([[User talk:Waddie96|talk]])</span> 23:44, 4 September 2025 (UTC)
Summary:
Please note that all contributions to Tales from Chyria may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Chyria Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Wiki tools
Wiki tools
Page tools
Page tools
User page tools
More
What links here
Related changes
Page information
Page logs