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.
}
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;
}