<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>inetpub: JKern's Blog of the Future</title><link>http://blogs.msdn.com/inetpub/default.aspx</link><description /><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Firefox 3.1 - One step closer to IE</title><link>http://blogs.msdn.com/inetpub/archive/2008/11/03/firefox-3-1-one-step-closer-to-ie.aspx</link><pubDate>Mon, 03 Nov 2008 20:54:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9034165</guid><dc:creator>jfkern</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/inetpub/comments/9034165.aspx</comments><wfw:commentRss>http://blogs.msdn.com/inetpub/commentrss.aspx?PostID=9034165</wfw:commentRss><description>&lt;p&gt;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%.&lt;/p&gt;  &lt;p&gt;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.&amp;#160; 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.&lt;/p&gt;  &lt;h3&gt;Script Deferal&lt;/h3&gt;  &lt;p&gt;Firefox 3.1 will add support for the &lt;font face="Courier New"&gt;defer&lt;/font&gt; attribute in the &lt;font face="Courier New"&gt;&amp;lt;script&amp;gt;&lt;/font&gt; 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.&lt;/p&gt;  &lt;h3&gt;Word Wrap (CSS)&lt;/h3&gt;  &lt;p&gt;Another relic from IE making its way into Firefox is the &lt;font face="Courier New"&gt;word-wrap&lt;/font&gt; 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 &amp;quot;AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA&amp;quot; into it. Before this rule, the string would overflow outside of the element's width and start doing funky things with your layout. The &lt;font face="Courier New"&gt;word-wrap&lt;/font&gt; rule allows you to force a break regardless of whether there's a break point.&lt;/p&gt;  &lt;p&gt;To use this rule, add the italicized rule into your CSS class for the element:&lt;/p&gt;  &lt;pre style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px; padding-top: 5px; background-color: #ccc; font-face: courier, serif"&gt; .cssClass {&lt;br /&gt;    width:150px;&lt;br /&gt;    padding:5px;&lt;br /&gt;    &lt;em&gt;&lt;strong&gt;word-wrap:break-word;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;

&lt;p&gt;This will solve your big-ugly-string woes.&lt;/p&gt;

&lt;h3&gt;Selectors API&lt;/h3&gt;

&lt;p&gt;One of the best new features in Firefox 3.1 is support for the W3C Selectors API. You can read all about it in &lt;a href="http://blogs.msdn.com/inetpub/archive/2008/10/30/w3c-selectors-api.aspx"&gt;yesterday's post&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;Appendix&lt;/h3&gt;

&lt;p&gt;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 &lt;a href="https://developer.mozilla.org/en/Firefox_3.1_for_developers" target="_blank"&gt;Firefox 3.1 for Developers&lt;/a&gt; page on Mozilla's website.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9034165" width="1" height="1"&gt;</description></item><item><title>W3C Selectors API</title><link>http://blogs.msdn.com/inetpub/archive/2008/10/30/w3c-selectors-api.aspx</link><pubDate>Fri, 31 Oct 2008 04:24:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9025681</guid><dc:creator>jfkern</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/inetpub/comments/9025681.aspx</comments><wfw:commentRss>http://blogs.msdn.com/inetpub/commentrss.aspx?PostID=9025681</wfw:commentRss><description>&lt;p&gt;First off, welcome to inetpub, my foray into the world of blogging at work. Part of my job is working with web standards and non-standards, so I figured that I could share my knowledge with whomever wants to listen.&lt;/p&gt;  &lt;p&gt;One of the biggest and most useful up and coming browser features is the introduction of the W3C Selectors API. This handy set of functions lets you use CSS selectors in your DOM code to get a collection of elements with exceptional specificity. For example:&lt;/p&gt;  &lt;pre style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px; padding-top: 5px; font-family: courier, serif; background-color: #ccc"&gt;var elms = document.querySelectorsAll(&amp;quot;.cssClass&amp;quot;);&lt;/pre&gt;

&lt;p&gt;will get you a collection of elements with the CSS class &amp;quot;cssClass&amp;quot; applied on it. Now, you might ask why we need this if there's &lt;font face="Courier New"&gt;document.getElementsByClassName()&lt;/font&gt;. Well, for starters, &lt;font face="Courier New"&gt;getElementsByClassName&lt;/font&gt; is non-standard which means that only Firefox and a handful of other browsers support it. Furthermore, IE adds support for the Selectors API in version 8 which makes this a standardized, cross-browser method of grabbing all elements with a given class.&lt;/p&gt;

&lt;p&gt;It gets better though: You can query for any valid CSS selector, for example:&lt;/p&gt;

&lt;pre style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px; padding-top: 5px; font-family: courier, serif; background-color: #ccc"&gt;var elms = document.querySelectors(&amp;quot;#navbar li.selected&amp;quot;);&lt;/pre&gt;

&lt;p&gt;gets you the selected nav node in the nav bar element. You can even query for siblings and direct descendants using the + and &amp;gt; selection operators, respectively. Also note the two methods presented above are different: The first one, querySelectorsAll, will get a collection of &lt;strong&gt;all&lt;/strong&gt; elements on the page that match the given selector. The second method, querySelectors, will get the first element on the page that matches the selector.&lt;/p&gt;

&lt;p&gt;You can also run these methods on an element to get children of a given node, for example:&lt;/p&gt;

&lt;pre style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px; padding-top: 5px; font-family: courier, serif; background-color: #ccc"&gt;var contentArea = document.getElementById(&amp;quot;contentArea&amp;quot;);
var codeSections = contentArea.querySelectorsAll(&amp;quot;pre.code&amp;quot;);&lt;/pre&gt;

&lt;p&gt;The beauty of these methods is that they're already natively supported in almost every browser. The rendering engine must use the same operations to apply the CSS styles to the page in the first place. This API provides you, the web developer, with a direct link into the ultra-performant rendering core of the browser.&lt;/p&gt;

&lt;p&gt;You can read more about the Selectors API on the &lt;a href="http://www.w3.org/TR/selectors-api/" target="_blank"&gt;W3C's Selectors API homepage&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9025681" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/inetpub/archive/tags/Web+Standards/default.aspx">Web Standards</category></item></channel></rss>