Welcome to MSDN Blogs Sign in | Join | Help
Firefox 3.1 - One step closer to IE

Today's topic is Firefox 3.1. Now, you may be wondering why a Microsofty is blogging about our competitor. The fact is, we do quite a lot of development for non-IE browsers and with good reason: Firefox now represents almost 20% of the worldwide browser usage share according to Net Applications. Safari makes up over 6% and IE is about 72%.

So let's take a look at what's coming in the next release of Firefox. What makes 3.1 special is the trend towards supporting features that, until now, only IE supported.  Rather than enumerate all the new features, I'll call out a select few that were gleaned from IE and will make a big difference in your browser support development.

Script Deferal

Firefox 3.1 will add support for the defer attribute in the <script> tag. This will allow you to defer script execution until the page has been loaded which decreases PLT (page load time) and can make writing a client-side application easier. IE has had this attribute for a while, and it is even defined in the W3C HTML 4.0 standard and DOM Level 1.

Word Wrap (CSS)

Another relic from IE making its way into Firefox is the word-wrap rule in CSS. This rule is used to decide what to do with a long string with no natural break points (e.g. spaces, dashes, etc) when the container is small. You may have wanted to use this rule when you have a fixed-width element and someone puts a string like "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" into it. Before this rule, the string would overflow outside of the element's width and start doing funky things with your layout. The word-wrap rule allows you to force a break regardless of whether there's a break point.

To use this rule, add the italicized rule into your CSS class for the element:

 .cssClass {
width:150px;
padding:5px;
word-wrap:break-word;
}

This will solve your big-ugly-string woes.

Selectors API

One of the best new features in Firefox 3.1 is support for the W3C Selectors API. You can read all about it in yesterday's post.

Appendix

Well, there you have it. These 3 features were taken directly from IE and will make your cross-browser work far easier. You can read more about the new stuff coming in Firefox 3.1 at the Firefox 3.1 for Developers page on Mozilla's website.

Posted: Monday, November 03, 2008 9:54 AM by jfkern
Anonymous comments are disabled
Page view tracker