<?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: Whitespace in CSS Calculations</title>
	<atom:link href="http://meyerweb.com/eric/thoughts/2012/04/10/whitespace-in-css-calculations/feed/" rel="self" type="application/rss+xml" />
	<link>http://meyerweb.com/eric/thoughts/2012/04/10/whitespace-in-css-calculations/</link>
	<description>Things that Eric A. Meyer, CSS expert, writes about on his personal Web site; it&#039;s largely Web standards and Web technology, but also various bits of culture, politics, personal observations, and other miscellaneous stuff</description>
	<lastBuildDate>Fri, 10 May 2013 11:50:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Boris</title>
		<link>http://meyerweb.com/eric/thoughts/2012/04/10/whitespace-in-css-calculations/#comment-661301</link>
		<dc:creator>Boris</dc:creator>
		<pubDate>Mon, 16 Apr 2012 01:12:03 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1747#comment-661301</guid>
		<description><![CDATA[Doug, Firefox supports calc() with a &quot;-moz&quot; prefix.  IE9 supports it without a prefix, as I recall.  Current Chrome may support it with a -webkit prefix, maybe.]]></description>
		<content:encoded><![CDATA[<p>Doug, Firefox supports calc() with a &#8220;-moz&#8221; prefix.  IE9 supports it without a prefix, as I recall.  Current Chrome may support it with a -webkit prefix, maybe.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug</title>
		<link>http://meyerweb.com/eric/thoughts/2012/04/10/whitespace-in-css-calculations/#comment-661222</link>
		<dc:creator>Doug</dc:creator>
		<pubDate>Sun, 15 Apr 2012 19:57:23 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1747#comment-661222</guid>
		<description><![CDATA[I&#039;ve been looking for a standards-based way to do stuff like this since way back in the days of IE-only &quot;behaviors,&quot; but I can&#039;t get FF, Chrome or IE9 to recognize calc. What browsers support this?]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ve been looking for a standards-based way to do stuff like this since way back in the days of IE-only &#8220;behaviors,&#8221; but I can&#8217;t get FF, Chrome or IE9 to recognize calc. What browsers support this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Some links for light reading (13/4/12) &#124; Max Design</title>
		<link>http://meyerweb.com/eric/thoughts/2012/04/10/whitespace-in-css-calculations/#comment-660311</link>
		<dc:creator>Some links for light reading (13/4/12) &#124; Max Design</dc:creator>
		<pubDate>Fri, 13 Apr 2012 06:25:50 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1747#comment-660311</guid>
		<description><![CDATA[[...] Whitespace in CSS Calculations [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Whitespace in CSS Calculations [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dew Drop &#8211; April 11, 2012 (#1,304) &#124; Alvin Ashcraft&#039;s Morning Dew</title>
		<link>http://meyerweb.com/eric/thoughts/2012/04/10/whitespace-in-css-calculations/#comment-659622</link>
		<dc:creator>Dew Drop &#8211; April 11, 2012 (#1,304) &#124; Alvin Ashcraft&#039;s Morning Dew</dc:creator>
		<pubDate>Wed, 11 Apr 2012 13:09:07 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1747#comment-659622</guid>
		<description><![CDATA[[...] Whitespace in CSS Calculations (Eric Meyer) [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Whitespace in CSS Calculations (Eric Meyer) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Boris</title>
		<link>http://meyerweb.com/eric/thoughts/2012/04/10/whitespace-in-css-calculations/#comment-659351</link>
		<dc:creator>Boris</dc:creator>
		<pubDate>Tue, 10 Apr 2012 23:58:55 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1747#comment-659351</guid>
		<description><![CDATA[J. King, you&#039;re right in general, but to a CSS parser your example looks like the number &quot;4&quot; followed by the unknown unit &quot;em-2em&quot;.  The relevant parts of the CSS tokenizer spec:

  DIMENSION {num}{ident}
  ident     [-]?{nmstart}{nmchar}*
  nmstart   [_a-z]&#124;{nonascii}&#124;{escape}
  nmchar    [_a-z0-9-]&#124;{nonascii}&#124;{escape}

so &quot;em-2em&quot; is a perfectly valid &quot;ident&quot; and the whole thing is a single DIMENSION token as far as the tokenizer is concerned.  Then the parser sitting on top of the tokenizer has to drop the whole thing because the actual ident is not a known unit, but making that somehow work would require completely redefining how CSS parsing works...]]></description>
		<content:encoded><![CDATA[<p>J. King, you&#8217;re right in general, but to a CSS parser your example looks like the number &#8220;4&#8243; followed by the unknown unit &#8220;em-2em&#8221;.  The relevant parts of the CSS tokenizer spec:</p>
<p>  DIMENSION {num}{ident}<br />
  ident     [-]?{nmstart}{nmchar}*<br />
  nmstart   [_a-z]|{nonascii}|{escape}<br />
  nmchar    [_a-z0-9-]|{nonascii}|{escape}</p>
<p>so &#8220;em-2em&#8221; is a perfectly valid &#8220;ident&#8221; and the whole thing is a single DIMENSION token as far as the tokenizer is concerned.  Then the parser sitting on top of the tokenizer has to drop the whole thing because the actual ident is not a known unit, but making that somehow work would require completely redefining how CSS parsing works&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: J. King</title>
		<link>http://meyerweb.com/eric/thoughts/2012/04/10/whitespace-in-css-calculations/#comment-659338</link>
		<dc:creator>J. King</dc:creator>
		<pubDate>Tue, 10 Apr 2012 23:17:11 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1747#comment-659338</guid>
		<description><![CDATA[Oops.  That should have read &quot;(missing operator)&quot;, of course...]]></description>
		<content:encoded><![CDATA[<p>Oops.  That should have read &#8220;(missing operator)&#8221;, of course&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: J. King</title>
		<link>http://meyerweb.com/eric/thoughts/2012/04/10/whitespace-in-css-calculations/#comment-659327</link>
		<dc:creator>J. King</dc:creator>
		<pubDate>Tue, 10 Apr 2012 22:53:49 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1747#comment-659327</guid>
		<description><![CDATA[I would imagine that The spaces around adition and division are required because of the grammar defining values.  Whereas &quot;2em/2&quot; is unambigously a division operation, &quot;4em-2em&quot; presumably looks like &quot;(4em)(missing operand)(-2em)&quot;.  I agree it&#039;s a -little- stupid, but presumably there was a very, very good reason not to complicate the grammar to make this more intuitive for minimalists. For what it&#039;s worth I agree that all operations should consistently require spaces instead.]]></description>
		<content:encoded><![CDATA[<p>I would imagine that The spaces around adition and division are required because of the grammar defining values.  Whereas &#8220;2em/2&#8243; is unambigously a division operation, &#8220;4em-2em&#8221; presumably looks like &#8220;(4em)(missing operand)(-2em)&#8221;.  I agree it&#8217;s a -little- stupid, but presumably there was a very, very good reason not to complicate the grammar to make this more intuitive for minimalists. For what it&#8217;s worth I agree that all operations should consistently require spaces instead.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Meyer</title>
		<link>http://meyerweb.com/eric/thoughts/2012/04/10/whitespace-in-css-calculations/#comment-659246</link>
		<dc:creator>Eric Meyer</dc:creator>
		<pubDate>Tue, 10 Apr 2012 18:19:57 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1747#comment-659246</guid>
		<description><![CDATA[I’m open to any reasonable suggestions, &lt;a href=&quot;http://meyerweb.com/eric/thoughts/2012/04/10/whitespace-in-css-calculations/#comment-659229&quot; rel=&quot;nofollow&quot;&gt;Chris&lt;/a&gt;!  Regardless of date, though, I think the celebrations have to be held on eBay.]]></description>
		<content:encoded><![CDATA[<p>I’m open to any reasonable suggestions, <a href="http://meyerweb.com/eric/thoughts/2012/04/10/whitespace-in-css-calculations/#comment-659229" rel="nofollow">Chris</a>!  Regardless of date, though, I think the celebrations have to be held on eBay.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Neale</title>
		<link>http://meyerweb.com/eric/thoughts/2012/04/10/whitespace-in-css-calculations/#comment-659235</link>
		<dc:creator>Chris Neale</dc:creator>
		<pubDate>Tue, 10 Apr 2012 17:11:38 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1747#comment-659235</guid>
		<description><![CDATA[So, on which day are we celebrating Bidmas this year?]]></description>
		<content:encoded><![CDATA[<p>So, on which day are we celebrating Bidmas this year?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tom jones</title>
		<link>http://meyerweb.com/eric/thoughts/2012/04/10/whitespace-in-css-calculations/#comment-659229</link>
		<dc:creator>tom jones</dc:creator>
		<pubDate>Tue, 10 Apr 2012 16:53:41 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1747#comment-659229</guid>
		<description><![CDATA[yeah, what Boris said. 

&quot;depending on whether you privilege multipliers over dividers or vice versa.&quot;

no, no (sane) system prioritizes multiplying over dividing (or vice versa). it&#039;s always in the order it&#039;s written (unless it&#039;s polish/reverse-polish/postfix/.. notation).]]></description>
		<content:encoded><![CDATA[<p>yeah, what Boris said. </p>
<p>&#8220;depending on whether you privilege multipliers over dividers or vice versa.&#8221;</p>
<p>no, no (sane) system prioritizes multiplying over dividing (or vice versa). it&#8217;s always in the order it&#8217;s written (unless it&#8217;s polish/reverse-polish/postfix/.. notation).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Meyer</title>
		<link>http://meyerweb.com/eric/thoughts/2012/04/10/whitespace-in-css-calculations/#comment-659228</link>
		<dc:creator>Eric Meyer</dc:creator>
		<pubDate>Tue, 10 Apr 2012 16:52:16 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1747#comment-659228</guid>
		<description><![CDATA[Sorry, Boris, Brian, and Bouke—that was a typo which I’ve now fixed: I was sure I’d mistakenly switch up 0.5em and 4.5 em, and so I did.  Next time I need to build an example that yields wildly different results so there’s less chance of a mistake.

As for the difference between standards and mnemonics, well, if someone learns a mnemonic they regard it as a standard.  Learn the wrong mnemonic, learn the wrong standard.  I still say the specification should state explicitly which ordering precedence it follows just so there’s less chance of mistake.

I sense a theme…]]></description>
		<content:encoded><![CDATA[<p>Sorry, Boris, Brian, and Bouke—that was a typo which I’ve now fixed: I was sure I’d mistakenly switch up 0.5em and 4.5 em, and so I did.  Next time I need to build an example that yields wildly different results so there’s less chance of a mistake.</p>
<p>As for the difference between standards and mnemonics, well, if someone learns a mnemonic they regard it as a standard.  Learn the wrong mnemonic, learn the wrong standard.  I still say the specification should state explicitly which ordering precedence it follows just so there’s less chance of mistake.</p>
<p>I sense a theme…</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Boris</title>
		<link>http://meyerweb.com/eric/thoughts/2012/04/10/whitespace-in-css-calculations/#comment-659212</link>
		<dc:creator>Boris</dc:creator>
		<pubDate>Tue, 10 Apr 2012 16:10:05 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1747#comment-659212</guid>
		<description><![CDATA[Eric, the standard order of operations rules, both in the US and everywhere that mathematics is taught, are that * and / have the same precedence and you evaluate them left to right.  The wikipedia page you link to clearly describes this.  The particular section you linked to isn&#039;t about different &quot;standards&quot;.  It&#039;s about different _mnemonics_ (some incorrect) that people try to use to remember the order.

So your example should end up with 4.5em.  That&#039;s what Gecko does, certainly.  Which browser did 0.5em in your testing?

That all said, I agree that using parentheses to disambiguate expressions like this is absolutely the right thing for human-readability, precisely because most people don&#039;t actually remember their order of operations very well.]]></description>
		<content:encoded><![CDATA[<p>Eric, the standard order of operations rules, both in the US and everywhere that mathematics is taught, are that * and / have the same precedence and you evaluate them left to right.  The wikipedia page you link to clearly describes this.  The particular section you linked to isn&#8217;t about different &#8220;standards&#8221;.  It&#8217;s about different _mnemonics_ (some incorrect) that people try to use to remember the order.</p>
<p>So your example should end up with 4.5em.  That&#8217;s what Gecko does, certainly.  Which browser did 0.5em in your testing?</p>
<p>That all said, I agree that using parentheses to disambiguate expressions like this is absolutely the right thing for human-readability, precisely because most people don&#8217;t actually remember their order of operations very well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ben</title>
		<link>http://meyerweb.com/eric/thoughts/2012/04/10/whitespace-in-css-calculations/#comment-659210</link>
		<dc:creator>ben</dc:creator>
		<pubDate>Tue, 10 Apr 2012 16:01:56 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1747#comment-659210</guid>
		<description><![CDATA[The implication is that infix notation is assumed, but... not documented?]]></description>
		<content:encoded><![CDATA[<p>The implication is that infix notation is assumed, but&#8230; not documented?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chapel</title>
		<link>http://meyerweb.com/eric/thoughts/2012/04/10/whitespace-in-css-calculations/#comment-659192</link>
		<dc:creator>Chapel</dc:creator>
		<pubDate>Tue, 10 Apr 2012 15:33:26 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1747#comment-659192</guid>
		<description><![CDATA[I think the first example expression is MUCH easier to read (since you have to adhere to the order of operations). Your last two examples just make my eyes cross and do weird things.

That being said, I fully agree that consistency (especially when writing up specs people have to adhere to) is key, and there&#039;s absolutely no reason why the last example should barf and break everything.]]></description>
		<content:encoded><![CDATA[<p>I think the first example expression is MUCH easier to read (since you have to adhere to the order of operations). Your last two examples just make my eyes cross and do weird things.</p>
<p>That being said, I fully agree that consistency (especially when writing up specs people have to adhere to) is key, and there&#8217;s absolutely no reason why the last example should barf and break everything.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Dukes</title>
		<link>http://meyerweb.com/eric/thoughts/2012/04/10/whitespace-in-css-calculations/#comment-659189</link>
		<dc:creator>Brian Dukes</dc:creator>
		<pubDate>Tue, 10 Apr 2012 15:32:42 +0000</pubDate>
		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1747#comment-659189</guid>
		<description><![CDATA[I&#039;m not seeing any browser doing the multiplication before the division in that scenario.  As the article you link to explains, division and multiplication have the same precedence (hence the differing mneumonics), as do addition and subtraction.  They&#039;re just evaluated left to right.

In Chrome (Canary), Firefox, and IE 9, this test fiddle (&lt;a href=&quot;http://jsfiddle.net/bdukes/KfL7a/2/&quot; rel=&quot;nofollow&quot;&gt;http://jsfiddle.net/bdukes/KfL7a/2/&lt;/a&gt;) shows the calculation being left to right without inconsistency.

Great to understand the spacing inconsistency, I&#039;m sure that&#039;ll trip up a lot of people (definitely something for CSS minifiers/processors to understand)]]></description>
		<content:encoded><![CDATA[<p>I&#8217;m not seeing any browser doing the multiplication before the division in that scenario.  As the article you link to explains, division and multiplication have the same precedence (hence the differing mneumonics), as do addition and subtraction.  They&#8217;re just evaluated left to right.</p>
<p>In Chrome (Canary), Firefox, and IE 9, this test fiddle (<a href="http://jsfiddle.net/bdukes/KfL7a/2/" rel="nofollow">http://jsfiddle.net/bdukes/KfL7a/2/</a>) shows the calculation being left to right without inconsistency.</p>
<p>Great to understand the spacing inconsistency, I&#8217;m sure that&#8217;ll trip up a lot of people (definitely something for CSS minifiers/processors to understand)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->