From: Aryeh Gregor Date: Thu, 16 Jul 2009 02:58:17 +0000 (+0000) Subject: Use capability testing instead of UA sniffing X-Git-Tag: 1.31.0-rc.0~40899 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=1448cbd733cbc0558e4c5481e2c4ba35c58ee952;p=lhc%2Fweb%2Fwiklou.git Use capability testing instead of UA sniffing This should theoretically work fine, but I'm admittedly not *totally* sure what this is supposed to do, so I haven't actually tested it. The old behavior was almost certainly wrong, though: is_khtml was returning true for all WebKit, and non-ancient WebKit definitely supports overflow-x. Robert Stojnic/rainman should take a look at this to make sure it's right, or anyone else who knows what this does. --- diff --git a/skins/common/mwsuggest.js b/skins/common/mwsuggest.js index eeb8412c6a..4adcb9d422 100644 --- a/skins/common/mwsuggest.js +++ b/skins/common/mwsuggest.js @@ -107,9 +107,9 @@ function os_showResults(r){ } function os_operaWidthFix(x){ - // TODO: better css2 incompatibility detection here - if(is_opera || is_khtml || navigator.userAgent.toLowerCase().indexOf('firefox/1')!=-1){ - return 30; // opera&konqueror & old firefox don't understand overflow-x, estimate scrollbar width + // For browsers that don't understand overflow-x, estimate scrollbar width + if(typeof document.body.style.overflowX != "string"){ + return 30; } return 0; }