<?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/"
		xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>Brad Collins &#187; bug</title>
	<atom:link href="http://bradcollins.com/tag/bug/feed/" rel="self" type="application/rss+xml" />
	<link>http://bradcollins.com</link>
	<description>Religion, Politics, Tech, Language, Life</description>
	<lastBuildDate>Sat, 07 Jan 2012 23:28:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<copyright>Copyright &#xA9; Brad Collins 2011 </copyright>
	<managingEditor>brad@collins.name (Brad Collins)</managingEditor>
	<webMaster>brad@collins.name (Brad Collins)</webMaster>
	<image>
		<url>http://bradcollins.com/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
		<title>Brad Collins</title>
		<link>http://bradcollins.com</link>
		<width>144</width>
		<height>144</height>
	</image>
	<itunes:subtitle></itunes:subtitle>
	<itunes:summary>Religion, Politics, Tech, Language, Life</itunes:summary>
	<itunes:keywords></itunes:keywords>
	<itunes:category text="Society &#38; Culture" />
	<itunes:author>Brad Collins</itunes:author>
	<itunes:owner>
		<itunes:name>Brad Collins</itunes:name>
		<itunes:email>brad@collins.name</itunes:email>
	</itunes:owner>
	<itunes:block>no</itunes:block>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://bradcollins.com/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<item>
		<title>Webkit Disrespects My Personal Whitespace</title>
		<link>http://bradcollins.com/2010/12/04/webkit-disrespects-my-personal-whitespace/</link>
		<comments>http://bradcollins.com/2010/12/04/webkit-disrespects-my-personal-whitespace/#comments</comments>
		<pubDate>Sat, 04 Dec 2010 17:30:34 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[W3C]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Webkit]]></category>

		<guid isPermaLink="false">http://bradcollins.com/?p=172</guid>
		<description><![CDATA[I&#8217;ve been trying to put some of CSS3&#8242;s nth-* selectors to use in a site I&#8217;m working on right now, and I&#8217;ve run into a problem. I&#8217;m testing my markup and styles in Safari 5 (before moving on to other &#8230; <a href="http://bradcollins.com/2010/12/04/webkit-disrespects-my-personal-whitespace/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been trying to put some of CSS3&#8242;s <code>nth-*</code> selectors to use in a site I&#8217;m working on right now, and I&#8217;ve run into a problem. I&#8217;m testing my markup and styles in Safari 5 (before moving on to other browsers), and I am trying to style child elements 3, 7, 11, etc. So I write this rule:</p>
<pre><code>p:nth-of-type(4n - 1) { … }</code></pre>
<p>That should work, right? After all, 4(1) − 1 = 3; 4(2) − 1 = 7; 4(3) − 1 = 11.</p>
<p>Well I open up Safari, and my changes haven&#8217;t taken. OK. How about a different but equivalent equation?</p>
<pre><code>p:nth-of-type(4n + 3) { … }</code></pre>
<p>Again, pretty simple: 4(0) + 3 = 3; 4(1) + 3 = 7; 4(2) + 3 = 11. The last one hasn&#8217;t taken, for whatever reason, but this one&#8217;s right on.</p>
<p>Still nothing.</p>
<p>I begin to doubt my math skills. I&#8217;ve been doing software of one type or another for 15 years, but my bachelor&#8217;s degree is in electrical engineering. I had to take four calculus classes, linear algebra, and differential equations. OK, I haven&#8217;t used most of that in years, but <code>a<var>n</var> + b</code> is <em>simple</em> algebra—stuff I&#8217;ve been doing for over 20 years. I <em>know</em> simple algebra.</p>
<p>I decide to fire up Firefox (version 3.6.12). Lo and behold, there is the formatting I&#8217;ve been trying desperately to get to show up. Firefox gets it (so does Opera, for the record), but Safari doesn&#8217;t (neither does Chrome). Evidently we have a Webkit bug.</p>
<p>For grins, even though it won&#8217;t get me where I want to go, I try this:</p>
<pre><code>p:nth-of-type(4n) { … }</code></pre>
<p>The formatting appears correctly in both Firefox and Safari! Therefore Webkit does understand <code>nth-of-type</code>, but something about <code>a<var>n</var> + b</code> gives it heartburn that <code>a<var>n</var></code> doesn&#8217;t.</p>
<p>I try one more thing: remove the whitespace in the equation.</p>
<pre><code>p:nth-of-type(4n+3) { … }</code></pre>
<p>It works! Safari and Firefox both rendered the formatting properly. Webkit just doesn&#8217;t care for the whitespace.</p>
<p>But is whitespace forbidden in the equation? Here&#8217;s what the <a title="CSS3 Spec (Recommended) For Structural Pseudo-Classes" href="http://www.w3.org/TR/css3-selectors/#structural-pseudos">spec has to say</a>:</p>
<blockquote><p>Whitespace is permitted after the &#8220;(&#8220;, before the &#8220;)&#8221;, and on either side of the &#8220;+&#8221; or &#8220;-&#8221; that separates the an and b parts when both are present.</p>
<p>Valid Examples with white space:</p>
<pre><code>:nth-child( 3n + 1 )
:nth-child( +3n - 2 )
:nth-child( -n+ 6)
:nth-child( +6 )</code></pre>
<p>—<cite><a href="http://www.w3.org/TR/css3-selectors/#structural-pseudos">http://www.w3.org/TR/css3-selectors/#structural-pseudos</a></cite></p></blockquote>
<p>So then, we do have a bug. Webkit doesn&#8217;t respect the whitespace in <code>nth-child</code> and the other <code>nth-*</code> selectors. The workaround is easy enough, but it&#8217;s going to be hard for me to break the habit of adding space around the arithmetic operator. It&#8217;s a best practice, so far as I&#8217;m concerned, for code readability. Nevertheless, the expressions are simple enough that it&#8217;s not a terrible price to pay to get Safari/Chrome to play.</p>
<p>If you want to see it in action, check out <a title="nth-child Rendering Test File" href="http://bradcollins.com/wp-content/uploads/2010/12/nth-child-test.html">this test file</a>. Below is a screen capture of Safari&#8217;s rendering (left) and Firefox&#8217;s rendering (right). As you can see, Safari only renders <code>nth-child(2n+1)</code> correctly while Firefox renders them both correctly.</p>
<div id="attachment_185" class="wp-caption aligncenter" style="width: 650px"><a href="http://bradcollins.com/wp-content/uploads/2010/12/nth-child-test-safari-vs-firefox.gif"><img class="size-large wp-image-185" title="nth-child Rendering Comparison (Safari vs. Firefox)" src="http://bradcollins.com/wp-content/uploads/2010/12/nth-child-test-safari-vs-firefox-1024x585.gif" alt="Safari's rendering is on the left. It does not render nth-child(2n + 1) correctly, but only nth-child(2n+1), i.e., without spaces. On the right, Firefox renders both correctly." width="640" height="365" /></a><p class="wp-caption-text">nth-child Rendering Comparison (Safari vs. Firefox)</p></div>
]]></content:encoded>
			<wfw:commentRss>http://bradcollins.com/2010/12/04/webkit-disrespects-my-personal-whitespace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Audacity Crudity</title>
		<link>http://bradcollins.com/2008/12/26/audacity-crudity/</link>
		<comments>http://bradcollins.com/2008/12/26/audacity-crudity/#comments</comments>
		<pubDate>Fri, 26 Dec 2008 23:41:47 +0000</pubDate>
		<dc:creator>Brad</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Audacity]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[bug]]></category>

		<guid isPermaLink="false">http://bradcollins.com/?p=57</guid>
		<description><![CDATA[I&#8217;m starting to do some rudimentary audio editing on the Mac. Not impressed with Audacity version 1.2.5 for the Mac. The most glaring oddity is when exporting a file. As I type the file name, Audacity starts playing the audio. &#8230; <a href="http://bradcollins.com/2008/12/26/audacity-crudity/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m starting to do some rudimentary audio editing on the Mac. Not impressed with <a href="http://audacity.sourceforge.net/">Audacity</a> version 1.2.5 for the Mac. The most glaring oddity is when exporting a file. As I type the file name, Audacity starts playing the audio. Evidently Audacity does not disable its keyboard shortcuts (not related to the Save dialog, that is). Awfully flaky.</p>
<p>That&#8217;s not to mention the rough-around-the-edges UI that makes a Mac user cringe. Guess I&#8217;m just spoiled.</p>
]]></content:encoded>
			<wfw:commentRss>http://bradcollins.com/2008/12/26/audacity-crudity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

