<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Garrick Cheung &#187; pseudo</title>
	<atom:link href="http://www.garrickcheung.com/tag/pseudo/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.garrickcheung.com</link>
	<description>Sharing what I know and learn about CSS, MooTools, Javascript, PHP and etc.</description>
	<lastBuildDate>Fri, 30 Sep 2011 05:16:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>IE7 CSS Pseudo Selector Slowdown?</title>
		<link>http://www.garrickcheung.com/css/ie7-css-pseudo-selector-slowdown/</link>
		<comments>http://www.garrickcheung.com/css/ie7-css-pseudo-selector-slowdown/#comments</comments>
		<pubDate>Sat, 27 Dec 2008 07:46:11 +0000</pubDate>
		<dc:creator>Garrick</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[pseudo]]></category>
		<category><![CDATA[selector]]></category>

		<guid isPermaLink="false">http://www.garrickcheung.com/?p=248</guid>
		<description><![CDATA[Have you ever experienced major slowdown using IE7? It may NOT be memory related. I came across this issue while working on a bug for GameSpot. Users were complaining that the user experience was lagging. It&#8217;s more noticeable with the forums, where the users would drag the scroll bar in long threads, but the page [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever experienced major slowdown using IE7? It may NOT be memory related. I came across this issue while working on a bug for <a href="http://www.gamespot.com" target="_blank">GameSpot</a>. Users were complaining that the user experience was lagging. It&#8217;s more noticeable with the forums, where the users would drag the scroll bar in long threads, but the page wouldn&#8217;t scroll for a few seconds. <a href="http://www.gamespot.com/users/rockmfr/" target="_blank">RockMFR</a> had the solution, which I shall share with you.<span id="more-248"></span></p>
<h3>The Solution</h3>
<p>It was related to a pseudo selector in CSS, :hover to be exact. I&#8217;ll simplify it so it won&#8217;t look exactly like what it did on <a href="http://www.gamespot.com" target="_blank">GameSpot</a>. The line was incorrectly coded.</p>
<p><strong>Problem</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#some_container</span> <span style="color: #6666ff;">.anchor</span><span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span><span style="color: #993333;">underline</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p><strong>Solution</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#some_container</span> a<span style="color: #6666ff;">.anchor</span><span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span><span style="color: #993333;">underline</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Do you see the difference there? The incorrect way was missing the &#8220;a&#8221;. I&#8217;m not totally positive why this would cause IE7 to hiccup but my theory is that IE7 was trying to apply :hover onto the element with the &#8220;anchor&#8221; class, but had trouble finding it. And because the thread was so long, IE7 MAY have been trying to render and apply the rule to the element with the &#8220;anchor&#8221; class. Another thing is that the rule wasn&#8217;t even being applied in the forum pages, which makes things odd.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.garrickcheung.com/css/ie7-css-pseudo-selector-slowdown/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Qualified Selectors in MooTools</title>
		<link>http://www.garrickcheung.com/mootools/qualified-selectors-in-mootools/</link>
		<comments>http://www.garrickcheung.com/mootools/qualified-selectors-in-mootools/#comments</comments>
		<pubDate>Wed, 24 Dec 2008 07:41:51 +0000</pubDate>
		<dc:creator>Garrick</dc:creator>
				<category><![CDATA[MooTools]]></category>
		<category><![CDATA[pseudo]]></category>
		<category><![CDATA[selector]]></category>

		<guid isPermaLink="false">http://www.garrickcheung.com/?p=241</guid>
		<description><![CDATA[My friend Mike Horn asked me to come up with a solution for a pseudo selector in MooTools that John Resig wrote about for jQuery. To sum it up, the pseudo selector basically grabs the element that &#8220;has&#8221; or contains the passed-in element. After taking a look at that I came up with something. The [...]]]></description>
			<content:encoded><![CDATA[<p>My friend <a href="http://www.thegpbkids.com/" target="_blank">Mike Horn</a> asked me to come up with a solution for a pseudo selector in MooTools that <a href="http://ejohn.org/blog/qualified-selectors-in-jquery/" target="_blank">John Resig wrote about for jQuery</a>. To sum it up, the pseudo selector basically grabs the element that &#8220;has&#8221; or contains the passed-in element. After taking a look at that I came up with something.<span id="more-241"></span></p>
<h3>The Code</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//Add the pseudo selector</span>
Selectors.<span style="color: #660066;">Pseudo</span>.<span style="color: #660066;">has</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>arg<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">getElement</span><span style="color: #009900;">&#40;</span>arg<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #000066; font-weight: bold;">this</span> <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//Returns anchors that has img elements</span>
$$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a:has(img)'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>But, correct me if I&#8217;m wrong, we can&#8217;t do the following and expect the same thing:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// returns an array of img elements, instead of anchors</span>
$$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a &lt; img'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>What do you guys think? Is this the way to go for the pseudo &#8220;has&#8221; selector?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.garrickcheung.com/mootools/qualified-selectors-in-mootools/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

