[whatwg] Search-suggestions without scripting

Ian Hickson ian at hixie.ch
Fri May 4 17:27:31 PDT 2012

On Sun, 14 Aug 2011, Timo Beermann wrote:
> The search-suggestions of search-fields as in Google or Wikipedia should 
> be able without scripting, only with HTML/CSS. Because some users 
> deactivate Scripting (for security or whatever other reason) and on 
> other computers (school, university, work,...) you are not able to 
> change the settings, even if you want to. E.g. I use NoScript and only 
> allow scripting on very few trusted sites, that really need it.

I looked into whether we should define a declarative solution for this, 
but I think that so far it seems that these autocomplete features are 
still very much evolving. For example, Google has been adding new things 
to their autocomplete regularly. In fact most autocomplete widgets seem to 
have some special feature that wouldn't easily fit into a generic 
declarative model -- consider Amazon's, where hovering over an item 
changes the department dropdown's selection without moving the 
autocomplete box, or Bing's, where typing "weather" inlines an interactive 
graphical weather box, or Apple's, where the items have an image and 

On Mon, 15 Aug 2011, Aryeh Gregor wrote:
> Scripting is generally necessary to get dynamic content.  <datalist> can 
> be used to provide search suggestions, but they'll be static if script 
> is disabled.  Proper suggest-as-you-type functionality is precisely the 
> sort of thing that JavaScript is always going to be required for.

Oh, I don't know. It's certainly plausible that this kind of thing will 
become commonplace enough and broadly similar enough that it makes sense 
to have a declarative way of specifying an autocomplete server, etc.

But currently, we're still very much in the early days of this stuff.

> Things that can already be done in script are usually only be made into 
> declarative features if they meet a very high bar: they must be *very* 
> commonly used, and there must be substantial benefit to typical users 
> (not just ones who disable script) from having them available as 
> declarative features.


On Wed, 17 Aug 2011, Aryeh Gregor wrote:
> On Wed, Aug 17, 2011 at 4:12 AM, Alexandre Morgaut 
> <Alexandre.Morgaut at 4d.com> wrote:
> > I like the idea of a declarative way to support autosuggestions 
> > OpenSearch already made a successful specification supported by most 
> > browsers http://www.opensearch.org/Specifications/OpenSearch/1.1
> That's an interesting point.  There's no reason that autosuggest for 
> browser URL bars and search inputs has to be any different.  Given that 
> all the infrastructure here is already present, a new attribute like 
> suggestions="http://path/to/opensearch" would be all that's needed.  It 
> would be relatively easy for browsers to implement, and trivial for 
> webpages to use if they're already using OpenSearch.  I don't think this 
> has to be related to <datalist> -- just have a new attribute on <input>.

If opensearch's version of this was the widely used state of the art and 
people weren't still very much innovating in this space, I'd probably 

Note that even in this space, though, it's not the end of the story. For 
example, Chrome does more than just list the search autocomplete results; 
it also loads the first suggestion in the background, and mixes in results 
from local history search, etc. Other browsers do similar mixing. While 
this works well for browser UI, where the browser can mix in all the 
various results together, when you are talking about a Web page you still 
end up needing script to do that. So having it declarative isn't 
necessarily a win.

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

More information about the whatwg mailing list