[whatwg] Safari-compatible <input type="search">

Andy Lyttle whatwg at phroggy.com
Tue Sep 30 10:03:00 PDT 2008


On Sep 30, 2008, at 7:18 AM, Kristof Zelechovski wrote:

> How can the Web designer know how many recent search terms the user  
> would
> like to keep handy at the search box?

The same way the web designer knows anything else:  taking an  
educated guess at what would be most appropriate for their users.

Personally, I would have done it a little differently and called this  
property something other than "results", but Apple has already done  
it, and there is value in staying compatible with them.

> What if autosave strings clash, or get deliberately stepped upon?

You can avoid clashing by using reverse-FQDN notation, e.g.  
autosave="com.phroggy.weblog.search", or using your company name or  
other trademark.

It is OK for them to be deliberately stepped upon - this is actually  
a design feature.  If you want to make a search field on your site  
that searches my site (submitting to the same CGI that my form  
submits to), you can specify the same autosave string that I use, and  
search history will be shared between both forms.  There is no  
security problem, because the search history list is not accessible  
to you (or me) unless the user explicitly chooses an item from it  
(which you can't distinguish from pasting in a string from elsewhere).

> I think it is a user preference + browser QoI and Web sites should  
> not try
> to outsmart it.

The whole point of this is to provide sensible markup that the  
browser can use to figure out the best way to handle it.  Browsers  
aren't obligated to handle search history at all if the user doesn't  
want them to.  Using <input type="search"> gives users MORE choice  
about how the browser should behave, by providing more information  
about what the web designer was trying to do, instead of using CSS  
and JavaScript hacks to implement a specific behavior that may not be  
desirable to some users.

> Marking a box as a search box is already there (ISINDEX,
> deprecated).

Nobody uses that, and it's not a form element.  We could resurrect  
it, but I don't see a compelling reason to do so.

-- 
Andy Lyttle
whatwg at phroggy.com




More information about the whatwg mailing list