Hi Anna,
Anna Vyalkova wrote on Wed, Jul 06, 2022 at 08:52:09PM +0500:
> Is visible label OK? Or should it be hidden?
https://www.w3.org/WAI/ARIA/apg/practices/names-and-descriptions/#naming_rule_visible_text
is quite clear: using visible text is usually better:
"In most circumstances, visible text labels also make the user
interface easier to understand for all users."
I think this does apply to the search query input box. Even some
users *looking* at the form might feel unsure what to enter there.
That does not appear to apply to the dropdrowns though because users
looking at the form will readily understand from the visible default
values what the purpose of the dropdowns is, whereas users of screen
readers will profit from the ARIA labels.
I committed the patch below. Where that is easily possible, i prefer
expressing structure through nesting of elements rather than by using
attributes. In this case, it is also shorter: same number of elements
and two fewer attributes.
This is now installed on man.bsd.lv for testing, too.
Yours,
Ingo
Log Message:
-----------
For accessibility, label the last two widgets in the search form.
Patch from Anna Vyalkova <cyber at sysrq dot in>, significantly tweaked by me.
Modified Files:
--------------
mandoc:
cgi.c
Revision Data
-------------
Index: cgi.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/cgi.c,v
retrieving revision 1.179
retrieving revision 1.180
diff -Lcgi.c -Lcgi.c -u -p -r1.179 -r1.180
--- cgi.c
+++ cgi.c
@@ -444,13 +444,14 @@ resp_searchform(const struct req *req, e
/* Write query input box. */
- printf(" <input type=\"search\" name=\"query\" value=\"");
+ printf(" <label>Search query:\n"
+ " <input type=\"search\" name=\"query\" value=\"");
if (req->q.query != NULL)
html_print(req->q.query);
- printf( "\" size=\"40\"");
+ printf("\" size=\"40\"");
if (focus == FOCUS_QUERY)
printf(" autofocus");
- puts(">");
+ puts(">\n </label>");
/* Write submission buttons. */
@@ -491,7 +492,8 @@ resp_searchform(const struct req *req, e
/* Write manpath selector. */
if (req->psz > 1) {
- puts(" <select name=\"manpath\">");
+ puts(" <select name=\"manpath\""
+ " aria-label=\"Manual path\">");
for (i = 0; i < (int)req->psz; i++) {
printf(" <option");
if (strcmp(req->q.manpath, req->p[i]) == 0)
--
To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv