Index: skins/common/wikibits.js
===================================================================
--- skins/common/wikibits.js	(revision 61012)
+++ skins/common/wikibits.js	(working copy)
@@ -103,16 +103,14 @@
 
 // special stylesheet links
 if ( typeof stylepath != 'undefined' && typeof skin != 'undefined' ) {
-	// FIXME: This tries to load the stylesheets even for skins where they
-	// don't exist, i.e., everything but Monobook.
-	if ( opera6_bugs ) {
-		importStylesheetURI( stylepath + '/' + skin + '/Opera6Fixes.css' );
-	} else if ( opera7_bugs ) {
-		importStylesheetURI( stylepath + '/' + skin + '/Opera7Fixes.css' );
-	} else if ( opera95_bugs ) {
-		importStylesheetURI( stylepath + '/' + skin + '/Opera9Fixes.css' );
-	} else if ( ff2_bugs ) {
-		importStylesheetURI( stylepath + '/' + skin + '/FF2Fixes.css' );
+	if ( opera6_bugs && cssfixes['opera6_bugs'] ) {
+		importStylesheetURI( stylepath + '/' + skin + '/' + cssfixes['opera6_bugs'] );
+	} else if ( opera7_bugs && cssfixes['opera7_bugs'] ) {
+		importStylesheetURI( stylepath + '/' + skin + '/' + cssfixes['opera7_bugs'] );
+	} else if ( opera95_bugs && cssfixes['opera95_bugs'] ) {
+		importStylesheetURI( stylepath + '/' + skin + '/' + cssfixes['opera95_bugs'] );
+	} else if ( ff2_bugs && cssfixes['ff2_bugs'] ) {
+		importStylesheetURI( stylepath + '/' + skin + '/' + cssfixes['ff2_bugs'] );
 	}
 }
 
Index: skins/MonoBook.php
===================================================================
--- skins/MonoBook.php	(revision 61012)
+++ skins/MonoBook.php	(working copy)
@@ -23,6 +23,13 @@
 	var $skinname = 'monobook', $stylename = 'monobook',
 		$template = 'MonoBookTemplate', $useHeadElement = true;
 
+	var $jsCSSFixes = array(
+		'opera6_bugs' => 'Opera6Fixes.css',
+		'opera7_bugs' => 'Opera7Fixes.css',
+		'opera95_bugs' => 'Opera9Fixes.css',
+		'ff2_bugs' => 'FF2Fixes.css'
+	);
+
 	function setupSkinUserCss( OutputPage $out ) {
 		global $wgHandheldStyle, $wgStyleVersion, $wgJsMimeType, $wgStylePath;
 
Index: includes/OutputPage.php
===================================================================
--- includes/OutputPage.php	(revision 61012)
+++ includes/OutputPage.php	(working copy)
@@ -1671,7 +1671,7 @@
 		global $wgUser, $wgRequest, $wgJsMimeType, $wgUseSiteJs;
 		global $wgStylePath, $wgStyleVersion;
 
-		$scripts = Skin::makeGlobalVariablesScript( $sk->getSkinName() );
+		$scripts = Skin::makeGlobalVariablesScript( $sk );
 		$scripts .= Html::linkedScript( "{$wgStylePath}/common/wikibits.js?$wgStyleVersion" );
 
 		//add site JS if enabled:
Index: includes/SkinTemplate.php
===================================================================
--- includes/SkinTemplate.php	(revision 61012)
+++ includes/SkinTemplate.php	(working copy)
@@ -93,6 +93,11 @@
 	 */
 	var $useHeadElement = false;
 
+	/**
+	 * array with a list of css fixes that will be included by wikibits.js
+	 */
+	var $jsCSSFixes = array();
+
 	/**#@-*/
 
 	/**
Index: includes/Skin.php
===================================================================
--- includes/Skin.php	(revision 61012)
+++ includes/Skin.php	(working copy)
@@ -24,6 +24,7 @@
 	/**#@-*/
 	protected $mRevisionId; // The revision ID we're looking at, null if not applicable.
 	protected $skinname = 'standard';
+
 	// @todo Fixme: should be protected :-\
 	var $mTitle = null;
 
@@ -346,11 +347,12 @@
 
 	/**
 	 * Make a <script> tag containing global variables
-	 * @param $skinName string Name of the skin
+	 * @param &skin Object: skin passed by reference
 	 * The odd calling convention is for backwards compatibility
 	 * @TODO @FIXME Make this not depend on $wgTitle!
 	 */
-	static function makeGlobalVariablesScript( $skinName ) {
+	static function makeGlobalVariablesScript( &$skin ) {
+		$skinName = $skin->getSkinName();
 		if ( is_array( $skinName ) ) {
 			# Weird back-compat stuff.
 			$skinName = $skinName['skinname'];
@@ -384,6 +386,7 @@
 		$vars = array(
 			'skin' => $skinName,
 			'stylepath' => $wgStylePath,
+			'cssfixes' => $skin->jsCSSFixes,
 			'urlprotocols' => wfUrlProtocols(),
 			'wgArticlePath' => $wgArticlePath,
 			'wgScriptPath' => $wgScriptPath,
