Hi Tim & Landry,

Landry Breuil wrote on Fri, Jan 10, 2020 at 07:34:47AM +0100:
> On Thu, Jan 09, 2020 at 09:18:25PM -0600, Tim Baumgard wrote:

>> This turns off HTML5 autocomplete for the query input field for
>> man.cgi(8). This essentially makes smartphones and tablets behave
>> the same as PCs

As a matter of fact, it even improves usability on some PCs because
the HTML5 standard stipulates that "autocomplete" be "on" by default
and even some non-mobile browsers appear to conform to that, hiding
the input field behind a list of "smart" suggestions such that you
are unable to see what you are typing.

>> since they otherwise would try to annoyingly capitalize the
>> first character and change things like "mandoc" to "man doctor."

> hilarious.. 'smart'phones :)

You can say that again.  Autocomplete is always useless and annoying.
I just wasn't aware that it can be switched off so easily.

The main job to do here was to check that this is syntax defined by
the standard, which it is.

I chose to add the attribute to the <form> element instead, for
two reasons.  First, switching off bad defaults should be done
up front, making the code easier to read and keeping the more
complicated inner elements of the form simpler.  Besides, the
allowed syntax of the "autocomplete" attribute is much simpler
on the <form> element than on the <input> element.

See below for the committed patch.  That patch is also installed
on man.openbsd.org such that you can test.

Yours,
  Ingo


Log Message:
-----------
Switch off the useless and annoying "autocomplete" feature;
issue reported by Tim Baumgard <at bmgrd dot com>.
landry@ and florian@ agree with the general direction.

Modified Files:
--------------
    mandoc:
        cgi.c

Revision Data
-------------
Index: cgi.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/cgi.c,v
retrieving revision 1.169
retrieving revision 1.170
diff -Lcgi.c -Lcgi.c -u -p -r1.169 -r1.170
--- cgi.c
+++ cgi.c
@@ -411,7 +411,7 @@ resp_searchform(const struct req *req, e
 {
        int              i;
 
-       printf("<form action=\"/%s\" method=\"get\">\n"
+       printf("<form action=\"/%s\" method=\"get\" autocomplete=\"off\">\n"
               "  <fieldset>\n"
               "    <legend>Manual Page Search Parameters</legend>\n",
               scriptname);

Reply via email to