Last modified: 2005-01-17 22:11:09 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T2622, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 622 - Use conditional comments instead of IEFixes.css
Use conditional comments instead of IEFixes.css
Product: MediaWiki
Classification: Unclassified
Interface (Other open bugs)
PC Windows XP
: Normal minor (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
Blocks: 640
  Show dependency treegraph
Reported: 2004-10-02 20:51 UTC by Tom Gilder
Modified: 2005-01-17 22:11 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Tom Gilder 2004-10-02 20:51:44 UTC
IEFixes.css is included in several skins (including monobook) to load various IE**Fixes.css sheets. It's 
just a collection of parser hacks to @import the right IE-fixing stylesheet to the right IE version.

But I can't see any point in it.

Instead of using it, we can simply use conditional comments in <head>, like this:

  <!--[if IE 5.0]><link rel="stylesheet" href="IE50Fixes.css" /><![endif]-->
  <!--[if IE 5.5]><link rel="stylesheet" href="IE55Fixes.css" /><![endif]-->
  <!--[if IE 6.0]><link rel="stylesheet" href="IE60Fixes.css" /><![endif]-->

This is good for several reasons:

  * Gets rid of a HTTP request for IEFixes.css
  * Stops IE from requesting /style/monobook/null?"{ due to syntax hack
  * Doesn't require mad syntax hacks which can be hard to debug and easy to break

And yes, conditional comments aren't standard and are IE/win-only - but we already use one to include 
IEFixes.css in the first place, so I see no harm in extending it to cover all versions.
Comment 1 Gabriel Wicke 2005-01-09 15:42:02 UTC
Ok, changed it to something similar after doing more testing- IE5 doesn't like
[if IE 5.0] which spoils the thing, but still we save two requests for IE6 and
shouldn't get any null requests any more as IE5 won't do them. Kept the IE6 rule
temporarily in the online code to avoid cache problems, but it's removed in CVS.
Thanks for your hint! Gabriel Wicke

Current rendered code:
    <!--[if IE 5]><style type="text/css" media="all">@import
    <!--[if IE 6]><style type="text/css" media="all">@import
    <!--[if IE]><script type="text/javascript"
    <meta http-equiv="imagetoolbar" content="no" /><![endif]-->
Comment 2 Tom Gilder 2005-01-17 22:11:09 UTC
Now uses conditional comments (with the right tests!) for IE5.0 and 5.5.

Note You need to log in before you can comment on or make changes to this bug.