]> git.cameronkatri.com Git - mandoc.git/commitdiff
For accessibility, label the last two widgets in the search form. main
authorIngo Schwarze <schwarze@openbsd.org>
Wed, 6 Jul 2022 17:21:04 +0000 (17:21 +0000)
committerIngo Schwarze <schwarze@openbsd.org>
Wed, 6 Jul 2022 17:21:04 +0000 (17:21 +0000)
Patch from Anna Vyalkova <cyber at sysrq dot in>, significantly tweaked by me.

cgi.c

diff --git a/cgi.c b/cgi.c
index 421cb9bd9d0e07bc12572be8baff806fc3f1c583..68460c55fda8ac9d35853a5757e36490dcc4e65e 100644 (file)
--- a/cgi.c
+++ b/cgi.c
@@ -1,4 +1,4 @@
-/* $Id: cgi.c,v 1.179 2022/07/06 16:05:40 schwarze Exp $ */
+/* $Id: cgi.c,v 1.180 2022/07/06 17:21:04 schwarze Exp $ */
 /*
  * Copyright (c) 2014-2019, 2021, 2022 Ingo Schwarze <schwarze@usta.de>
  * Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -444,13 +444,14 @@ resp_searchform(const struct req *req, enum focus focus)
 
        /* 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, enum focus focus)
        /* 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)