From: Aryeh Gregor Date: Fri, 31 Dec 2010 19:30:29 +0000 (+0000) Subject: Enable mwsuggest datalist implementation X-Git-Tag: 1.31.0-rc.0~32953 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=5cf861f7eceb751f8ff7bb7fb20eb8cdae1b48b4;p=lhc%2Fweb%2Fwiklou.git Enable mwsuggest datalist implementation Tested in Firefox 4.0b8, which is the only browser it will trigger for due to the feature test. Opera is explicitly blacklisted for the reason given in the comment. This feature was added in r61348 but remained disabled by default because no browser actually supported it properly (due to Opera's bug). Of course, this is somewhat obsolescent given the fancy new Vector search, but it's a two-line change, so why not. I was reminded of this by Jonas Sicking, a Firefox developer, remarking on how should indeed be usable for this purpose in Firefox 4: http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-December/029577.html --- diff --git a/skins/common/mwsuggest.js b/skins/common/mwsuggest.js index 5870cd7135..9bc38c65ee 100644 --- a/skins/common/mwsuggest.js +++ b/skins/common/mwsuggest.js @@ -43,14 +43,16 @@ window.os_animation_timer = null; /** * is a new HTML5 element that allows you to manually supply * suggestion lists and have them rendered according to the right platform - * conventions. However, the only shipping browser as of early 2010 is Opera, - * and that has a fatal problem: the suggestion lags behind what the user types - * by one keypress. (Reported as DSK-276870 to Opera's secret bug tracker.) - * The code here otherwise seems to work, though, so this can be flipped on - * (maybe with a UA check) when some browser has a better implementation. + * conventions. Opera as of version 11 has a fatal problem: the suggestion + * lags behind what the user types by one keypress. (Reported as DSK-276870 to + * Opera's secret bug tracker.) However, Firefox 4 supports it without + * problems, so Opera is just blacklisted here. Ideally we wouldn't blacklist + * future versions, in case they fix it, but the fallback isn't bad at all and + * the failure if they don't fix it is very annoying, so in this case we'll + * blacklist future versions too. */ -// var os_use_datalist = 'list' in document.createElement( 'input' ); -window.os_use_datalist = false; +window.os_use_datalist = 'list' in document.createElement( 'input' ) + && $.client.profile.name != 'opera'; /** Timeout timer class that will fetch the results */ window.os_Timer = function( id, r, query ) {