<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Creating a querySelector for IE that runs at &#8220;native speed&#8221;</title>
	<atom:link href="http://ajaxian.com/archives/creating-a-queryselector-for-ie-that-runs-at-native-speed/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/creating-a-queryselector-for-ie-that-runs-at-native-speed</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Thu, 09 Feb 2012 06:55:33 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
	<item>
		<title>By: TJK</title>
		<link>http://ajaxian.com/archives/creating-a-queryselector-for-ie-that-runs-at-native-speed/comment-page-1#comment-275369</link>
		<dc:creator>TJK</dc:creator>
		<pubDate>Thu, 03 Sep 2009 22:31:49 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7300#comment-275369</guid>
		<description>One can also use this approach:
&lt;code&gt;
behavior: expression(
  (this.runtimeStyle.behavior=&quot;none&quot;) &amp;&amp;  (
   ...
  ) );
&lt;/code&gt;

I am using this technique to 
&lt;a href=&quot;http://tjkdesign.com/articles/png-alpha-transparency_with-no-http-request.asp&quot; title=&quot;&quot; rel=&quot;nofollow&quot;&gt;fix PNG transparency in IE6&lt;/a&gt; (without an HTTP request).</description>
		<content:encoded><![CDATA[<p>One can also use this approach:<br />
<code><br />
behavior: expression(<br />
  (this.runtimeStyle.behavior="none") &amp;&amp;  (<br />
   ...<br />
  ) );<br />
</code></p>
<p>I am using this technique to<br />
<a href="http://tjkdesign.com/articles/png-alpha-transparency_with-no-http-request.asp" title="" rel="nofollow">fix PNG transparency in IE6</a> (without an HTTP request).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yuchangchun</title>
		<link>http://ajaxian.com/archives/creating-a-queryselector-for-ie-that-runs-at-native-speed/comment-page-1#comment-275325</link>
		<dc:creator>yuchangchun</dc:creator>
		<pubDate>Wed, 02 Sep 2009 04:08:09 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7300#comment-275325</guid>
		<description>I admire you guys!</description>
		<content:encoded><![CDATA[<p>I admire you guys!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BertrandLeRoy</title>
		<link>http://ajaxian.com/archives/creating-a-queryselector-for-ie-that-runs-at-native-speed/comment-page-1#comment-275313</link>
		<dc:creator>BertrandLeRoy</dc:creator>
		<pubDate>Tue, 01 Sep 2009 19:09:21 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7300#comment-275313</guid>
		<description>I published a similar, but much faster approach here:
http://weblogs.asp.net/bleroy/archive/2009/08/31/queryselectorall-on-old-ie-versions-something-that-doesn-t-work.aspx
The thing is, it&#039;s still way slower than jQuery. So bottom line is, it&#039;s futilie to try to hack IE6/7 into exposing its native CSS selection engine. JavaScript implementations are now fast and mature enough that they will outperform anything else anytime.</description>
		<content:encoded><![CDATA[<p>I published a similar, but much faster approach here:<br />
<a href="http://weblogs.asp.net/bleroy/archive/2009/08/31/queryselectorall-on-old-ie-versions-something-that-doesn-t-work.aspx" rel="nofollow">http://weblogs.asp.net/bleroy/archive/2009/08/31/queryselectorall-on-old-ie-versions-something-that-doesn-t-work.aspx</a><br />
The thing is, it&#8217;s still way slower than jQuery. So bottom line is, it&#8217;s futilie to try to hack IE6/7 into exposing its native CSS selection engine. JavaScript implementations are now fast and mature enough that they will outperform anything else anytime.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WebReflection</title>
		<link>http://ajaxian.com/archives/creating-a-queryselector-for-ie-that-runs-at-native-speed/comment-page-1#comment-275299</link>
		<dc:creator>WebReflection</dc:creator>
		<pubDate>Mon, 31 Aug 2009 12:16:36 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7300#comment-275299</guid>
		<description>Diego, there is a counter trick as well and the point is that we do not need to force &quot;layout refresh&quot;, which could be extremely slow if the DOM is loads of nodes and styles. I need to test more but since the counter trick seems to be activated as soon as you &quot;touch&quot; the node, maybe this strategy over a &quot;tricky&quot; loop will work as expected. Dunno though, would be nice if one of us find some concrete solution and will post it here. Best Regards.</description>
		<content:encoded><![CDATA[<p>Diego, there is a counter trick as well and the point is that we do not need to force &#8220;layout refresh&#8221;, which could be extremely slow if the DOM is loads of nodes and styles. I need to test more but since the counter trick seems to be activated as soon as you &#8220;touch&#8221; the node, maybe this strategy over a &#8220;tricky&#8221; loop will work as expected. Dunno though, would be nice if one of us find some concrete solution and will post it here. Best Regards.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dperini</title>
		<link>http://ajaxian.com/archives/creating-a-queryselector-for-ie-that-runs-at-native-speed/comment-page-1#comment-275298</link>
		<dc:creator>dperini</dc:creator>
		<pubDate>Mon, 31 Aug 2009 11:58:44 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7300#comment-275298</guid>
		<description>Paul,
nice trick, really...It is good some developers put more efforts by looking to other alternatives, even if this is not well rewarded by the average readers.

I tried this technique (based on Dean Edwards findings) in several ways in my NWMatcher selector engine to be able to speed up IE browser. I was nearly crying when I realized I couldn&#039;t use that reliably :-)

The trick could work until the number of elements remains low enough (200/300 max). It will start to slow down the browser with more.

@stakka, you are correct, but the &quot;.removeExpression()&quot; can be called within a setTimeout() of 0 milliseconds to achieve the removal of the rules externally from the handler itself. Still I am not sure the process is completely stopped or can be stopped in such a way. I did some test also by enabling/disabling the specific stylesheet containing the expression but not much success either. The only way I found to stop that is to completely overwrite the expression in the rule then remove it.

In IE8 mode this is completely gone, so if it works it will remain a good hack for IE7 and IE6, not applicable for me in a reliable library.

Have fun ! Best Regards.</description>
		<content:encoded><![CDATA[<p>Paul,<br />
nice trick, really&#8230;It is good some developers put more efforts by looking to other alternatives, even if this is not well rewarded by the average readers.</p>
<p>I tried this technique (based on Dean Edwards findings) in several ways in my NWMatcher selector engine to be able to speed up IE browser. I was nearly crying when I realized I couldn&#8217;t use that reliably :-)</p>
<p>The trick could work until the number of elements remains low enough (200/300 max). It will start to slow down the browser with more.</p>
<p>@stakka, you are correct, but the &#8220;.removeExpression()&#8221; can be called within a setTimeout() of 0 milliseconds to achieve the removal of the rules externally from the handler itself. Still I am not sure the process is completely stopped or can be stopped in such a way. I did some test also by enabling/disabling the specific stylesheet containing the expression but not much success either. The only way I found to stop that is to completely overwrite the expression in the rule then remove it.</p>
<p>In IE8 mode this is completely gone, so if it works it will remain a good hack for IE7 and IE6, not applicable for me in a reliable library.</p>
<p>Have fun ! Best Regards.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WebReflection</title>
		<link>http://ajaxian.com/archives/creating-a-queryselector-for-ie-that-runs-at-native-speed/comment-page-1#comment-275297</link>
		<dc:creator>WebReflection</dc:creator>
		<pubDate>Sun, 30 Aug 2009 11:13:48 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7300#comment-275297</guid>
		<description>I did a couple of tests in IE8 and IE7 emulation over SlickSpeed test page.
This method does not seem to be reliable, it returns for example 6 divs rather than 46 with selector &quot;div&quot;.
52 if I scrollBy 2 tmes (46 + 6 found first time duplicated)
Also I do not get some part of the code, like the second push over an array to return an array. The function could simply return

document.__qsResult.splice(0, document.__qsResult.length);

without overheads. Finally, it seems to be faster via addRule and removeRule, rather than appendChild/removeChild via
var style = document.styleSheets[0] &#124;&#124; document.createStyleSheet()

I think we need a lot of test cases but being expressions something not easy to control, behavior speaking, I am not sure how much this technique could be used. The scrollBy is for example something I do not like, but it is necessary, while I have to say this technique could be faster than the one with counters over all nodes.

Regards</description>
		<content:encoded><![CDATA[<p>I did a couple of tests in IE8 and IE7 emulation over SlickSpeed test page.<br />
This method does not seem to be reliable, it returns for example 6 divs rather than 46 with selector &#8220;div&#8221;.<br />
52 if I scrollBy 2 tmes (46 + 6 found first time duplicated)<br />
Also I do not get some part of the code, like the second push over an array to return an array. The function could simply return</p>
<p>document.__qsResult.splice(0, document.__qsResult.length);</p>
<p>without overheads. Finally, it seems to be faster via addRule and removeRule, rather than appendChild/removeChild via<br />
var style = document.styleSheets[0] || document.createStyleSheet()</p>
<p>I think we need a lot of test cases but being expressions something not easy to control, behavior speaking, I am not sure how much this technique could be used. The scrollBy is for example something I do not like, but it is necessary, while I have to say this technique could be faster than the one with counters over all nodes.</p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adambankin</title>
		<link>http://ajaxian.com/archives/creating-a-queryselector-for-ie-that-runs-at-native-speed/comment-page-1#comment-275293</link>
		<dc:creator>adambankin</dc:creator>
		<pubDate>Sat, 29 Aug 2009 16:22:33 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7300#comment-275293</guid>
		<description>Interesting, however I don&#039;t see this as best practice. IE Expressions blur the separation of style and behaviour. 

Also, as they&#039;re javascript wrapped in css rules, they fail if the user has js turned off so you should still style the element in css alone to allow for a no js scenario.

Any reason why you wouldn&#039;t write this in a js file instead?</description>
		<content:encoded><![CDATA[<p>Interesting, however I don&#8217;t see this as best practice. IE Expressions blur the separation of style and behaviour. </p>
<p>Also, as they&#8217;re javascript wrapped in css rules, they fail if the user has js turned off so you should still style the element in css alone to allow for a no js scenario.</p>
<p>Any reason why you wouldn&#8217;t write this in a js file instead?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joeri</title>
		<link>http://ajaxian.com/archives/creating-a-queryselector-for-ie-that-runs-at-native-speed/comment-page-1#comment-275292</link>
		<dc:creator>Joeri</dc:creator>
		<pubDate>Sat, 29 Aug 2009 16:15:03 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7300#comment-275292</guid>
		<description>The limitation to supported selectors might not be that big of an issue when viewed from a library&#039;s perspective. Worst case you only use this engine when the selector is supported, and fall back to the existing selector engines for other rules.

This should at least be tested and benchmarked in detail, because while it&#039;s an ugly hack, it it makes IE faster to work with, I&#039;m all for it.</description>
		<content:encoded><![CDATA[<p>The limitation to supported selectors might not be that big of an issue when viewed from a library&#8217;s perspective. Worst case you only use this engine when the selector is supported, and fall back to the existing selector engines for other rules.</p>
<p>This should at least be tested and benchmarked in detail, because while it&#8217;s an ugly hack, it it makes IE faster to work with, I&#8217;m all for it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WebReflection</title>
		<link>http://ajaxian.com/archives/creating-a-queryselector-for-ie-that-runs-at-native-speed/comment-page-1#comment-275291</link>
		<dc:creator>WebReflection</dc:creator>
		<pubDate>Sat, 29 Aug 2009 04:17:51 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7300#comment-275291</guid>
		<description>@Darkimmortal ... a jQuery plugin explicitly requires jQuery, which includes Sizzle, so a pug-in would be something extra rather than something less, or something faster ... do you agree?</description>
		<content:encoded><![CDATA[<p>@Darkimmortal &#8230; a jQuery plugin explicitly requires jQuery, which includes Sizzle, so a pug-in would be something extra rather than something less, or something faster &#8230; do you agree?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darkimmortal</title>
		<link>http://ajaxian.com/archives/creating-a-queryselector-for-ie-that-runs-at-native-speed/comment-page-1#comment-275290</link>
		<dc:creator>Darkimmortal</dc:creator>
		<pubDate>Sat, 29 Aug 2009 01:48:10 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7300#comment-275290</guid>
		<description>Someone should write a jQuery plugin for simple selectors which uses this.</description>
		<content:encoded><![CDATA[<p>Someone should write a jQuery plugin for simple selectors which uses this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: slightlyoff</title>
		<link>http://ajaxian.com/archives/creating-a-queryselector-for-ie-that-runs-at-native-speed/comment-page-1#comment-275288</link>
		<dc:creator>slightlyoff</dc:creator>
		<pubDate>Fri, 28 Aug 2009 21:22:49 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7300#comment-275288</guid>
		<description>I think Jon&#039;s comment covers most of it, but it should also be noted that this technique is ALSO limited to whatever CSS selector support IE shipped in a particular version. Oof.

That said, I love how small it is.

Regards</description>
		<content:encoded><![CDATA[<p>I think Jon&#8217;s comment covers most of it, but it should also be noted that this technique is ALSO limited to whatever CSS selector support IE shipped in a particular version. Oof.</p>
<p>That said, I love how small it is.</p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stakka</title>
		<link>http://ajaxian.com/archives/creating-a-queryselector-for-ie-that-runs-at-native-speed/comment-page-1#comment-275286</link>
		<dc:creator>Stakka</dc:creator>
		<pubDate>Fri, 28 Aug 2009 20:45:28 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7300#comment-275286</guid>
		<description>@timcameronryan: .removeExpression() can&#039;t be called from within the expression itself.</description>
		<content:encoded><![CDATA[<p>@timcameronryan: .removeExpression() can&#8217;t be called from within the expression itself.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brad Neuberg</title>
		<link>http://ajaxian.com/archives/creating-a-queryselector-for-ie-that-runs-at-native-speed/comment-page-1#comment-275285</link>
		<dc:creator>Brad Neuberg</dc:creator>
		<pubDate>Fri, 28 Aug 2009 20:38:34 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7300#comment-275285</guid>
		<description>Clever hack!</description>
		<content:encoded><![CDATA[<p>Clever hack!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jordan1</title>
		<link>http://ajaxian.com/archives/creating-a-queryselector-for-ie-that-runs-at-native-speed/comment-page-1#comment-275284</link>
		<dc:creator>Jordan1</dc:creator>
		<pubDate>Fri, 28 Aug 2009 17:39:29 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7300#comment-275284</guid>
		<description>So to prevent it from recalculating forever, you put a &quot;singlex&quot; flag on the node. But what about afterwards when you want to perform another querySelector that happens to select the same node again?</description>
		<content:encoded><![CDATA[<p>So to prevent it from recalculating forever, you put a &#8220;singlex&#8221; flag on the node. But what about afterwards when you want to perform another querySelector that happens to select the same node again?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WebReflection</title>
		<link>http://ajaxian.com/archives/creating-a-queryselector-for-ie-that-runs-at-native-speed/comment-page-1#comment-275283</link>
		<dc:creator>WebReflection</dc:creator>
		<pubDate>Fri, 28 Aug 2009 17:16:29 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7300#comment-275283</guid>
		<description>is basically what Dean did before and what I have used a while ago for Essential selector except it works faster thanks to direct node push but I agree with John, there are too many limits and performances are still not that &quot;fantastic&quot;.

I would use this strategy for a getElementsByClassName rather than querySelector, in that case everything will be more &quot;reasonable&quot; and meaningful.</description>
		<content:encoded><![CDATA[<p>is basically what Dean did before and what I have used a while ago for Essential selector except it works faster thanks to direct node push but I agree with John, there are too many limits and performances are still not that &#8220;fantastic&#8221;.</p>
<p>I would use this strategy for a getElementsByClassName rather than querySelector, in that case everything will be more &#8220;reasonable&#8221; and meaningful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: keeto</title>
		<link>http://ajaxian.com/archives/creating-a-queryselector-for-ie-that-runs-at-native-speed/comment-page-1#comment-275282</link>
		<dc:creator>keeto</dc:creator>
		<pubDate>Fri, 28 Aug 2009 16:48:00 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7300#comment-275282</guid>
		<description>Shouldn&#039;t that be querySelectorAll? It returns a collection, not a single element.</description>
		<content:encoded><![CDATA[<p>Shouldn&#8217;t that be querySelectorAll? It returns a collection, not a single element.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: timcameronryan</title>
		<link>http://ajaxian.com/archives/creating-a-queryselector-for-ie-that-runs-at-native-speed/comment-page-1#comment-275281</link>
		<dc:creator>timcameronryan</dc:creator>
		<pubDate>Fri, 28 Aug 2009 16:39:21 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7300#comment-275281</guid>
		<description>@shadedecho: Wouldn&#039;t it be better to just remove the expression entirely using the .removeExpression() method?</description>
		<content:encoded><![CDATA[<p>@shadedecho: Wouldn&#8217;t it be better to just remove the expression entirely using the .removeExpression() method?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: paulyoung</title>
		<link>http://ajaxian.com/archives/creating-a-queryselector-for-ie-that-runs-at-native-speed/comment-page-1#comment-275280</link>
		<dc:creator>paulyoung</dc:creator>
		<pubDate>Fri, 28 Aug 2009 16:20:59 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7300#comment-275280</guid>
		<description>@shadedecho: If I&#039;m not mistaken, the slowness of traditional CSS expressions is caused by:

1) Having to reflow the layout thousands of times.
2) Having to perform the actual processing thousands of times (such as, retrieving the width of the containing element, and performing some type of processing on it)

I don&#039;t believe a reflow of the page is caused by setting a CSS property that doesn&#039;t even register in the browser to 0. And the expense of running the equivalent of &quot;if (true) return 0&quot; is computationally zero. From my tests there doesn&#039;t appear to be any noticeable performance penalty incurred by this technique.</description>
		<content:encoded><![CDATA[<p>@shadedecho: If I&#8217;m not mistaken, the slowness of traditional CSS expressions is caused by:</p>
<p>1) Having to reflow the layout thousands of times.<br />
2) Having to perform the actual processing thousands of times (such as, retrieving the width of the containing element, and performing some type of processing on it)</p>
<p>I don&#8217;t believe a reflow of the page is caused by setting a CSS property that doesn&#8217;t even register in the browser to 0. And the expense of running the equivalent of &#8220;if (true) return 0&#8243; is computationally zero. From my tests there doesn&#8217;t appear to be any noticeable performance penalty incurred by this technique.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Borgar</title>
		<link>http://ajaxian.com/archives/creating-a-queryselector-for-ie-that-runs-at-native-speed/comment-page-1#comment-275278</link>
		<dc:creator>Borgar</dc:creator>
		<pubDate>Fri, 28 Aug 2009 15:42:19 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7300#comment-275278</guid>
		<description>@paulyoung: My memory of longwinded overly detailed code discussions apparently doesn&#039;t stretch that far back. :-)

I don&#039;t know how practical this is for the libraries, but for a &quot;contained&quot; application (like yours) this looks great.</description>
		<content:encoded><![CDATA[<p>@paulyoung: My memory of longwinded overly detailed code discussions apparently doesn&#8217;t stretch that far back. :-)</p>
<p>I don&#8217;t know how practical this is for the libraries, but for a &#8220;contained&#8221; application (like yours) this looks great.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shadedecho</title>
		<link>http://ajaxian.com/archives/creating-a-queryselector-for-ie-that-runs-at-native-speed/comment-page-1#comment-275277</link>
		<dc:creator>shadedecho</dc:creator>
		<pubDate>Fri, 28 Aug 2009 15:19:11 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=7300#comment-275277</guid>
		<description>I like the method that @bkuzmic&#039;s link suggests... which is to achieve single execution of expressions by overwriting the expression after first run. The trick that link describes is that some properties can overwrite themselves, and some can&#039;t. So the article suggests using a &quot;helper&quot; attribute that CAN overwrite itself, to dynamically set another property. 

&quot;clear&quot; can overwrite itself, so it&#039;s a good candidate as the helper attribute. And this means it CAN be reused over and over again. So, it might look like this:

.elem {  
   background-position: inherit;  
   *clear: expression(
      style.backgroundPosition = parentNode.style.backgroundPosition,
      style.clear = &quot;none&quot;, 0  
   );
}

So, clear (with star hack to keep to IE6/7) is used to set the backgroundPosition property to behave as the standard &quot;inherit&quot; from it&#039;s parent object (which IE doesn&#039;t support). Notice the setting of   style.clear = &quot;none&quot;  is what makes it single-execution. Oh, and some other IE quirk... the final &quot;, 0&quot; is needed to prevent hanging. crazy.

The problem with the OP method is, as pointed out already, the expression WILL still be evaluated over and over, but just short circuited with the flag. So there&#039;s still overhead.

This property overwrite concept seems a better hack way to achieve the single-execution.</description>
		<content:encoded><![CDATA[<p>I like the method that @bkuzmic&#8217;s link suggests&#8230; which is to achieve single execution of expressions by overwriting the expression after first run. The trick that link describes is that some properties can overwrite themselves, and some can&#8217;t. So the article suggests using a &#8220;helper&#8221; attribute that CAN overwrite itself, to dynamically set another property. </p>
<p>&#8220;clear&#8221; can overwrite itself, so it&#8217;s a good candidate as the helper attribute. And this means it CAN be reused over and over again. So, it might look like this:</p>
<p>.elem {<br />
   background-position: inherit;<br />
   *clear: expression(<br />
      style.backgroundPosition = parentNode.style.backgroundPosition,<br />
      style.clear = &#8220;none&#8221;, 0<br />
   );<br />
}</p>
<p>So, clear (with star hack to keep to IE6/7) is used to set the backgroundPosition property to behave as the standard &#8220;inherit&#8221; from it&#8217;s parent object (which IE doesn&#8217;t support). Notice the setting of   style.clear = &#8220;none&#8221;  is what makes it single-execution. Oh, and some other IE quirk&#8230; the final &#8220;, 0&#8243; is needed to prevent hanging. crazy.</p>
<p>The problem with the OP method is, as pointed out already, the expression WILL still be evaluated over and over, but just short circuited with the flag. So there&#8217;s still overhead.</p>
<p>This property overwrite concept seems a better hack way to achieve the single-execution.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

