549-ie10-conditional-comments

Microsoft added many features to Internet Explorer over the years. Several revolutionized the web forever (XMLHttpRequest, the DOM, XML tools, font embedding, browser add-ons). Some never caught on. Some were truly awful.

The team intends to remove several of the less-successful legacy features in IE10 (perhaps they read #7 in 10 Ways Microsoft Could Make Us Love IE Again?) I suspect you’ve never coded XML Data Islands and Element Behaviors, but you’ve almost certainly used Conditional Comments. They’re about to disappear from IE forever.

Conditional Comments 101

Ensuring you web site or application works in all browsers is tough. It’s made particularly difficult when you have to support older editions of Internet Explorer. IE6 was released in 2001, IE7 in 2006, and IE8 appeared in 2009. Whatever your opinion of Microsoft, it’s unreasonable to expect a 10 year old browser to render the same as Firefox 5 or Chrome 12.

Web developers are particularly scathing about IE6. Many months are spent building fantastic web sites and applications only to find they break in IE6 at the eleventh hour. Fortunately:

  • IE6 bugs are well-documented and it’s possible to overcome the majority of issues — especially if you test early and often.
  • Microsoft provide Conditional Comments so developers can add custom CSS and script fixes which target a specific version of IE.

Examine the source of almost any HTML5 page and you’ll find this code in the head:


<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

It loads a shim in IE8 and below which allows the developer to style new HTML5 elements such as header, article, and footer. It’s not required in IE9 and other browsers with native HTML5 support — they ignore the script.

Conditional Comments are incredibly useful but, personally, I always felt a little uncomfortable using them:

  1. They smell a little like browser sniffing — which stinks.
  2. They’re rarely necessary. The majority of IE6 problems can be solved with a display:inline; here or a position:relative; there. While competing browsers don’t require those properties, they don’t have a negative impact other than a few bytes of extra bandwidth. I prefer my CSS properties in one place rather than distributed between two or more files.
  3. Conditional Comments are abused. I’ve had the misfortune to work on systems where developers created three or four separate stylesheets which targeted individual browsers. Simple property updates required changes to every file.

Why Remove Conditional Comments?

IE8 is normally well-behaved and you’ll only require the HTML5 shim (see above). With a few CSS3 exceptions, IE9 renders as well as any other browser. Hopefully, IE10 will catch-up — or even overtake — Firefox, Chrome, Opera and Safari.

Conditional Comments are not required. There’s no need for “[if IE 10]“ because pages will render (mostly) the same in all modern browsers.

That said, it’s not the end of feature detection and progressive enhancement. Not every browser supports CSS3 transformations, web sockets, geo-location and client-side storage. Even with support, the user can often disable or refuse permission for an operation.

In addition, Conditional Comments will not disappear from IE6, 7, 8 and 9. You can still target those browsers should the need arise but it will become less necessary over time.

I applaud Microsoft’s decision. It’s a bold move since they could have easy kept Conditional Comments and I suspect its removal will horrify some developers. However, the company is adhering to its “same markup” philosophy and ensuring HTML, CSS and JavaScript just work regardless of the browser or version.

It’s the right thing to do. Let’s hope the demise of ActiveX, Compatibility View and the old IE7 toolbars won’t be too far behind!

Microsoft has made many claims about IE9′s speed, but now the company is saying the latest version of its browser also bests the competition in terms of energy use.

Based on several tests conducted by Microsoft, it would seem that IE9 makes fewer demands on a computer’s battery — at least in certain scenarios. Firefox 4 came in a close second in every test; Opera 11 was the least energy-efficient browser in most tests.

Researchers at Microsoft put Chrome 10, Firefox 4, Safari 5, Opera 11 and Internet Explorer 9 head-to-head in three different test scenarios. First, they measured baseline power consumption with no browser running, then they looked at how much power the browsers used on an about:blank page. Next, they ran a typical news content website, which showcased power consumption in a typical web-browsing situation.

For the final tests, each browser ran Galactic, an HTML5-based browser performance test, and the FishIE Tank, another performance test.

Microsoft ran these tests on an Intel laptop running Windows 7; to make truly definitive statements about browser efficiency, the same tests would have to be run on a variety of devices and OSes. We’d love to know if IE9 holds up as well on an Android tablet, for example.

Here are graphs of the test results:

While it’s nice to know that IE 9 might help your battery last longer, these stats may not have much impact on the ongoing browser wars. Internet Explorer has been losing ground to Chrome and Firefox in particular for far too long; and for most consumers, energy efficiency might not be a deciding factor when choosing a web browser.

What do you think? Do these stats affect your opinion of IE 9? Would they make you want to use this browser over one of its competitors? Give us your opinions in the comments section.

More About: energy, green tech, IE9, internet explorer, microsoft

For more Dev & Design coverage:




Google and Mozilla have both announced new browser initiatives that will allow users to opt out of having their activities tracked by online advertisers. These developments are at least partially in response to the “Do Not Track” lists proposed by the U.S. Federal Trade Commission.

In December, the FTC released a 122-page report [PDF] outlining the concept, which has been called a “Do Not Call” list for online behavioral advertising. Rather than make calls for legislation, the FTC has pushed for browser makers and advertisers to self-regulate.

Although targeting the same problem, Mozilla and Google are are approaching opt-out online behavioral advertising from different directions.


Firefox: Do Not Track HTTP Header


On Sunday, Mozilla formally announced its plans to build a do-not-track feature into future versions of Firefox. Alex Fowler, the global privacy and public policy leader at Mozilla, explained the proposed feature on his blog:

“When the feature is enabled and users turn it on, web sites will be told by Firefox that a user would like to opt out of OBA. We believe the header-based approach has the potential to be better for the web in the long run because it is a clearer and more universal opt-out mechanism than cookies or blacklists.”

Mozilla’s Sid Stamm has written his thoughts on the proposal and he explains why the HTTP header approach was chosen fro Firefox:

“Currently, to opt out of online behavioral advertisements, you have to get a site to set an opt-out cookie so they won’t track you. There are various web sites that help out (NAI, IAB UK) and there are Firefox add-ons (TACO, beef taco, etc.) that can streamline this process. But this is a bit of a hack; it’s nearly impossible to maintain a list of all the sites whose tracking people may want to opt-out from. It would be more attractive if there was one universal opt-out signal that would tell all sites you want to opt out.”

Instead, Stamm proposes the use of a HTTP header that is transmitted with every HTTP request and that lets ad networks know a user does not want to bee tracked.

This approach of using a Do-Not-Track HTTP header differs from some other opt-out online behavioral advertising solutions, which utilize either opt-out cookies or an opt-out registry. Michael Hanson from Mozilla Labs has posted a technical analysis of Mozilla’s proposal on his blog.

One advantage of using a header and not a cookie to carry opt-out information is that even if user clears his or her browser cache, the opt-out settings will still remain in place.

As The Wall Street Journal points out, however, for Mozilla’s tool to work, “tracking companies would need to agree to not monitor users who enable the do-not-track feature.” As of this writing, no companies have publicly agreed to participate. Mozilla will have to convince advertisers to comply with its header proposal for this idea to actually gain traction.


The Google Approach


Meanwhile, Google has released a new extension for Google Chrome called Keep My Opt-Outs. The Google Code page for Keep My Opt-Outs describes the extension as a way to “permanently [opt] your browser out of online ad personalization via cookies.”

The extension works with Google-served ads as well as with ads from companies that have signed up with AboutAds.info.


Other Initiatives


Last month, Microsoft announced that IE 9 will include a way for users to create lists of sites or companies that are blocked from tracking their data. This is significant because of reports that Microsoft previously removed similar features from Internet Explorer 8 at the behest of online advertisers.

The features and plugins proposed by Google, Mozilla, Microsoft and others are a good start in making it easier for users to opt-out of online behavioral ads; however, these solutions will only work if advertisers and browser makers can work together in a cohesive way.

Photo courtesy of swanksalot

More About: advertising, Browsers, chrome, do not track list, Firefox, FTC, Google, IE9, microsoft, mozilla, privacy, trending

387-ie9-beta

I’m genuinely excited. I don’t remember feeling this way when Chrome 6, Firefox 3.6 or Opera 10.60 were released — and IE9 is just a beta. There are several reasons for my unusual optimism:

  1. We normally wait 2 years between IE updates.
  2. The IE development team has listened to our demands and IE9 is the first version to support HTML5, CSS3, SVG, canvas and several other technologies.
  3. Unlike other vendors, Microsoft has been particularly secretive about IE9′s new interface. A screenshot was leaked, but we’ll only know whether it’s real today.

The beta download should be available at beautyoftheweb.com (yes, seriously) from:

11:00US PDT
12:00US MDT
13:00US CDT
14:00US EDT
18:00UTC / GMT
19:00UK / Ireland
20:00Europe
21:00Eastern Europe
22:00Moscow
02:00 September 16Australia AWST
03:30 September 16Australia ACST
04:00 September 16Australia AEST

Before you rush off to download the browser, note:

  • IE9 is not available for Windows XP. I hope Microsoft rectify that, but I doubt they’ll ever support their aging OS … even if the vast majority of people continue to use XP.
  • Installing IE9 on Windows Vista or 7 will remove your existing installation of IE7 or IE8. Since those browsers will remain popular for many years to come, ensure you have them available on another PC or virtual machine for web development testing purposes. Alternatively, there will be another release of the IE9 platform preview — it’ll run alongside existing versions of IE but it’s far more limited.

The big question — is IE9 any good? Can it live up to our expectations? Head over to our in-depth review…

399-ie9-screenshot

Internet Explorer 9′s new interface has been revealed following an article published on a site run by one of Microsoft’s Russian subsidiaries. The screenshot was removed almost immediately, but it was too late — the image quickly dispersed throughout the web:

IE9 screenshot

Microsoft has refused to publicly comment about the leak but, if it’s a fake, it’s very good one.

The screenshot shows a minimalistic user interface reminiscent of those implemented by Chrome, Opera and Firefox 4. However, the style and layout of the back/next buttons, address bar and icons will be recognizable to IE8 fans (I’m sure they must exist somewhere?)

All the controls have moved to a single toolbar. It doesn’t leave much room for multiple tabs but it maximizes the web page viewing space. I’m surprised tabs haven’t been moved to the empty title bar area — Mozilla recently determined that tabs above the address bar is a more logical layout.

The Russian website also revealed IE9 would offer a unified search/address bar, a simplified set of toolbar icons, and tear-off tabs which can be snapped to a part of the screen. Windows 7 already offers this last option as “Aero Snap” so it may not be a feature implemented directly within the browser.

The IE9 beta will be released on September 15 2010 so we’ll soon know whether the leaked screenshot is real or not. The final version is unlikely to appear until 2011 so the interface may undergo radical changes before then.

Of course, it could be a Microsoft publicity stunt to raise awareness of the browser. I somehow doubt that — it’s been far more successful than many of their real campaigns! (Did anyone actually attend a Windows 7 party?)

What do you think? Is the screenshot real or fake? Do you like it?