<?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>Thoughts From Eric &#187; Tech</title>
	<atom:link href="http://meyerweb.com/eric/thoughts/category/tech/rss2/summary/" rel="self" type="application/rss+xml" />
	<link>http://meyerweb.com/eric/thoughts</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>Thu, 25 Feb 2010 21:15:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Better PDF File Size Reduction in OS X</title>
		<link>http://meyerweb.com/eric/thoughts/2010/02/25/better-pdf-file-size-reduction-in-os-x/</link>
		<comments>http://meyerweb.com/eric/thoughts/2010/02/25/better-pdf-file-size-reduction-in-os-x/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 18:17:15 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Speaking]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1306</guid>
		<description><![CDATA[Being a brief recounting of the successful quest for reduced-size PDFs that don't look awful.]]></description>
			<content:encoded><![CDATA[<p>
One of the things you discover as a speaker and, especially, a conference organizer is this:  <em><a href="http://www.apple.com/iwork/keynote/">Keynote</a> generates really frickin&#8217; enormous PDFs.</em>  Seriously.  Much like Miles O&#8217;Keefe, they&#8217;re <strong>huge</strong>.  We had one speaker last year whose lovingly crafted and beautifully designed 151-slide deck resulted in a 175MB PDF.
</p>
<p>
Now, hard drives and bandwidth may be cheap, but when you have four hundred plus attendees all trying to download the same 175MB PDF at the same time, the venue&#8217;s conference manager <em>will</em> drop by to find out what the bleeding eyestalks your attendees are doing and why it&#8217;s taking down the entire outbound pipe.  Not to mention the network will grind to a nearly complete halt.  Whatever you personally may think of net access at conferences, at this point, not providing net access is roughly akin to not providing functioning bathrooms.
</p>
<p>
So what&#8217;s the answer?  <a href="http://www.panic.com/blog/2010/02/shrinkit-1-0/">ShrinkIt</a> is fine if the slides use lots of vectors and you&#8217;re running Snow Leopard.  If the slides use lots of bitmapped images, or you&#8217;re not on Snow Leopard, ShrinkIt can&#8217;t help you.
</p>
<img src="http://meyerweb.com/pix/2010/quartzfilter-saveas.png" alt="" class="pic"/>
<p>
If the slides are image-heavy, then you can always load the PDF into Preview and then do a &#8220;Save As&#8230;&#8221; where you select the &#8220;Reduce File Size&#8221; Quartz filter.  That will indeed drastically shrink the file size—that 175MB PDF goes down to 13MB—but it can also make the slides look thoroughly awful.  That&#8217;s because the filter achieves its file size reduction by scaling all the images down by at least 50% <em>and</em> to no more than 512 pixels on a side, plus it uses aggressive JPEG compression.  So not only are the images infested with compression artifacts, they also tend to get that lovely up-scaling blur.  Bleah.
</p>
<p>
I Googled around a bit and found &#8220;<a href="http://www.hoboes.com/Mimsy/hacks/quality-reduced-file-size/">Quality reduced file size in Mac OS X Preview</a> from early 2006.  There I discovered that anyone can create their own Quartz filters, which was the key I needed.  Thus armed with knowledge, I set about creating a filter that struck, in my estimation, a reasonable balance between image quality and file size reduction.  And I think I&#8217;ve found it.  That 175MB PDF gets taken down to 34MB with what I created.
</p>
<p>
If you&#8217;d like to experience this size reduction for yourself (and how&#8217;s <em>that</em> for an inversion of common spam tropes?) it&#8217;s pretty simple:
</p>

<ol>
<li>Download and unzip <a href="http://meyerweb.com/eric/tools/mac/quartzfilter-reduce-file-size-75.zip">Reduce File Size (75%)</a>.  Note that the &#8220;75%&#8221; relates to settings in the filter, not the amount of reduction you&#8217;ll get by using it.</li>
<li>Drop the unzipped <tt>.qfilter</tt> file into <tt>~/Library/Filters</tt>.</li>
</ol>

<p>
Done.  The next time you need to reduce the size of a PDF, load it up in Preview, choose &#8220;Save As&#8230;&#8221;, and save it using the Quartz filter you just installed.
</p>
<p>
If you&#8217;re the hands-on type who&#8217;d rather set things up yourself, or you&#8217;re a paranoid type who doesn&#8217;t trust downloading zipped files from sites you don&#8217;t control (and I actually don&#8217;t blame you if you are), then you can manually create your own filter like so:
</p>

<img src="http://meyerweb.com/pix/2010/quartzfilter-reducefilesize.png" alt="" class="pic"/>

<ol>
<li>Go to <tt>/Applications/Utilities</tt> and launch ColorSync Utility.</li>
<li>Select the &#8220;Filters&#8221; icon in the application&#8217;s toolbar.</li>
<li>Find the &#8220;Reduce File Size&#8221; filter and click on the little downward-arrow-in-gray-circle icon to the right.</li>
<li>Choose &#8220;Duplicate Filter&#8221; in the menu.</li>
<li>Use the twisty arrow to open the duplicated filter, then open each of &#8220;Image Sampling&#8221; and &#8220;Image Compression&#8221;.</li>
<li>Under &#8220;Image Sampling&#8221;, set &#8220;Scale&#8221; to <tt>75%</tt> and &#8220;Max&#8221; to <tt>1280</tt>.</li>
<li>Under &#8220;Image Compression&#8221;, move the arrow so it&#8217;s halfway between the rightmost marks.  You&#8217;ll have to eyeball it (unless you bust out <a href="http://iconfactory.com/software/xscope">xScope</a> or a similar tool) but you should be able to get it fairly close to the halfway point.</li>
<li>Rename the filter to whatever will help you remember its purpose.</li>
</ol>

<p>
As you can see from the values, the &#8220;75%&#8221; part of the filter&#8217;s name comes from the fact that two of the filter&#8217;s values are 75%.  In the original Reduce File Size filter, both are at 50%.  The maximum size of images in my version is also quite a bit bigger than the original&#8217;s—1280 versus 512—which means that the file size reductions won&#8217;t be the same as the original.
</p>
<p>
Of course, you now have the knowledge needed to fiddle with the filter to create your own optimal balance of quality and compression, whether you downloaded and installed the zip or set it up manually—either way, ColorSync Utility has what you need.  If anyone comes up with an even better combination of values, I&#8217;d love to hear about it in the comments.  In the meantime, share and enjoy!
</p>
]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2010/02/25/better-pdf-file-size-reduction-in-os-x/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>MIXmasters</title>
		<link>http://meyerweb.com/eric/thoughts/2010/02/24/mixmasters/</link>
		<comments>http://meyerweb.com/eric/thoughts/2010/02/24/mixmasters/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 21:22:46 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Standards]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1299</guid>
		<description><![CDATA[The winners of Microsoft's <a href="http://mix10k.visitmix.com/">MIX 10K Smart Coding Challenge</a> (for which I was happy to <a href="http://meyerweb.com/eric/thoughts/2010/01/22/mix-judging/">serve as one of the judges</a>) have been announced, and the Grand Prize has been awarded to...]]></description>
			<content:encoded><![CDATA[<p>
The winners of Microsoft&#8217;s <a href="http://mix10k.visitmix.com/">MIX 10K Smart Coding Challenge</a> (for which I was <a href="http://meyerweb.com/eric/thoughts/2010/01/22/mix-judging/">honored to serve</a> as <a href="http://live.visitmix.com/News/MIX-10K-Judge-Panel-Announced/">one of the judges</a>) have been announced, and the Grand Prize has been awarded to&#8230;
</p>
<p>
<a href="http://www.jimmyinteractive.com/">Jimmy D</a>&#8217;s <strong><a href="http://mix10k.visitmix.com/Entry/Details/169">Frog Log</a></strong>.
</p>
<p>
Which is an HTML5/CSS/JS entry.
</p>
<p>
That doesn&#8217;t run in Internet Explorer.
</p>
<p>
Yep.
</p>
<p>
Frog Log was my top pick, and obviously did very well with the other judges too, for a good reason: it&#8217;s a fun game.  It doesn&#8217;t play quite the same in Firefox previous to v3.5, as the drag-n-drop doesn&#8217;t work.  Instead, you click on a frog, then click where you want to place it.  I actually found that made the game a touch easier for me, but your interaction may vary.  In addition to working in Firefox, Safari, and Opera, it also runs on a number of mobile devices.
</p>
<p>
Here&#8217;s an excerpt from my judging remarks:
</p>

<blockquote>
<p>
Just a great little game, addictive and well thought out with some interesting gameplay.  I would LOVE to see this developed further by the author&#8230;  My only ding was that drag-n-drop failed in Firefox 3.5; clicking worked fine, though.
</p>
</blockquote>

<p>
I&#8217;m not sure why I had trouble with drag-n-drop in Firefox 3.5, since I don&#8217;t have have the same problem now.  Maybe I got confused with browser version numbers or something.  Regardless, it works fine, it&#8217;s a great game, and remember: it&#8217;s less than 10K unzipped.
</p>
<p>
I also gave high marks to the HTML5 runner-up, Chris Evans&#8217; <a href="http://mix10k.visitmix.com/Entry/Details/188">100pxls</a>, which was the source of <a href="http://twitter.com/meyerweb/status/8725985395">my Dadaist tweet</a> a couple of weeks back and lands right in my personal sweet spot for &#8220;doing odd things with popular web services&#8221;.  Here&#8217;s some of what I had to say in my remarks:
</p>

<blockquote>
<p>
&#8230;really liked the concept here, especially the nonsensical tweets that were generated by drawing your own icon.  The icons could be made easier to see in the main display, but I suppose that&#8217;s a minor quibble.
</p>
</blockquote>

<p>
I&#8217;d like to thank the MIX 10K crew for getting me involved as a contest judge; I really enjoyed seeing what people created and had a hard time narrowing down my votes to just a handful of winners.  More importantly, though, I offer my heartiest congratulations to all the winners, and most especially to Jimmy and Chris for doing such fun, interesting, and downright cool stuff with 10K of web standards goodness!
</p>
]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2010/02/24/mixmasters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inspector Scrutiny</title>
		<link>http://meyerweb.com/eric/thoughts/2010/02/15/inspector-scrutiny/</link>
		<comments>http://meyerweb.com/eric/thoughts/2010/02/15/inspector-scrutiny/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 14:54:23 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Commentary]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1283</guid>
		<description><![CDATA[It's been said that web inspectors—Firebug, Dragonfly, and so forth—are not always entirely accurate.  The real truth is that web inspectors repeat to us the lies they are told, which are the same lies we can be told to our faces.]]></description>
			<content:encoded><![CDATA[<p>
It&#8217;s been <a href="http://meyerweb.com/eric/thoughts/2009/11/03/pseudo-phantoms/">said before</a> that web inspectors—Firebug, Dragonfly, the inspectors in Safari and Chrome, and so forth—are not always entirely accurate.  A less charitable characterization is that they lie to us, but that&#8217;s not exactly right.  The real truth is that web inspectors repeat to us the lies they are told, which are the same lies we can be told to our faces if we ask directly.
</p>
<p>
Here&#8217;s how I know this to be so:
</p>
<pre>
body {font-size: medium;}
</pre>
<p>
Just that.  Apply it to a <a href="http://meyerweb.com/eric/css/tests/medium-font.html">test page</a>.  Inspect the <code>body</code> element in any web inspector you care to fire up.  Have it tell you the computed styles for the <code>body</code> element.  Assuming you haven&#8217;t changed your browser&#8217;s font sizing preferences, the reported value will be <code>16px</code>.
</p>
<p>
You might say that that makes sense, since an unaltered browser equates <code>medium</code> with &#8220;16&#8243;.  But as we saw in &#8220;<a href="http://meyerweb.com/eric/thoughts/2010/02/12/fixed-monospace-sizing/">Fixed Monospace Sizing</a>&#8220;, the <code>16px</code> value is <em>not</em> what is inherited by child elements.  What is inherited is <code>medium</code>, but web inspectors <em>will never show you that</em> as a computed style.  You can see it in the list of declared styles, which so far as I can tell lists &#8220;specific values&#8221; (as per <a href="http://www.w3.org/TR/CSS2/cascade.html#value-stages">section 6.1 of CSS2.1</a>).  When you look to see what&#8217;s actually applied to the element in the &#8220;Computed Styles&#8221; view, you are being misled.
</p>
<p>
We can&#8217;t totally blame the inspectors, because what they list as computed styles is what they are given by the browser.  The inspectors take what the browser returns and prettify it for us, and give us ways to easily alter those values on the fly, but in the end they&#8217;re just DOM inspectors.  They don&#8217;t have a special line into the browser&#8217;s internal data.  Everything they report comes straight from the same DOM that any of us can query.  If you invoke:
</p>
<pre><code>var obj = document.getElementsByTagName('body')[0];
alert(getComputedStyle(obj,null).getPropertyValue('font-size'));</code>
</pre>
<p>
&#8230;on <a href="http://meyerweb.com/eric/css/tests/medium-font.html">a document being given the rule I mentioned above</a>, you will get back <code>16px</code>, not <code>medium</code>.
</p>
<p>
This fact of inspector life was also demonstrated in &#8220;<a href="http://meyerweb.com/eric/thoughts/2010/02/10/rounding-off/">Rounding Off</a>&#8220;.  As we saw there, browsers whose inspectors report integer pixel values also return them when queried directly from the DOM.  This despite the fact that <a href="http://meyerweb.com/eric/css/tests/font-size-rounding.html">it can be conclusively shown</a> that those same browsers are internally storing non-integer values.
</p>
<p>
Yes, it might be possible for an inspector to do its own analysis of properties like <code>font-size</code> by checking the element&#8217;s specified values (which it knows) and then crawling up the document tree to do the same to all of the element&#8217;s ancestors to try to figure out a more accurate computed style.  But what bothers me is that the browser reported computed values that simply aren&#8217;t accurate in the first place.  it seems to me that they&#8217;re really &#8220;actual values&#8221;, not &#8220;computed values&#8221;, again in the sense of <a href="http://www.w3.org/TR/CSS2/cascade.html#value-stages">CSS2.1:6.1</a>.  This makes <code>getComputedStyle()</code> fairly misleading as a method name; it should really be <code>getActualStyle()</code>.
</p>
<p>
No, I don&#8217;t expect the DOM or browsers to change this, which is why it&#8217;s all the more important for us to keep these facts in mind.  Web inspectors are very powerful, useful, and convenient DOM viewers and editors, essentially souped-up interfaces to what we could collect ourselves with JavaScript.  They are thus limited by what they can get the browser to report to them.  There are steps they might take to compensate for known limitations, but that requires them to second-guess both what the browser does now and what it might do in the future.
</p>
<p>
The point, if I may be so bold, is this:  never place all your trust in what a web inspector tells you.  There may be things it cannot tell you because it does not know them, and thus what it does tell you may on occasion mislead or confuse you.  Be wary of what you are told—because even though all of it is correct, not quite all of it is true, and those are always the lies that are easiest to believe.
</p>
]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2010/02/15/inspector-scrutiny/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Fixed Monospace Sizing</title>
		<link>http://meyerweb.com/eric/thoughts/2010/02/12/fixed-monospace-sizing/</link>
		<comments>http://meyerweb.com/eric/thoughts/2010/02/12/fixed-monospace-sizing/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 13:52:36 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1265</guid>
		<description><![CDATA[Monospace text sizing is, from time to time, completely unintuitive and can be quite maddening if you don't look at it in exactly the right way.  Fortunately, there is a pretty simple workaround, and it's one you might want to consider using even if you weren't aware that a problem existed.]]></description>
			<content:encoded><![CDATA[<p>
Monospace text sizing is, from time to time, completely unintuitive and can be quite maddening if you don&#8217;t look at it in exactly the right way.  Fortunately, there is a pretty simple workaround, and it&#8217;s one you might want to consider using even if you weren&#8217;t aware that a problem existed.
</p>
<p>
But first, allow me to lay some foundations.  Assuming no other author styles beyond the ones shown, consider the following:
</p>
<pre>
span {font-family: monospace;}

&lt;p&gt;This is a 'p' with a &lt;span&gt;'span'&lt;/span&gt; inside.&lt;/p&gt;
</pre>

All right, what should be the computed <code>font-size</code> of the <code>span</code> element?  Remember, there are no other author styles being applied.

<p>
The savvier among you will have said: &#8220;It depends, but most likely <code>13px</code>.&#8221;  That&#8217;s because here, the size of the monospace text is controlled by the browser&#8217;s preferences.  The vast majority of users, of course, have never touched their default settings of &#8220;16&#8243; for proportional fonts and &#8220;13&#8243; for monospace/fixed fonts.  For them, then, the answer is <code>13px</code>.  Similarly, if I&#8217;d asked about the <code>p</code> element&#8217;s computed <code>font-size</code>, the answer would be: &#8220;It depends, but most likely <code>16px</code>.&#8221;
</p>
<p>
So let&#8217;s add a bit more and see where we land.
</p>
<pre>
span {font-family: monospace; font-size: 1em;}

&lt;p&gt;This is a 'p' with a &lt;span&gt;'span'&lt;/span&gt; inside.&lt;/p&gt;
</pre>
<p>
As before: bearing in mind that there are no other author styles, what should be the computed <code>font-size</code> of the <code>span</code> element?
</p>
<p>
In this case, building on the previous question and answer, you might say, &#8220;It depends, but most likely <code>16px</code>.&#8221;  The reasoning here is pretty straightforward:  since the computed <code>font-size</code> of the <code>p</code> element is <code>16px</code>, the <code>font-size: 1em;</code> assigned to the <code>span</code> will result in it having the same size.
</p>
<p>
And that&#8217;s true&#8230; in two of five browsers I <a href="http://meyerweb.com/eric/css/tests/monospaced3.html">tested</a>: Opera 10 and Internet Explorer 8.  In the other three I tested&mdash;Firefox 3.6, Safari 4, and Chrome 4&mdash;the computed (and rendered) <code>font-size</code> of the <code>span</code> is <code>13px</code>, the same as in our first example.  This result holds true if the rule is changed to use <code>font: 1em monospace;</code> instead of the two separate properties.  The behavior continues to persist even when adding specific font families, like Courier New, Courier, Andale Mono, and so on to the rule.  It also persists if <code>1em</code> is converted to <code>100%</code>.
</p>
<p>
So in other words, even though I have written CSS that explicitly says &#8220;Make the <code>font-size</code> of this element the same as its parent&#8221;, three of five browsers apparently ignore me.
</p>
<p>
I say &#8220;apparently&#8221; because what&#8217;s happening is that those browsers are allowing the <code>span</code> to inherit the default <code>font-size</code> from its parent (and thus, indirectly, all its ancestors), but the default <code>font-size</code> is <code>medium</code>.  If you go <a href="http://www.w3.org/TR/CSS2/fonts.html#font-size-props">look up <code>medium</code></a>, you find out that it doesn&#8217;t have a defined numeric size. So what those browsers do is equate <code>medium</code> with the preference settings, which means it&#8217;s different for monospace fonts than for everything else.
</p>
<p>
In other words, those three browsers are doing something like this:
</p>
<ol>
<li>This <code>span</code> needs to have the same <code>font-size</code> as its parent element.</li>
<li>The parent&#8217;s <code>font-size</code> is <code>medium</code>, even though when my web inspector (or an author&#8217;s DOM script) asks, I report the <code>16px</code> I used to output the text.  So the <code>span</code>&#8217;s <code>font-size</code> is actually <code>medium</code>.</li>
<li>This <code>medium</code>-sized <code>span</code> is using a monospace font.  The preference setting for monospace is &#8220;13&#8243;, and I equate <code>medium</code> with the preference setting, so I&#8217;ll output the <code>span</code> using 13-pixel text.</li>
</ol>
<p>
Opera 10, as I said, doesn&#8217;t do this, <em>even if your monospace font preference setting is the default value of &#8220;13&#8243;</em> or indeed different from the preference for non-monospace fonts.  And IE8 doesn&#8217;t appear to do it either, although you can&#8217;t set numeric font size preferences in IE8 so what it&#8217;s actually doing is open to interpretation.  Oh, IE8, you inscrutable little scamp, you.
</p>
<p>
All that might seem reasonable enough, but it turns out that&#8217;s not the whole story.  No, the three resizing browsers are being a good deal more &#8220;clever&#8221;, if that&#8217;s actually the word I want, than that.  In fact, what those browsers do makes it seem like they use the two preference settings to create a ratio, and that ratio is used to scale monospace text.  That&#8217;s not actually what&#8217;s happening, but it looks that way at first.  To see what I mean, let&#8217;s consider:
</p>
<pre>
span {font-family: monospace; font-size: 2em;}

&lt;p&gt;This is a 'p' with a &lt;span&gt;'span'&lt;/span&gt; inside.&lt;/p&gt;
</pre>
<p>
Again: in the absence of other author styles, what should be the computed <code>font-size</code> of the <code>span</code> element?
</p>
<p>
The answer: &#8220;It depends, but most likely <code>26px</code> as long as we aren&#8217;t talking about Opera 10 or IE8.  If it is one of those two, then most likely <code>32px</code>.&#8221;  Why?  Because the resizing browsers see the <code>font-size: 2em;</code> declaration as &#8220;twice <code>medium</code>&#8221; and twice 13 is 26.  Opera 10 and IE8, as previously established, don&#8217;t do the resizing.  Or else they simply interpret <code>medium</code> as being equal to the proportional font size preference setting.  Whatever.
</p>
<p>
Okay.  So what all this means is that in many browsers, you can declare that an element&#8217;s font size should be twice the size of its parent&#8217;s and have it actually be 1.625 times the size—or, if you want to look at it another way, 0.8125 times the size you expected it to be.  The 0.8125 comes from 26/32, which of course reduces to 13/16.  If you were to adjust your browser&#8217;s preferences so the monospace setting is &#8220;15&#8243;, then monospace fonts would be 0.9375 (15/16) times the expected size.
</p>
<p>
But—and here&#8217;s where things get <em>really</em> fun—this is not always so.  See, you may not have run into this problem if you&#8217;ve been declaring specific font families with no generic fallback.  Consider this variation (note that I dropped back to <code>1em</code> for the <code>font-size</code>):
</p>
<pre>
span {font-family: "Courier New"; font-size: 1em;}

&lt;p&gt;This is a 'p' with a &lt;span&gt;'span'&lt;/span&gt; inside.&lt;/p&gt;
</pre>
<p>
This time, in every one of the five browsers I mentioned before, assuming the browser defaults, the computed (and rendered) <code>font-size</code> of the <code>span</code> will be <code>16px</code>.  Not <code>13px</code>.  And the only difference is that we switched from a generic font family to a specific one.
</p>
<p>
&#8220;Hey presto!&#8221; you shout.  &#8220;We&#8217;ll just tack the generic family on the end there and be right as rain!&#8221;  Sadly, no.  For if you do this:
</p>
<pre>
span {font-family: "Courier New", monospace; font-size: 1em;}

&lt;p&gt;This is a 'p' with a &lt;span&gt;'span'&lt;/span&gt; inside.&lt;/p&gt;
</pre>
<p>
&#8230;then the answer to the question I keep asking will be:  &#8220;It depends, but given browser defaults it will be <code>16px</code>, unless we&#8217;re talking about Safari.  In that case, it&#8217;s <code>13px</code>.&#8221;
</p>
<p>
Really.  Alone among the browsers I tested, Safari goes back to doing the resizing when you provide a generic fallback to your specific family.  Or even multiple families.  Do your best to make sure the user at least gets a fixed-width font, and you get a size smaller than you&#8217;d intended.  (You can get the back story on this in <a href="http://webkit.org/blog/67/strange-medium/">a late-2006 post on the Surfin&#8217; Safari blog</a>.)
</p>
<p>
So what do we do?  Get creative.  That&#8217;s what the <a href="http://www.w3.org/WAI/PF/aria/"><acronym title="Accessible Rich Internet Applications">ARIA</acronym></a> folks did in <a href="http://www.w3.org/WAI/PF/aria/spec.css">their specification&#8217;s style sheet</a>, where they declare two font stacks: the first with a generic fallback, and the second without it.  That works, but it&#8217;s ugly.  I didn&#8217;t like that at all.  And then, halfway through writing up this post, a fix came to me like a shot in the dark.  Check this out:
</p>
<pre>
span {font-family: "Courier New", monospace, serif; font-size: 1em;}

&lt;p&gt;This is a 'p' with a &lt;span&gt;'span'&lt;/span&gt; inside.&lt;/p&gt;
</pre>
<p>
This time around, the answer is:  &#8220;It depends, but given browser defaults, <code>16px</code>.&#8221;
</p>
<p>
Really!  Even in Safari!  And in all tested browsers, it falls back to a generic monospace font at the requested size even if the specific family (or families) we declare aren&#8217;t available!  This can be verified by altering the specific font family to something that doesn&#8217;t actually exist:
</p>
<pre>
span {font-family: "Corier Neu", monospace, serif; font-size: 1em;}

&lt;p&gt;This is a 'p' with a &lt;span&gt;'span'&lt;/span&gt; inside.&lt;/p&gt;
</pre>
<p>
Monospacey goodness at the intended, parent-matching size.  It&#8217;s enough to make a body believe in monotheism.
</p>
<p>
Since I generally assume that anything I devise was already invented by someone else, I went Googling for prior art.  And wouldn&#8217;t you know it, the Wikipedia folks <a href="http://en.wikipedia.org/wiki/User:Davidgothberg/Test59">had worked it out around the end of last year</a>.  This, of course, supports my contention that <a href="http://www.youtube.com/watch?v=4sAIZlRMeEg">Wikipedia is the new Steve Allen</a>.  I also found some claims that ending the font stack with <code>monospace, monospace</code> would have the same effect, but that wasn&#8217;t borne out in <a href="http://meyerweb.com/eric/css/tests/monospaced3.html">my testing</a>.  Perhaps it worked in older versions of browsers but no longer does.
</p>
<p>
I did leave out another way to make monospaced fonts behave as expected, which you may have already figured out from the preceding: declare the <code>font-size</code> for any parent of a monospaced element to be a length value, along the lines of <code>body {font-size: 12px;}</code>.  That will pass the length value down the document tree to the monospaced element via inheritance, which will use it without resizing it in every browser I tested.  Though you may have heard that page zooming makes pixel-sized text okay, I&#8217;m not really convinced.  Not yet.  There are too many people who don&#8217;t know how to zoom, and too many whose browsers aren&#8217;t advanced enough to zoom pages.  Even in page-zooming browsers, there are problems with pixel text.  So I&#8217;m still on the ems-and-percentages bandwagon.
</p>
<p>
In fact, there are a fair number of details and extra browser oddities that I left out of this, as it&#8217;s already way more than long enough, and besides you don&#8217;t really want to hear the gory details of manually stepping through 37 different preferences settings just to verify a theory.  Plus you already heard about <a href="http://meyerweb.com/eric/thoughts/2010/02/10/rounding-off/">the <code>font-size</code> rounding investigation</a> that spawned off of this one, about halfway through.  I think that&#8217;s more than enough for the time being.
</p>
<p>
I should also lay down a caveat: it&#8217;s possible that this behavior will be interpreted as a bug by the Safari team and &#8220;fixed&#8221;, if that&#8217;s the word I want, in a future release.  I really hope not—and if they&#8217;re looking for ways to improve how they handle monospace font sizing, I have a few suggestions—but it is possible.  Adjust your expectations accordingly.
</p>
<p>
And with that, I&#8217;m going to stop now.  I hope this will be useful to you, either now or in the future.
</p>
]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2010/02/12/fixed-monospace-sizing/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Rounding Off</title>
		<link>http://meyerweb.com/eric/thoughts/2010/02/10/rounding-off/</link>
		<comments>http://meyerweb.com/eric/thoughts/2010/02/10/rounding-off/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 18:42:44 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1253</guid>
		<description><![CDATA[In the course of digging into the guts of a much more complicated problem, I stumbled into an interesting philosophical question posed by web inspection tools.]]></description>
			<content:encoded><![CDATA[<p>
In the course of digging into the guts of a much more complicated problem, I stumbled into an interesting philosophical question posed by web inspection tools.
</p>
<p>
Consider the following CSS and HTML:
</p>
<pre>
p {font-size: 10px;}
b {font-size: 1.04em;}

&lt;p&gt;This is text &lt;b&gt;with some boldfacing&lt;/b&gt;.&lt;/p&gt;
</pre>
<p>
Simple enough.  Now, what is the computed <code>font-size</code> for the <code>b</code> element?
</p>
<p>
There are two valid answers.  Most likely one of them is intuitively obvious to you, but take a moment to contemplate the rationale for the answer you didn&#8217;t pick.
</p>
<p>
Now, consider the ramifications of both choices on a situation where there are <code>b</code> elements nested ten layers deep.
</p>
<p>
If you hold that the answer is <code>10px</code>, then the computed <code>font-size</code> of the tenth level of nesting should still be <code>10px</code>, because at every level of nesting the mathematical answer will be rounded down to 10.  That is: for every <code>b</code> element, its computed <code>font-size</code> will be <code>round(10*1.04)</code>, which will always yield 10.
</p>
<p>
If, on the other hand, you hold that the answer is <code>10.4px</code>, then the computed <code>font-size</code> of the tenth level of nesting should be <code>14.802442849px</code>.  That might get rounded to some smaller number of decimal places, but even so, the number should be pretty close to 14.8.
</p>
<p>
The simplest test, of course, is to <a href="http://meyerweb.com/eric/css/tests/font-size-rounding.html">set up a ten-level-deep nesting of <code>b</code> elements with the previously-shown CSS and find out what happens</a>.  If the whole line of text is the same size, then browsers round their computed <code>font-size</code> values before passing them on.  If the text swells in size as the nesting gets deeper, then they don&#8217;t.
</p>
<p>
As it happens, in all the browsers I&#8217;ve tested, the text swells, so browsers are passing along fractional pixel values from level to level.  That&#8217;s not the interesting philosophical question.  Instead, it is this:  <em>do web inspectors that show integer <code>font-size</code> values in their &#8216;computed style&#8217; windows lie to us?</em>
</p>
<p>
To see what I mean, load up <a href="http://meyerweb.com/eric/css/tests/font-size-rounding.html">the font size rounding test page</a> in Firefox and use Firebug to inspect the &#8220;1(&#8220;, which is the first of the <code>b</code> elements, in the first (1.04em) test case.  Make sure you&#8217;re looking at the &#8220;Computed Styles&#8221; pane in Firebug, and you&#8217;ll get a computed <code>font-size</code> of <code>10.4px</code>.  That makes sense: it&#8217;s 10 × 1.04.
</p>
<p>
Now try the inspecting that same &#8220;1(&#8221; in Safari or Opera.  Both browsers will tell you that the computed <code>font-size</code> of that <code>b</code> element is <code>10px</code>.  But we already know that it&#8217;s actually <code>10.4px</code>, because the more deeply-nested layers of <code>b</code> elements increase in size.  These inspectors are rounding off the internal number before showing it to us.  Arguably, they are lying to us.
</p>
<p>
But are they really?  The reason to doubt this conclusion is that the values shown in those inspectors accurately reflect the value being used to render the characters on-screen.  To see what I mean, look at the last example on the test page, where there&#8217;s sub-pixel size testing.  The &#8220;O&#8221; characters run from a flat 10 pixels to a flat 11 pixels in tenths (or less) of a pixel, all of their <code>font-size</code>s assigned with inline <code>style</code> elements to pin the characters down as much as possible.  In Safari, you can see the size jump up one pixel right around the text&#8217;s midpoint, where I wrote <code>font-size: 10.5px</code>.  So everything from <code>10px</code> to <code>10.49px</code> gets drawn at 10 pixels tall; everything from <code>10.5px</code> to <code>11px</code> is 11 pixels tall.  Safari&#8217;s inspector reflects this accurately.  It&#8217;s telling you the size used to draw the text.
</p>
<img src="http://meyerweb.com/pix/2010/OOOOO.png" alt="A comparative illustration of the many-O test case in three different browsers showing three different results.  The browsers used to create the illustration were Safari, Opera, and Firefox." class="pic border" />
<p>
In Opera 10.10, you get the same thing except that the jump from 10 to 11 pixels happens on the very last &#8220;O&#8221;, both visually and in the inspector (Dragonfly).  That means that when it comes to font sizes, Opera <em>always rounds down</em>.  Everything from <code>10px</code> to <code>10.9px</code>—and, presumably, <code>10.99999px</code> for as many nines as you&#8217;d care to add—will be drawn 10 pixels tall.  Brilliant.
</p>
<p>
In Firefox for OS X, there&#8217;s no size jump.  The &#8220;O&#8221; characters look like they form a smooth line of same-size text.  In fact, they&#8217;re all being drawn subtly differently, thanks to their subtly different <code>font-size</code> values.  If you use OS X&#8217;s Universal Access screen zooming to zoom way, way in, you can see the differences in pixel shading from one &#8220;O&#8221; to the next.  Even if you don&#8217;t, though, the fact that it&#8217;s hard to tell that there is an increase in size from one end of the line to the other is evidence enough.
</p>
<p>
In Firefox for XP, on the other hand, the size jump occurs just as it does in Safari, going from 10 pixels to 11 pixels of text size at the 10.5 mark.  But Firebug still reports the correct computed <code>font-size</code> values.  Thus, its reported value doesn&#8217;t match the size of the text that&#8217;s been output to the screen.  Arguably, it&#8217;s lying just as much as Safari and Opera,  in a different way.
</p>
<p>
But, again: is it really?  The computed values are being accurately reported.  That there is a small variance between that fractional number and the display of the text is arguably irrelevant, and can lead to its own confusion.  Situations will arise where apparent rounding errors have occurred—I see people complain about them from time to time—when the apparent error is really an artifact of how information is delivered.
</p>
<p>
I have my own thoughts about all this, but I&#8217;m much more interested in the thoughts of others.  <strong>What do you think?</strong>  Should web inspectors report the CSS computed values accurately, without regard to the actual rendering effects; or should the inspectors modify the reported values to more accurately reflect the visual rendering, thus obscuring the raw computed values?
</p>

<p>
<strong>Addendum 10 Feb 10:</strong> I&#8217;ve updated the test page with a JS link that will dynamically insert the results of <code>getComputedStyle(el,null).getPropertyValue("font-size")</code> into the test cases.  The results are completely consistent with what the inspectors report in each browser.  This tells us something about the inspectors that most of us probably don&#8217;t consciously realize: that what they show us rests directly on the same JS/DOM calls we could write ourselves.  In other words, inspectors are not privileged in what they can &#8220;see&#8221;; they have no special view into the browser&#8217;s guts.  Thus another way to look at this topic is that inspectors simply repeat the lies that browsers tell the world.
</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2010/02/10/rounding-off/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>Events and A Day, Belatedly</title>
		<link>http://meyerweb.com/eric/thoughts/2010/02/08/events-and-a-day-belatedly/</link>
		<comments>http://meyerweb.com/eric/thoughts/2010/02/08/events-and-a-day-belatedly/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 15:29:11 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[An Event Apart]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1247</guid>
		<description><![CDATA[In which I talk about the 2010 schedule for An Event Apart, including a very special Day Apart.]]></description>
			<content:encoded><![CDATA[<p>
I&#8217;m a bad conference organizer.
</p>
<p>
Why?  Because we opened the <a href="http://aneventapart.com/">An Event Apart</a> 2010 schedule <a href="http://store.aneventapart.com/">for sales</a> back in, um, flippin&#8217; <em>November</em>, and I never mentioned it here.  Cripes, I never even posted when we announced the lineup of cities.  I could go through the great big long sob-story list of reasons why 2009 was really tough and blah blah blah, but when you get right down to it, I fell down on my job.
</p>
<p>
Okay.  So.  Time to correct that.
</p>
<p>
<small><i>(deep breath)</i></small>
</p>
<p>
Hey everyone, check it out: the complete tour schedule for An Event Apart 2010!  Woohoooo!
</p>

<ol>
<li><strong><a href="http://aneventapart.com/2010/seattle/">Seattle</a></strong>: April 5-7, 2010 (yes, <em>three</em> days; more on that anon)</li>
<li><strong><a href="http://aneventapart.com/2010/boston/">Boston</a></strong>: May 24-25, 2010</li>
<li><strong><a href="http://aneventapart.com/2010/minneapolis/">Minneapolis</a></strong>: July 26-27, 2010</li>
<li><strong><a href="http://aneventapart.com/2010/dc/">Washington, DC</a></strong>: September 16-17, 2010</li>
<li><strong><a href="http://aneventapart.com/2010/sandiego/">San Diego</a></strong>: November 1-2, 2010</li>
</ol>

<p>
We&#8217;ve got a pretty killer lineup, if I do say so myself.  You can get the mostly-complete list from <a href="http://aneventapart.com/news/2009/11/03/registration-is-now-open-for-2010/">our opening-of-sales announcement last November</a>.  It lists the people we had confirmed at the time; there have been a few additions since then.  Check out your city of choice to see who&#8217;s going to be there!  (But always remember that speaker lineups are subject to change: speakers are people too, and life has a way of interfering with schedules.  I myself had to withdraw from An Event Apart Boston last year due to a family emergency.)
</p>
<p>
The price to register for these two-day, one-track Events is the same as it was in 2009, and there are <a href="http://aneventapart.com/about/">educational and group discounts available</a> for those who are interested.
</p>
<p>
But wait, I just said &#8220;two-day&#8221; when the first show of the year is clearly <em>three</em> days.  What gives?
</p>
<p>
Seattle is the site of our first-ever <strong>A Day Apart</strong>, a full-day workshop that can be attended on its own or as part of a full three days of Event Apart ecstasy.  And the inaugural Day Apart will be nothing less than a detailed plunge into HTML 5 and CSS3 with Jeremy Keith and Dan Cederholm.  Jeremy handles the markup; Dan gets stylish.  It&#8217;s going to be fantastic.  I&#8217;m going to be in the back of the room for the whole day, soaking up as much as I can.
</p>
<p>
If you want to <a href="https://store.aneventapart.com/#seattle-2010">attend just the workshop</a>, it&#8217;s $399 for the whole day if you buy an early bird ticket (available through March 5th).  The price goes up $50 when early bird ends, and another $100 if you show up at the door.  But I wouldn&#8217;t recommend that last, because I don&#8217;t think there will be any tickets available at the door.  Again: if you show up unannounced on the day of the workshop and ask to buy a ticket, we will most likely have to turn you away, because I expect that there won&#8217;t be any seats available.
</p>
<p>
On the other hand, maybe you&#8217;d like to experience more than just one day of AEA goodness.  Maybe you&#8217;d like to go whole hog and <a href="https://store.aneventapart.com/#seattle-2010">attend both the two-day Event Apart and the subsequent Day Apart</a>, soaking up all the knowledge and enthusiasm and camaraderie that typifies An Event Apart.  And who could blame you?  If you do <em>that</em>, then the total early bird price for all three days is $1,190, whereas buying the event and workshop passes separately would total $1,294.  That&#8217;s right: you actually get slightly more than $100 off the cost of the workshop if you attend all three days, over and above the early bird discount.  (Or you can think of it as getting $100+ off the cost of the conference.  We&#8217;re not fussy.)
</p>
<p>
As it happens, these three-day passes have proved quite popular.  So if you want to get your hands on one of those—or on any Seattle tickets, whether one, two, or three days—I wouldn&#8217;t wait too long.  Our internal analyses suggest that there will come a time, some time before the doors open on April 5th, that the ability to buy a ticket will cease to be.  It may even pine for a fjord or two.
</p>
<p>
As for the four shows that come after Seattle, well, they&#8217;re looking pretty popular too.
</p>
<p>
I know I say this every year, but I&#8217;m really excited about what we&#8217;ve got planned for the year.  Jeffrey and I constantly and (we hope) consistently strive to create an event that we ourselves want to attend, and that&#8217;s absolutely true of the shows and workshop we have planned in 2010.  I can&#8217;t wait to hear what the speakers and attendees have to share.  Hope to see you there!
</p>
]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2010/02/08/events-and-a-day-belatedly/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>MIX Judging</title>
		<link>http://meyerweb.com/eric/thoughts/2010/01/22/mix-judging/</link>
		<comments>http://meyerweb.com/eric/thoughts/2010/01/22/mix-judging/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 20:50:25 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[(X)HTML]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1242</guid>
		<description><![CDATA[MIX is having a 10K contest, HTML 5 is one of the allowed formats, and I'm a contest judge.]]></description>
			<content:encoded><![CDATA[<p>
I was recently honored to be asked to be a judge for the <a href="http://mix10k.visitmix.com/">MIX 10k Smart Coding Challenge</a>, running in conjunction with Microsoft&#8217;s <a href="http://visitmix.com/">MIX conference</a>.  The idea is to create a really great web application that totals no more than 10KB in its unzipped state.
</p>
<p>
Why did I agree to participate?  As much as I&#8217;d like to say &#8220;<a href="http://www.penny-arcade.com/comic/2000/10/23/">fat sacks of cash</a>&#8220;, that wasn&#8217;t it at all.  (Mostly due to the distinct lack of cash, sacked or otherwise.  Sad face.)  The <a href="http://mix10k.visitmix.com/Terms#4">contest&#8217;s entry requirements</a> actually say it for me.  In excerpted form:
</p>

<ul>
<li>The entry MUST use one or more of the following technologies: Silverlight, Gestalt or HTML5&#8230;</li>
<li>The entry MUST function in 3 or more of the following browsers: Internet Explorer, Firefox, Safari, Opera, or Chrome&#8230;</li>
<li>The entry MAY use any of the following additional technology components&#8230;
<ul>
<li>CSS</li>
<li>JavaScript</li>
<li>XAML/XML</li>
<li>Ruby</li>
<li>Python</li>
<li>Text, Zip and Image files (e.g. png, jpg or gif)</li>
</ul>
</li>
</ul>

<p>
Dig that:  not only is the contest open to HTML 5 submissions, but it has to be cross-browser compatible.  Okay, technically it only has to be three-out-of-five compatible, but still, that&#8217;s a great contest requirement.  Also note that while IE is one of the five, it is not a <em>required</em> one of the five.
</p>
<p>
I imagine there will be a fair number of Silverlight and Gestalt entries, and I might look at them, but I&#8217;m really there—was really asked—because of the HTML 5 entries.  By which I mean the open web entries, since any HTML 5 entry is also going to use CSS, JavaScript, and so on.
</p>
<p>
The downside here is that the contest ends in just one week, at 3pm U.S. Pacific time on 29 January.  I know that time is tight, but if you&#8217;ve got a cool HTML 5-based application running around in your head, this just might be the time to let it out.
</p>
]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2010/01/22/mix-judging/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Correcting Corrupted Characters</title>
		<link>http://meyerweb.com/eric/thoughts/2009/11/19/correcting-corrupted-characters/</link>
		<comments>http://meyerweb.com/eric/thoughts/2009/11/19/correcting-corrupted-characters/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 14:12:10 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1214</guid>
		<description><![CDATA[At some point, for some reason, all my UTF-8 characters in WordPress got mangled into ISO-8859-1 equivalents.  I need help figuring out a way to change them all back.]]></description>
			<content:encoded><![CDATA[<p>
At some point, for some reason I cannot quite fathom, a WordPress or PHP or mySQL or some other upgrade took all of my WordPress database&#8217;s UTF-8 and translated it to (I believe) ISO-8859-1 and then dumped the result back right back into the database.  So <a href="http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/#comment-438043">&#8220;Emil Björklund&#8221; became &#8220;Emil Bj&Atilde;&para;rklund&#8221;</a>.  <del datetime="2009-11-19T22:00:09+00:00">(If those looked the same to you, then I see &#8220;B&Atilde;&para;rklund&#8221; for the second one, and you should tell me which browser and OS you&#8217;re using in the comments</del>.)  This happened all throughout the WordPress database, including to commonly-used characters like &#8217;smart&#8217; quotes, both single and double; em and en dashes; ellipses; and so on.  It also apparently happened in all the DB fields, so not only were posts and comments affected, but commenters&#8217; names as well (for example).
</p>
<p>
And I&#8217;m pretty sure this isn&#8217;t just a case of the correct characters lurking in the DB and being downsampled on their way to me, as I have WordPress configured to use UTF-8, the site&#8217;s <code>head</code> contains a <code>meta</code> that declares UTF-8, and a peek at the HTTP response headers shows that I&#8217;m serving UTF-8.  Of course, I&#8217;m not really expert at this, so it&#8217;s possible that I&#8217;ve misunderstood or misinterpreted, well, just about anything.  To be honest, I find it deeply objectionable that this kind of stuff is still a problem here on the eve of 2010, and in general, enduring the effluvia of erroneous encoding makes my temples throb in a distinctly unhealthy fashion.
</p>
<p>
Anyway.  Moving on.
</p>
<p>
I found <a href="http://wordpress.org/extend/plugins/search-and-replace/">a search-and-replace plugin</a>&#8212;ironically enough, one written by a person whose name contains a character that would currently be corrupted in my database&#8212;that lets me fix the errors I know about, one at a time.  But it&#8217;s a sure bet there are going to be tons of these things littered all over the place and I&#8217;m not likely to find them all, let alone be able to fix them all by hand, one find-and-replace at a time.
</p>
<p>
What I need is a WordPress plugin or something that will find the erroneous character strings in various fields and turn them back into good old UTF-8.  Failing that, I need a good table that shows the ISO-8859-1 equivalents of as many UTF-8 characters as possible, or else a way to generate that table for myself.  With that table in hand, I at least have a chance of writing a plugin to go through and undo the mess.  I might even have it monitor the DB to see if it happens again, and give me a big &#8220;Clean up!&#8221; button if it does.
</p>
<p>
So: anyone got some pointers they could share, information that might help, even code that might make the whole thing go away?
</p>
]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2009/11/19/correcting-corrupted-characters/feed/</wfw:commentRss>
		<slash:comments>71</slash:comments>
		</item>
		<item>
		<title>Pseudo-Phantoms</title>
		<link>http://meyerweb.com/eric/thoughts/2009/11/03/pseudo-phantoms/</link>
		<comments>http://meyerweb.com/eric/thoughts/2009/11/03/pseudo-phantoms/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 17:41:10 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1180</guid>
		<description><![CDATA[
In the course of a recent debugging session, I discovered a limitation of web inspectors (Firebug, Dragonfly, Safari&#8217;s Web Inspector, et al.) that I hadn&#8217;t quite grasped before: they don&#8217;t show pseudo-elements and they&#8217;re not so great with pseudo-classes.  There&#8217;s one semi-exception to this rule, which is Internet Explorer 8&#8217;s built-in Developer Tool.  [...]]]></description>
			<content:encoded><![CDATA[<p>
In the course of a recent debugging session, I discovered a limitation of web inspectors (Firebug, Dragonfly, Safari&#8217;s Web Inspector, et al.) that I hadn&#8217;t quite grasped before: they don&#8217;t show pseudo-elements and they&#8217;re not so great with pseudo-classes.  There&#8217;s one semi-exception to this rule, which is Internet Explorer 8&#8217;s built-in Developer Tool.  It shows pseudo-elements just fine.
</p>
<p>
Here&#8217;s an example of what I&#8217;m talking about:
</p>

<pre><code>p::after {content: " -\2761-"; font-size: smaller;}
</code></pre>

<p>
Drop that style into any document that has paragraphs.  Load it up in your favorite development browser.  Now inspect a paragraph.  You will not see the generated content in the DOM view, and you won&#8217;t see the pseudo-element rule in the Styles tab (except in IE, where you get the latter, though not the former).
</p>

<a href="http://www.flickr.com/photos/meyerweb/4071955467/"><img src="http://meyerweb.com/pix/2009/firebug-crop.png" class="pic border" alt="" /></a>

<p>
The problem isn&#8217;t that I used an escaped Unicode reference; take that out and you&#8217;ll still see the same results, as on <a href="http://meyerweb.com/eric/css/tests/pseudos-inspector-test.html">the test page I threw together</a>.  It isn&#8217;t the double-colon syntax, either, which all modern browsers handle just fine; and anyway, I can take it back to a single colon and still see the same results.  <code>::first-letter</code>, <code>::first-line</code>, <code>::before</code>, and <code>::after</code> are all basically invisible in most inspectors.
</p>
<p>
This can be a problem when developing, especially in cases such as having a forgotten, runaway <a href="http://www.positioniseverything.net/easyclearing.html">generated-content clearfix</a> making hash of the layout.  No matter how many times you inspect the elements that are behaving strangely, you aren&#8217;t going to see anything in the inspector that tells you why the weirdness is happening.
</p>
<p>
The same is largely true for dynamic pseudo-classes.  If you style all five link states, only two will show up in most inspectors&#8212;either <code>:link</code> or <code>:visited</code>, depending on whether you&#8217;ve visited the link&#8217;s target; and <code>:focus</code>.  (You can sometimes also get <code>:hover</code> in Dragonfly, though I&#8217;ve not been able to do so reliably.  IE8&#8217;s Developer Tool always shows <code>a:link</code> even when the link is visited, and doesn&#8217;t appear to show any other link states.  &#8230;yes, this is getting complicated.)
</p>
<p>
The more static pseudo-classes, like <code>:first-child</code>, do show up pretty well across the board (except in IE, which doesn&#8217;t support all the advanced static pseudo-classes; e.g., <code>:last-child</code>).
</p>

<a href="http://www.flickr.com/photos/meyerweb/4072718108/"><img src="http://meyerweb.com/pix/2009/iedevtool-crop.png" class="pic border" alt="" /></a>

<p>
I can appreciate that inspectors face an interesting challenge here.  Pseudo-elements are just that, and aren&#8217;t part of the actual structure.  And yet Internet Explorer&#8217;s Developer Tool manages to find those rules and display them without any fuss, even if it doesn&#8217;t show generated content in its DOM view.  Some inspectors do better than others with dynamic pseudo-classes, but the fact remains that you basically can&#8217;t see some of them even though they will potentially apply to the inspected link at some point.
</p>
<p>
I&#8217;d be very interested to know what inspector teams encountered in trying to solve this problem, or if they&#8217;ve never tried.  I&#8217;d be <em>especially</em> interested to know why IE shows pseudo-elements when the others don&#8217;t&#8212;is it made simple by their rendering engine&#8217;s internals, or did someone on the Developer Tool team go to the extra effort of special-casing those rules?
</p>
<p>
For me, however, the overriding question is this: what will it take for the various inspectors to behave more like IE&#8217;s does, and show pseudo-element and pseudo-class rules that are associated with the element currently being inspected?  And as a bonus, to get them to show in the DOM view where the pseudo-elements actually live, so to speak?
</p>
<p>
<small>(<strong>Addendum:</strong> when I talk about IE and the Developer Tool in this post, I mean the tool built into IE8.  I did not test the Developer Toolbar that was available for IE6 and IE7.  Thanks to <a href="http://www.bogglethemind.com/">Jeff L</a> for pointing out the need to be clear about that.)</small>
</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2009/11/03/pseudo-phantoms/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>HTML5 And You</title>
		<link>http://meyerweb.com/eric/thoughts/2009/09/07/html5-and-you/</link>
		<comments>http://meyerweb.com/eric/thoughts/2009/09/07/html5-and-you/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 13:42:24 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[(X)HTML]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/?p=1153</guid>
		<description><![CDATA[Here's the thing about the HTML5 specification that might not be obvious right away:  it's not for you.  It's for implementors.  And that's a good thing.
]]></description>
			<content:encoded><![CDATA[<p>
I mentioned in <a href="http://meyerweb.com/eric/thoughts/2009/09/02/nine-into-five/">my previous post</a> that I &#8220;had come away with my head reeling from the massive length and depth of the often-changing specification&#8221;, which is entirely true.  Printouts of the current draft of the HTML5 spec can reach, depending on your operating system and installed fonts, somewhere north of 900 pages.  Yes: <em>nine hundred</em>.  There are unabridged Stephen King novels that run shorter.
</p>
<p>
You might well say to yourself: &#8220;Self, is it just me, or are the people doing this completely off their everlovin&#8217; rockers?  Because the specification for something as fundamentally simple as HTML should reach maybe 200 pages, max.&#8221;  You might even despair that the entire enterprise is doomed to failure precisely because nobody sane will ever sit down to read that entire doorstop.
</p>
<p>
But there&#8217;s no real reason to panic, because here&#8217;s the thing about the HTML5 specification that might not be obvious right away:  <a href="http://www.penny-arcade.com/comic/2004/3/24/">it&#8217;s not <em>for</em> you</a>.  It&#8217;s for implementors.  And that&#8217;s a good thing.
</p>
<p>
If you do start reading the HTML5 draft, you&#8217;ll start running into really lengthy, excruciatingly detailed algorithms for, say, <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#parse-a-time-component">parsing a time component</a>.  Or <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#history-traversal">moving through the browser&#8217;s history</a>.  Or <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#form-submission-algorithm">submitting a form</a>.  There&#8217;s an entire (long) <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/syntax.html">chapter on how to process the HTML syntax</a>.
</p>
<p>
Those are all good things, actually.  They greatly increase the chances of interoperability actually happening within our lifetimes.  There&#8217;s no guessing about, well, much of anything.  It&#8217;s all been exactingly defined, to the extent that one can exactingly define anything using a human language.  A browser team doesn&#8217;t have to wonder, or even guess, <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/syntax.html#the-end">what to do when the document has been completely parsed</a>.  It&#8217;s all spelled out.  And the people on those browser teams will, in the end, be the people who read that entire doorstop.  (Their sanity is another matter, and not discussed here.)
</p>
<p>
How is all that stuff relevant to you, the author?  In the sense that when browser teams follow the spec, their products will be interoperable, which is to say consistent.  (Just imagine that for a moment.)
</p>
<p>
Beyond that, though, the detailed implementation stuff <em>isn&#8217;t</em> relevant to you.  You are not expected to know all those algorithms in order to write HTML documents.  Pretty much all you need to know is the markup.  That&#8217;s the part that should be no more than 200 pages, yeah?
</p>
<p>
Turns out it is, and by a comfortable margin.  Michael(tm) Smith&#8217;s <a href="http://dev.w3.org/html5/markup/spec.html">HTML5: The Markup Language</a> is a version of the HTML5 draft with all of those eye-wateringly pedantic implementor sections stripped out, and when I generated a PDF it came in at 147 pages.  <em>That&#8217;s</em> what you really need in order to get up to speed on what&#8217;s in HTML5.  It&#8217;s <em>for</em> you.
</p>
]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2009/09/07/html5-and-you/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Nine Into Five</title>
		<link>http://meyerweb.com/eric/thoughts/2009/09/02/nine-into-five/</link>
		<comments>http://meyerweb.com/eric/thoughts/2009/09/02/nine-into-five/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 16:10:44 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[(X)HTML]]></category>
		<category><![CDATA[Commentary]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/?p=1149</guid>
		<description><![CDATA[Like so many others, I had tried to dig into the meat of HTML5 and figure out just what the heck was going on.  Like so many others, I had come away with my head reeling from the massive length and depth of the often-changing specification, unsure of the real meaning of much of what I had read.  And like so many others, I had gone to read the commentary surrounding HTML5 and come away deeply dispirited by the confusion, cross-claims, and rancor I found.  Then I received an invitation to join a small, in-person gathering of like-minded people, many of them just as confused and dispirited as I, to turn our collective focus to the situation and see what we found.  I already had plans for the meeting's scheduled dates.  I altered the plans.]]></description>
			<content:encoded><![CDATA[<p>
Like so many others, I had tried to dig into the meat of <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/">HTML5</a> and figure out just what the heck was going on.  Like so many others, I had come away with my head reeling from the massive length and depth of the often-changing specification, unsure of the real meaning of much of what I had read.  And like so many others, I had gone to read the commentary surrounding HTML5 and come away deeply dispirited by the confusion, cross-claims, and rancor I found.
</p>
<p>
Then I received an invitation to join <a href="http://www.flickr.com/photos/zeldman/sets/72157622014232906/">a small, in-person gathering</a> of like-minded people, many of them just as confused and dispirited as I, to turn our collective focus to the situation and see what we found.  I already had plans for the meeting&#8217;s scheduled dates.  I altered the plans.
</p>
<p>
Over two long days, we poked and prodded and pounded on the HTML5 specification&#8212;doing our best to figure out what was meant by, and what would result from, this phrase or that example; trying to reconcile seemingly arbitrary design choices with what we knew of the web and its history and the stated goals of the HTML5 specification; puzzling over the implications of example code and detailed algorithms and non-normative notes.
</p>
<p>
In the end, we came away with a better understanding of what&#8217;s going on, and out of that arose <a href="http://www.zeldman.com/superfriends/guide/">some concerns and suggestions</a>.  But in the main, we felt much better about what&#8217;s going on in HTML5, and have now <a href="http://www.zeldman.com/superfriends/">said so publicly</a>.
</p>
<p>
Personally, there are two markup changes I&#8217;d like most to see:
</p>

<ol>
<li>
<p>
<strong>The content model of <code>footer</code> should match that of <code>header</code>.</strong>
As others have said, the English-language name of the <code>footer</code> element creates expectations about what it is and how it should work.  As the spec now stands, most of those expectations will be wrong.  To wit: if your page&#8217;s footer includes navigation links, and especially if you have an HTML5-structured &#8220;<a href="http://ui-patterns.com/pattern/FatFooter">fat footer</a>&#8220;, you can&#8217;t use <code>footer</code> to contain it.
</p>
<p>
If this feels a little familiar, it should: the same problem happened with <code>address</code>, which was specified to mean only the contact information for the author of a page.  It was quite explicitly specified to <em>not</em> accept mailing addresses.  Of course, tons of people did just that, because they had an address and there was an <code>address</code> element, so of course they went together!
</p>
<p>
A lot of us cringed every time this came up in the last ten years of conducting training, because it meant we&#8217;d have to spend a few minutes explaining that the meaning of the element&#8217;s name clashed with its technical design.  We saw a lot of furrowed brows, rolled eyes, and derisively shaken heads.  That will be magnified a millionfold with <code>footer</code> if things are allowed to stand as they are.
</p>
<p>
As I said, the fix is simple: just change the content model of <code>footer</code> to state:
</p>
<blockquote><p>Flow content, but with no header or footer element descendants.</p></blockquote>
<p>
That&#8217;s exactly the same content model as <code>header</code>, and for the same reasons.
</p>
</li>
<li>
<p>
<strong><code>time</code> needs to be less restrictive.</strong>  That&#8217;s not very precise, I know.  But as things stand now, you can only apply <code>time</code> to Gregorian datetimes, and you&#8217;re not supposed to use it for anything that couldn&#8217;t be easily represented in a calendaring program.  The HTML5 specification says:
</p>
<blockquote><p>The time element is not intended for encoding times for which a precise date or time cannot be established.</p></blockquote>
<p>
That makes me wonder, in a manner not at <em>all</em> like Robert Plant, how precise do we have to be?  The answer, I&#8217;m sorry to say, is too much.
</p>
<p>
To pick an example: I have what I think of as <a href="http://meyerweb.com/eric/browsers/timeline-structured.html">a great use case for the <code>time</code> element</a>, and while it uses the Gregorian calendar, it&#8217;s only accurate to whole months (as is <a href="http://en.wikipedia.org/wiki/Browser_timeline#1993.E2.80.932009">Wikipedia&#8217;s version</a>).  In some cases I could get the values down to specific days; but in others, maybe not.  So I can&#8217;t use the <code>datetime</code> attribute, which <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#valid-date-string">requires at least year-month-day</a>, if not actual hours and minutes.  I could omit the attribute, and just have this:
</p>
<pre>
&lt;time&gt;October 2007&lt;/time&gt;
</pre>
<p>
In that case, the content has to be a valid date string in content&#8212;which is to say, a valid date string with optional whitespace.  So that won&#8217;t work.
</p>
<p>
I&#8217;ve pondered how best to tackle this, as did the Super Friends.  Our suggestion is to allow bare year and month-day values as permitted in ISO8601.  In addition, I think we should allow a valid date string to only require a year, with month, day, and time optional.  That seems good enough as long as we&#8217;re going to go with the idea that the Gregorian calendar contains all the time we ever want to structure.
</p>
<p>
But what about other, older dates, some of which are fairly precisely known within their own calendars?  On that point, though the historian in me clamors for a fix, I&#8217;m uncertain as to what.  <a href="http://quirksmode.org/" rel="acquaintance colleague met">PPK</a>, on the other hand, has put a<em>lot</em> of thought into this and written <a href="http://www.quirksmode.org/blog/archives/2009/04/making_time_saf.html">a piece</a> that I have skimmed but never, perhaps ironically, found the time to read in its entirety.
</p>

</li></ol>

<p>
These are not my only concerns, but they&#8217;re the big ones.  For the rest, I concur with <a href="http://www.zeldman.com/superfriends/guide/">the hiccups guide</a>, though of course to varying degrees.  I&#8217;m still trying to decide how much I care (or don&#8217;t) about the subtle differences between <code>article</code> and <code>section</code>, for example, or the way <code>aside</code> fits (or doesn&#8217;t) with its cousin elements.  And <code>dialog</code> just bugs me, but I&#8217;m not sure I have a better proposal, so I&#8217;ll leave it be for the time being.
</p>
<p>
At the other end of the two days, I felt a good deal more calm and hopeful than I did going in.  As <a href="http://www.zeldman.com/2009/08/31/loving-html5/">Jeffrey said</a>, &#8220;the more I study the direction HTML5 is taking, the better I like it&#8221;.  While there are still rough edges to be smoothed, there is time to smooth them.  We&#8217;ve already seen responsiveness on some of the points we addressed in the hiccups guide, and discussions around others.  The specification itself is daunting, especially to those who might remember the compact simplicity of the HTML2 spec.  Fortunately, it has good internal cross-linking so that you can, with effort, track down exactly what&#8217;s meant by &#8220;<a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#valid-date-string-with-optional-time">valid date string with optional time</a>&#8221; or &#8220;<a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/dom.html#flow-content">sectioning content</a>&#8221; or &#8220;<a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#formatblock-candidate"><code>formatBlock</code> candidate</a>&#8220;.
</p>
<p>
With HTML5, the web is not ending, nor is it starting over.  It&#8217;s evolving, slowly and in full view of the public, with an opportunity for anyone to have their say (which is not, of course, the same as having one&#8217;s proposals accepted).  It&#8217;s the next step, and I feel quite a bit more confident that it&#8217;s a step onto solid ground.
</p>
]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2009/09/02/nine-into-five/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Announcing Followerlap</title>
		<link>http://meyerweb.com/eric/thoughts/2009/07/06/announcing-followerlap/</link>
		<comments>http://meyerweb.com/eric/thoughts/2009/07/06/announcing-followerlap/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 17:22:50 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/?p=1138</guid>
		<description><![CDATA[A new micro-tool to find out how much overlap there is between the followers of two Twitter accounts.]]></description>
			<content:encoded><![CDATA[<p>
Last week, I got an <a href="http://twitter.com/supernovia/status/2424654400">interesting inquiry</a> from <a href="http://novapages.com/">Velda Christensen</a>:
</p>

<blockquote cite="http://twitter.com/supernovia/status/2424654400"><p>@meyerweb *wondering just how many of your followers follow @zeldman and vice-versa*</p></blockquote>

<p>
I had no idea.  Furthermore, I didn&#8217;t know of a tool that could tell me.  So I built one: <a href="http://meyerweb.com/eric/tools/followerlap/">Followerlap</a>.
</p>
<p>
As it turned out, the Twitter API made answering the specific question pretty ridiculously easy, thanks to <a href="http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-followers%C2%A0ids"><code>followers/ids</code></a>.  All it takes is two API requests, one for each username.  The same would be true of <a href="http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-friends%C2%A0ids"><code>friends/ids</code></a>, on top of which I suspect I&#8217;ll fairly shortly build a tool quite similar to Followerlap.
</p>
<p>
Since I <a href="http://twitter.com/meyerweb/status/2499070417">announced Followerlap&#8217;s existence</a> on (where else?) Twitter, I&#8217;ve had a few repeated (and not unexpected) bits of feedback.
</p>

<ul>
<li><p><strong>Why not list the common followers?</strong>  Because <code>followers/ids</code> returns a list of numeric IDs.  Resolving those IDs as usernames would require one API hit per ID.  If there are 15 followers in common, that&#8217;s not such a big deal, but if there are 1,500, well, I&#8217;ll run out of my hourly allotment of API requests very quickly.  Maybe there&#8217;s a better way; if so, I&#8217;d love to hear about it, because that would be a great addition.</p></li>
<li><p><strong>Why can&#8217;t I find out how many people follow both <a href="http://twitter.com/stephenfry">Stephen Fry</a> and <a href="http://twitter.com/THE_REAL_SHAQ">Shaquille O&#8217;Neal</a>?</strong>  Past a certain number of followers, somewhere in the 200,000&ndash;250,000 range, the API just dies.  You can&#8217;t even count on getting a consistent error message back.  <a href="http://groups.google.com/group/twitter-development-talk/browse_thread/thread/9abd452e420b5aed/37063359ae45fe68">There are ways around this</a>, but I didn&#8217;t want to stress the API that way, so it just fails.  Sorry.</p></li>
<li><p><strong>How can I link to a specific comparison?</strong>  <del datetime="2009-07-07T01:27:13+00:00">At the moment, you can&#8217;t.  I hope to make that happen soon, but I decided that a tool this simple should have a similarly simple launch.  Ship early, ship often, right?  Anyway, it&#8217;s on the list of things to add soon.</del>  Use the new &#8220;Livelink to this result&#8221; link underneath a result.  (See update below for more.)</p></li>
</ul>

<p>
So that&#8217;s Followerlap.  Any other questions?  I&#8217;ll do my best to answer them in the comments, though for a number of reasons I may be slow to respond.
</p>
<p>
<strong>Update 6 Jul 09:</strong> as noted in the edited point above, livelinking of comparison results is now, um, live.  So now you can pass around results like <a href="http://meyerweb.com/eric/tools/followerlap/?u1=god&#038;u2=devil">the number of people who follow both God <em>and</em> the Devil</a> (thanks to Paul M. Watson for <a href="http://twitter.com/paulmwatson/status/2500099501">coming up with that one</a>!).  I call this &#8220;livelinking&#8221; because hitting a result URL will get you the very latest results for that particular comparison.  &#8220;Permalinking&#8221; to me implied that it would link to a specific result at a specific time, which the tool doesn&#8217;t do and very likely never, ever will.
</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2009/07/06/announcing-followerlap/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>Digging in the Mud</title>
		<link>http://meyerweb.com/eric/thoughts/2009/04/14/digging-in-the-mud/</link>
		<comments>http://meyerweb.com/eric/thoughts/2009/04/14/digging-in-the-mud/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 13:09:03 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Questions]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/?p=1120</guid>
		<description><![CDATA[There's something about the DiggBar imbroglio (the Diggbroglio?) that has left me scratching my head:  how is it that so many people are up in arms about the DiggBar when they've had nothing to say about the framing bars of StumbleUpon, FaceBook, etc. etc.?]]></description>
			<content:encoded><![CDATA[<p>
There&#8217;s something about the Diggbroglio that has left me scratching my head:  how is it that so many people are up in arms about the DiggBar when they&#8217;ve had nothing to say about the framing bars of StumbleUpon, FaceBook, etc. etc.?
</p>
<p>
Now, please note that I&#8217;m <strong>not</strong> saying the DiggBar, or any other framing bar, is cool and we should all love it.  I&#8217;m not.  I absolutely, completely, totally get all the reasons why framing bars are bad for breaking bookmarking and navigating and search engines and copyright and hijacking content and so on.  But that&#8217;s precisely why I&#8217;m so confused, because we&#8217;ve known for years now that framing bars are bad mojo&#8212;and yet <a href="http://www.stumbleupon.com/">StumbleUpon</a>, for example, is based on bars.  There is a browser extension/plugin StumbleUpon thingy you can install, but there&#8217;s also a web-based framing bar thing (<a href="http://www.stumbleupon.com/toolbar/#topic=Science/Tech&#038;url=http%253A%252F%252Fwww2.warwick.ac.uk%252Fnewsandevents%252Fpressreleases%252Fnew_flat_flexible">see this link, for example</a>) that they offer, and I bet people use.  You don&#8217;t have to be a member to use it: I hit that link in a browser that allows cross-site frame loading and I get the bar and the page it&#8217;s framing, and I&#8217;ve never been a StumbleUpon member.  The source shows it&#8217;s using <code>iframe</code>s to make it happen.  So far as I can tell, it&#8217;s not really different from the DiggBar.
</p>
<p>
So why do we have people writing JavaScript and PHP and Ged-knows-what-else that specifically busts out of the <em>DiggBar</em> framing, instead of busting out of <em>all</em> framing?  After all, site framing is universally agreed to be objectionable; even yet-to-be-discovered life forms orbiting distant stars think it&#8217;s a bad idea.  So why is one instance of it being targeted while the rest are tolerated?  Why are we all not just using <code>if (top != self) {top.location.replace(self.location.href);}</code> and other-language equivalents?  Yes, I know, some of you do just that, but why isn&#8217;t everyone?
</p>
<p>
Perhaps because I have yet to eradicate a stubborn streak of faith in the rationality of my peers, I assume that there&#8217;s some technical difference here that I&#8217;m missing and that, once understood, would let me understand the source of the outcry.  So can someone please explain to me, or point at an explanation that states, the technical ways in which the DiggBar is worse enough than already-extant framing bars that it&#8217;s triggered this outrage?  Again, nobody has to enumerate the complete list of the DiggBar&#8217;s sins; I understand.  A list of any different and more egregious sins would be just fine, though.
</p>
<p>
Also, if anyone comes up with a way to bust out of the frames while still preserving the bar&#8212;that is, correcting the problems framing bars cause while preserving their functionality for the people who want to use them&#8212;that would be extra-cool.  After all, people who use those services like the bars.  If we could let them browse the web the way they prefer while fixing bookmark/SEO/etc. problems framing bars can cause, that would be a win all the way around.
</p>
<p>
<strong>Update 14 Apr 09:</strong> looks like <a href="http://g9g.org/" rel="friend colleague met">Porter</a>&#8217;s <a href="http://g9g.org/backblog/2009/04/14/turning-the-tables-on-the-diggbar.html">trying to keep the bar without the framing</a>.
</p>
<p>
<strong>Update 16 Apr 09:</strong> in <a href="http://daringfireball.net/linked/2009/04/15/diggbar-fix">his post about Digg changing the way the DiggBar will work</a>, <a href="http://daringfireball.net/" rel="acquaintance met">John Gruber</a> lists (by way of quoting Digg VP <a href="http://blog.digg.com/?p=664">John Quinn&#8217;s post about it</a>) the two things that made the DiggBar extra-objectionable (at least in his eyes).  Thanks, John!
</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2009/04/14/digging-in-the-mud/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Handling an Explicit-Width Bug in Internet Explorer</title>
		<link>http://meyerweb.com/eric/thoughts/2009/04/11/handling-an-explicit-width-bug-in-internet-explorer/</link>
		<comments>http://meyerweb.com/eric/thoughts/2009/04/11/handling-an-explicit-width-bug-in-internet-explorer/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 20:53:54 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://meyerweb.com/?p=1112</guid>
		<description><![CDATA[I stumbled into a width-increasing bug in IE6 and IE7, and was helped in finding a workaround.]]></description>
			<content:encoded><![CDATA[<p>
In creating the combo-bar charts for <a href="http://aneventapart.com/alasurvey2008">the survey report</a>, I stumbled into an Explorer bug that I didn&#8217;t remember ever seeing before, and Google didn&#8217;t turn up anything that seemed to be related.  This could easily mean that I&#8217;m the only person who ever did something this insane and thus found the bug.  It could just as easily mean that my Google-fu has failed.  Either way, I&#8217;ll write it up here so it can enter the collective memory.  (And surely someone has already noted that Google is positively Jungian?)
</p>
<p>
You can see both the problem and two workarounds if you visit <a href="http://meyerweb.com/eric/css/tests/winie/table-double/testcase.html">this test page</a> using IE6 or IE7.  In brief, the problem occurred when I had a table cell containing a paragraph with an explicit width set.  I did this through the <code>style</code> attribute, though tests show that for this bug, it doesn&#8217;t matter whether you use the attribute or assign it via a style sheet.  Around these explicit-width paragraphs were <code>div</code> elements with <code>width: 200%;</code>, for bar-drawing purposes (it&#8217;s a little complicated).  Everything was fine in 99% of cases.  But as soon as the header text at the beginning of the row went to two lines of text, the explicit-width paragraphs doubled in width.  What was <code>80.1%</code> wide would be drawn as though it were <code>160.2%</code> wide.
</p>
<p>
My hopefully understandable reaction was to say, &#8220;Whuh?&#8221;.  I threw a few hasLayout triggers at the offending paragraph (relative position, <code>zoom</code>, etc.) and got nowhere.  In the end I worked around the problem by telling IE6 and IE7 to not wrap text in the row headers of combo charts.  (The bug is not present in IE8.)
</p>
<p>
I mentioned all this in <a href="http://meyerweb.com/eric/thoughts/2009/04/07/findings-of-the-a-list-apart-survey-2008/">my announcement post</a>, and the ever-awesome <a href="http://wilkinsonweb.com/">Dan Wilkinson</a> <a href="http://meyerweb.com/eric/thoughts/2009/04/07/findings-of-the-a-list-apart-survey-2008/#comment-454002">discovered</a> that the problem could be fixed by setting all of the table rows to, say, <code>height: 3em</code>.  Armed with that breakthrough, I experimented a little more and found that I could actually set the offending table row&#8217;s height to <code>2.75em</code> and still have things work as intended.  Below that and the paragraph widths doubled.
</p>
<p>
Then I lowered the <code>line-height</code> of the headers to <code>1</code> and found that I could take the overall row&#8217;s <code>height</code> as low as <code>2.33em</code> before triggering the bug.  And that&#8217;s when it dawned: the bug was triggered by the layout height of the header cell&#8217;s content being taller than the content of the cell containing the paragraph, <em>and</em> not explicitly declaring styles that would make the data cell as tall as or taller than the height needed to have the header cell contain its content.
</p>
<p>
Okay, that&#8217;s a little dense.  Let me step through the symptoms and two found workarounds to see if that clears it up:
</p>

<ol>
<li>The data cell always has a single line of text.  The bug is triggered by having the header cell go to two lines of text, whereas it is not if the header cell has a single line of text.</li>
<li>If the row&#8217;s height is explicitly set to a value equal to or greater than the header cell&#8217;s content, the bug is not triggered.</li>
<li>Alternatively, if the height of the data cell is set or forced to be equal to or greater than the height of the header cell, the bug is not triggered.  This can be done with an explicit <code>height</code> or with added top and bottom padding or by adding top and bottom margins to the paragraphs in the cell.</li>
</ol>

<p>
Some side tests I did indicate that the header cell is <em>not</em> needed to trigger the bug.  In other words, the problem could happen even if there are only data cells in the row.  Furthermore, I found that the width-scaling was directly affected by the <code>width</code> of the wrapping <code>div</code>, and thus the widths were doubling only because I had the <code>div</code>&#8217;s <code>width</code> set to <code>200%</code>.  If I set it to <code>150%</code> instead of <code>200%</code>, then the paragraphs only got half again as wide instead of doubling.  That seems to make sense until you see it in action.  When I say the paragraphs got half again as wide, I mean that instead of being 75% as wide as the <code>div</code>, they were 112.5% as wide as the <code>div</code>.  If I set the <code>div</code>&#8217;s <code>width</code> to <code>200%</code>, then they were 150% the width of the <code>div</code>.
</p>
<p>
So.  As I say, this bug does not affect IE8, so that&#8217;s good, and it can be worked around in IE6 and IE7, which is even better.  The problem would be if you didn&#8217;t know how tall your cells might get&#8212;in my case, I can be (reasonably) sure that the tallest a cell&#8217;s content will ever get is two lines of text, and by setting an explicit <code>line-height</code> on the headers I can know how tall I have to make the rows in order to avoid the bug.
</p>
<p>
Another day, another workaround!
</p>
]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2009/04/11/handling-an-explicit-width-bug-in-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Findings of the A List Apart Survey 2008</title>
		<link>http://meyerweb.com/eric/thoughts/2009/04/07/findings-of-the-a-list-apart-survey-2008/</link>
		<comments>http://meyerweb.com/eric/thoughts/2009/04/07/findings-of-the-a-list-apart-survey-2008/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 15:50:12 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Culture]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/?p=1099</guid>
		<description><![CDATA[At last---at long, long last!---<a href="http://alistapart.com/">the results of the A List Apart Survey 2008 are available</a>, along with the anonymized raw data we collected.]]></description>
			<content:encoded><![CDATA[<p>
At last&#8212;at long, long last!&#8212;<a href="http://alistapart.com/articles/findingsfromthewebdesignsurvey2008">the results of the A List Apart Survey 2008 are available</a>, along with the anonymized raw data we collected.
</p>
<p>
There are a great many reasons why it took so long to get this out the door.  A big part is that it&#8217;s almost entirely a volunteer effort, which means it happens in our &#8220;free time&#8221; (and there the word &#8220;free&#8221; has a couple of meanings).  I say it&#8217;s almost entirely a volunteer effort because the detailed analysis is actually done by a pair of professional statisticians, who are paid for their time and expertise.  They did a great job once more, and did it in a reasonable time frame.  It just took us a while to get them the data to analyze, and then a while longer to take their report and findings and process them into report form.
</p>
<p>
The biggest change this year is that we&#8217;re publishing the results as HTML+CSS instead of a PDF.  This greatly increased the challenge, because it was important to me that the data be presented using styled tables, not images.  That&#8217;s easy like cake if all you&#8217;re doing is putting them up as visual tables, and we certainly do that for some of the figures.  In the other cases, where we have bar charts of varying kinds, things got difficult.  I managed to devise solutions that are 99.9% effective, and I&#8217;m both proud of and frustrated by those solutions.  Proud, of course, because I managed to wring three-stack bars out of table markup; frustrated because of the markup I had to construct to make them possible.  I think this report represents more than half my lifetime usage of the <code>style</code> attribute, but unfortunately there&#8217;s no way (using just CSS) to say <code>{width: content;}</code>.
</p>
<p>
So why not use JavaScript to do that, or to just replace the tables with canvas-drawn charts?  I did consider both, but decided that I would push as far as I could with plain HTML+CSS.  
</p>
<p>
A few implementation notes:
</p>

<ul>
<li>
<p>I used HTML 5 in order to step around some previously unrealized limitations of HTML 4&#8212;did you know <code>tfoot</code> has to come before <code>tbody</code> in HTML 4?  <em>I</em> didn&#8217;t.  I did not use elements like <code>header</code> and <code>footer</code> due to known problems in Firefox 2 and related browsers, which mangle pages containing those elements.  Instead, I took <a href="http://jontangerine.com/log/2008/03/preparing-for-html5-with-semantic-class-names">the same path Jon Tan recommends</a>, and classed <code>div</code>s using those names for later, easier conversion.</p>
</li>
<li>
<p>The tables which underlie the charts do not have <code>summary</code> attributes.  If a group of civic-minded individuals would like to write useful summaries, please let me know in the comments and I&#8217;ll let you know how best to submit them.  Similarly, I did my very best to make sure all the table headers had accurate <code>scope</code> values, but if I botched any, let me know.</p>
</li>
<li>
<p>I&#8217;m aware that Opera shows horizontal scrollbars on most chapters of the report.  This is due to its refusal to apply <code>overflow</code> to table boxes, which according to my recent reading of the CSS 2.1 specification is the correct thing to (not) do.  Every other browser I tested does apply <code>overflow</code> to table boxes, though, which I found most useful.  I tried applying <code>overflow: hidden</code> to a few other boxes, and that got rid of Opera&#8217;s horizontal scrollbars, but it also cut off actual content in some other browsers.  I chose a cosmetic problem in one browser over loss of content in others.  The best fix I&#8217;ve devised is to wrap the tables in <code>div</code>s and apply <code>overflow: hidden</code> to those <code>div</code>s, but I didn&#8217;t want to rush the fix and botch it, so it didn&#8217;t make it in time for first publication.  I expect to get it in shortly after publication.</p>
</li>
<li>
<p>In a like vein, there are a few combo charts where a bar goes shooting off the right side of the chart in IE7.  This appears to be due to some kind of width-doubling problem that&#8217;s only invoked on elements with a <code>style</code> attribute when the row header goes to two lines instead of being just one.  Googling for an explanation yielded no joy, and a lengthy series of attempts to hack around the problem came to nothing.  If anyone knows how to counteract that problem other than preventing the header text from going past a single line, I&#8217;d love to hear it.  (Update: I&#8217;ve implemented the &#8220;fix&#8221; of preventing line-wrapping in the report, so there aren&#8217;t any off-the-page bars right now, but you can <a href="http://meyerweb.com/eric/css/tests/winie/table-double/13.html">see an example of the problem on this test page</a>.)</p>
</li>
<li>
<p>Surprisingly, the charts mostly work in IE6.  The exception is some of the triple-stack charts, where data points overlap when the rightmost sub-bars get too small, and also the double-width bars mentioned in the previous point.  I don&#8217;t really have a fix for this short of upgrading the browser, but if somebody finds one, I&#8217;d be happy to test it out.</p>
</li>
</ul>

<p>
On that last point, if there are questions or suggestions surrounding the implementation of the report, we can certainly discuss them here.  With regard to the survey and report itself, though&#8212;that is, the questions asked and the results we&#8217;re publishing&#8212;please direct those thoughts to <a href="http://alistapart.com/comments/findingsfromthewebdesignsurvey2008/">the comments section of the ALA article announcing the report</a>.  I&#8217;m hoping that we&#8217;ll have the 2009 survey up within a few months, so comments on what we asked and how we asked it, what we didn&#8217;t ask but should have, and that sort of thing could well have a direct impact on the next survey.  But please put those on the ALA site, where more people are likely to see them.
</p>
<p>
It&#8217;s done, it&#8217;s out, it&#8217;s yours&#8212;both the report and the data, about which I&#8217;ll soon write a little bit more.  Read the report, or produce your own report using the data.  Just always know that when we publish these reports, we do not mean for them to be the final word.  No, what we always mean is for them to be the <em>first</em> words, a starting point, a place from which to grow.  What comes next is as much up to you as anyone else, and I can&#8217;t wait to see what you do.
</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2009/04/07/findings-of-the-a-list-apart-survey-2008/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
	</channel>
</rss>
