Mediawiki 1.16: Bad performance with IE 6.0

Checking out the latest Mediawiki version 1.16, we encountered a really bad performance while accessing the wiki with “Internet Explorer 6.0”. We had an average response-time of 3 seconds. On some older machines even more then 20 seconds. With Firefox 3.6 all was fine: instant response.

It turned out, that the cause of this performance problem was in the new default-skin “Vector”. In the file “/skins/vector.php” is a “public function initPage” with this snippet:

$out->addScript(
	'<!--[if lt IE 7]><style type="text/css">body{behavior:url("' .
		$wgStylePath .
		'/vector/csshover.htc")}</style><![endif]-->'
);

This adds a version-check: “[if lt IE 7]”. So for clients with IE lower than version 7 this function loads the given file “/vector/csshover.htc” which supplies some functionality that IE 6.0 and lower lacks. After we commented out this part of code the performance was well in IE 6.0 too. Until now we saw no cutbacks done by this, so we left it disabled.

Edit 2011-07-06:
Ok, it should have been obvious (“csshover.htc”): There is a lack of functionality after disabling it. In IE6 the hover-effect, e.g. on the arrow-tab right of the “version-history”-tab, doesn’t work. So the corresponding menu with “delete”, “move”, etc. will not show up.

Here is a hack to resolve the problem:

In file skins/Vector.php (~line 39) replace this

$out->addScript(
	'<!--[if lt IE 7]><style type="text/css">body{behavior:url("' .
		$wgStylePath .
		'/vector/csshover.htc")}</style><![endif]-->'
);

with this

$out->addScript(
	'<!--[if lt IE 7]><script type="text/javascript">
		jQuery(function(){
			jQuery("#p-cactions").mouseenter(function(){
				jQuery("#p-cactions div.menu").css("display","block");
			});
			jQuery("#p-cactions").mouseleave(function(){
				jQuery("#p-cactions div.menu").css("display","none");
			});
		});
	</script><![endif]-->'
);
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: