From 1448cbd733cbc0558e4c5481e2c4ba35c58ee952 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Thu, 16 Jul 2009 02:58:17 +0000 Subject: [PATCH] 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. --- skins/common/mwsuggest.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; } -- 2.20.1