<?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; Browsers</title>
	<atom:link href="http://meyerweb.com/eric/thoughts/category/tech/browsers/feed/" 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>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>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>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>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>Wanted: Layout System</title>
		<link>http://meyerweb.com/eric/thoughts/2009/02/17/wanted-layout-system/</link>
		<comments>http://meyerweb.com/eric/thoughts/2009/02/17/wanted-layout-system/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 15:00:14 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[W3C]]></category>

		<guid isPermaLink="false">http://meyerweb.com/?p=1052</guid>
		<description><![CDATA[Not surprisingly, there was a lot of community feedback <a href="http://fantasai.inkedblade.net/style/discuss/wasp-feedback-2008#layout">asking for better layout mechanisms</a>.  Actually, people were asking for any decent layout mechanism at all, which CSS has historically lacked.  It needs one.]]></description>
			<content:encoded><![CDATA[<p class="aside">(This is part of the <a href="http://meyerweb.com/eric/thoughts/2009/02/11/feedback-on-wasp-community-css3-feedback-2008/">Feedback on &#8216;WaSP Community CSS3 Feedback 2008&#8242;</a> series.)</p>
<p>
Not surprisingly, there was a lot of community feedback <a href="http://fantasai.inkedblade.net/style/discuss/wasp-feedback-2008#layout">asking for better layout mechanisms</a>.  Actually, people were asking for any decent layout mechanism at all, which CSS has historically lacked.  Floats mostly work, but they&#8217;re a hack and can be annoyingly fragile even when you ignore old-browser bugs.  Positioning works in limited cases, but does not handle web-oriented layout at all well.
</p>
<p>
Why do we use floats for layout, anyway?  <code>clear</code>.  That&#8217;s pretty much the whole answer.  The unique in-flow/out-of-flow nature of floats means they interact with each other and with the normal flow, which means they can be cleared, which makes them useful.  Because with <code>clear</code>, we can float layout blocks around and then push other non-floated blocks, like footers, below the floats.
</p>
<p>
Positioning, of course, permits total layout freedom in the sense that you can put a layout block anywhere with respect to its containing block.  The downfall is that absolutely positioned elements are entirely out of the normal flow, so they can&#8217;t stay out of each others&#8217; way like floats do, and you can&#8217;t clear anything with respect to a positioned element.  If there had been a <code>position-clear</code> or its equivalent from the outset, we&#8217;d never have bothered with floats.
</p>
<p>
(And if we can just add <code>position-clear</code> to CSS, that would be completely awesome.  It&#8217;s <a href="http://www.shauninman.com/archive/2006/05/22/clearance_position_inline_absolute">been done with JavaScript</a> and it will most likely be done again and better.  It wouldn&#8217;t even be that hard to implement, at least for 99.5% of cases.)
</p>
<p>
All this is why the old &#8220;only use tables for layout&#8221; argument keeps coming up over and over: strip away the overheated rhetoric and obvious link-baiting, and you find the core of a real need.  Because as powerful as CSS can be, table cells do certain things very easily that CSS makes very, very hard.  Cells stretch vertically, keeping equal heights as a matter of their intrinsic nature.  They stay out of each others&#8217; way, while still being allowed to sit next to each other and use any sizing dimensions.  They tie their layout to their parent elements, and vice versa.
</p>
<p>
There are <em>no</em> equivalents in CSS.  There have been various very clever attempts to replicate bits and pieces of those capabilities using CSS.  What CSS does, it does very well: if you don&#8217;t need equal-height layout blocks, then no problem.  If you do, it&#8217;s a massive pain.  Clever techniques provide substitutes, but can&#8217;t replace what tables already do.
</p>
<p>
And please, let&#8217;s put the whole &#8220;<code>display: table-cell</code> will grant those abilities through CSS&#8221; to rest.  Saying that is just saying &#8220;use tables for layout&#8221; with different words.  Turning a bunch of <code>div</code>s or list items or whatever into table-role boxes is no better than just using table markup in the first place, and it&#8217;s arguably worse.  Using element names other than <code>table</code> and <code>td</code> to create layout tables, and then claiming it&#8217;s not using tables for layout, borders on self-deception.
</p>
<p>
Not to mention doing things that way means you&#8217;re doing your layout in a highly source-order-dependent fashion, which was one of the things about table layout we were trying to get away from in the first place.
</p>
<p>
So how do we get really powerful source-order-independent layout?  I wish I knew.  The <a href="http://www.w3.org/TR/css3-layout/">Advanced Layout module</a> has been sitting around for a while now, and even if you&#8217;re a fan of defining layout as ASCII art&#8212;which I find repels and appeals in equal measure, but that&#8217;s probably just me&#8212;there appears to be close to zero implementor interest.  So how do we get those abilities in a form that implementors will, y&#8217;know, <em>implement</em>?  I don&#8217;t know.  I don&#8217;t <em>care</em>.  We just need it, and have needed it for a good decade or so.  Without it, CSS is a styling language but not a layout language.  We&#8217;ve bent it into being something close to a layout language, which is nice but not really ideal.
</p>
<p>
Maybe CSS isn&#8217;t the place for this.  Maybe there needs to be a new layout language that can be defined and implemented without regard to the constraints of the existing CSS syntax rules, without worrying about backwards compatibility.  Maybe that way we can not only get strong layout but also arbitrary shapes, thus leaving behind the rectangular prison that&#8217;s defined the web for almost two decades.
</p>
<p>
I don&#8217;t have a concrete idea to propose here, because it&#8217;s not up to us any more.  A solution was worked out over the course of several years and then found wanting by the implementors.  Really, it&#8217;s up to the implementors to figure it out now.  I personally would like to just lock the browser teams from Microsoft, Mozilla, Opera, and Apple in a room and not let them out until they&#8217;ve defined something that works and they&#8217;ve all agreed to implement soonest.  I might even supply food and water.
</p>
<p>
And yes, I just advocated doing this outside the W3C process.  Why wouldn&#8217;t I?  The process has, in the last decade, not produced anything even remotely resembling an answer to this problem.  Time to try another path and see if it gets any closer to the goal.
</p>
<p>
No doubt someone&#8217;s going to spin this as &#8220;See, even noted standards zealot Eric Meyer now says CSS is flawed!&#8221;&#8212;only they&#8217;ll be wrong because this isn&#8217;t a <em>now</em> thing.  I&#8217;ve been saying this for years in interviews, in person, and in general.  Any time someone asks me what CSS is missing or should do better, the answer has always been a variant on &#8220;a strong layout system&#8221;.  I&#8217;ve been saying it for at least a decade.  So I&#8217;m not saying it <em>now</em>.  I&#8217;m saying it <em>again</em>.  And again and again and again and&#8230;
</p>
<p>
If I sound frustrated, it&#8217;s because I am, and have been for a good long while.  I&#8217;m not the only one.  It rankles to have CSS be, as Winston Churchill would have put it, the worst form of layout except for all the others that have been tried.
</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2009/02/17/wanted-layout-system/feed/</wfw:commentRss>
		<slash:comments>130</slash:comments>
		</item>
		<item>
		<title>An Event Apart and HTML 5</title>
		<link>http://meyerweb.com/eric/thoughts/2009/01/02/an-event-apart-and-html-5/</link>
		<comments>http://meyerweb.com/eric/thoughts/2009/01/02/an-event-apart-and-html-5/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 16:01:59 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[(X)HTML]]></category>
		<category><![CDATA[An Event Apart]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/?p=982</guid>
		<description><![CDATA[A bit of commentary about the choice of markup language for the brand-new An Event Apart design.]]></description>
			<content:encoded><![CDATA[<p>
The new Gregorian year has brought a striking new <a href="http://zeldman.com/" rel="friend colleague co-worker met">Big Z</a> design to <a href="http://aneventapart.com/">An Event Apart</a>, along with the detailed schedule for our first show and the opening of <a href="https://store.aneventapart.com/">registration for all four shows</a> of the year.  Jeffrey has <a href="http://www.zeldman.com/2009/01/01/an-event-apart-redesigned/">written a bit</a> about the thinking that went into the design already, and I expect more to come.  If you want <em>all</em> the juicy details, he&#8217;ll be talking about it at AEA, as a glance at the top of <a href="http://aneventapart.com/2009/seattle/#schedule">the Seattle schedule</a> will tell you.  And right after that?  An hour of me talking about coding the design he created.
</p>
<p>
One of the things I&#8217;ll be talking about is the choice of markup language for the site, which ended up being <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/">HTML 5</a>.  In the beginning, I chose HTML 5 because I wanted to do something like this:
</p>

<pre>
&lt;li&gt;
&lt;a href="/2009/seattle/"&gt;
&lt;h2&gt;&lt;img src="/i/09/city-seattle.jpg" alt="Seattle" /&gt;&lt;/h2&gt;
&lt;h3&gt;May 4&#8212;5, 2009&lt;/h3&gt;
&lt;p&gt;Bell Harbor International Conference Center&lt;/p&gt;
&lt;/a&gt;
&lt;/li&gt;
</pre>

<p>
Yes, <a href="http://dev.w3.org/html5/spec/Overview.html#the-a-element">that&#8217;s legal in HTML 5</a>, thanks to <a href="http://www.brucelawson.co.uk/2008/any-element-linking-in-html-5/">the work done</a> by <a href="http://www.brucelawson.co.uk/" rel="friend colleague met">Bruce Lawson</a> in response to my <a href="http://meyerweb.com/eric/thoughts/2008/07/23/any-element-linking-demo/">href-anywhere agitation</a>.  It isn&#8217;t what I&#8217;d consider ideal, structurally, but it&#8217;s close.  It sure beats having to make the content of every element its own hyperlink, each one pointing at the exact same destination:
</p>

<pre>
&lt;li&gt;
&lt;h2&gt;&lt;a href="/2009/seattle/"&gt;&lt;img src="/i/09/city-seattle.jpg" alt="Seattle" /&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;h3&gt;&lt;a href="/2009/seattle/"&gt;May 4&#8212;5, 2009&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href="/2009/seattle/"&gt;Bell Harbor International Conference Center&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
</pre>

<p>
I mean, that&#8217;s just dumb.  Ideally, I could drop an <code>href</code> on the <code>li</code> instead of having to wrap an <code>a</code> element around the content, but baby steps.  Baby steps.
</p>
<p>
So as Bruce discovered, pretty much all browsers will already let you wrap <code>a</code> elements around other stuff, so it got added to HTML 5.  And when I tried it, it worked, clickably speaking.  That is, all the elements I wrapped became part of one big hyperlink, which is what I wanted.
</p>
<p>
What I didn&#8217;t want, though, was the randomized layout weirdness that resulted once I started styling the descendants of the link.  Sometimes everything would lay out properly, and other times the bits and pieces were all over the place.  I could (randomly) flip back and forth between the two just by repeatedly hitting reload.  I thought maybe it was the heading elements that were causing problems, so I converted them all to classed paragraphs.  Nope, same problems.  So I converted them all to classed <code>span</code>s and that solved the problem.  The layout became steady and stable.
</p>
<p>
I was happy to get the layout problems sorted out, obviously.  Only, at that point, I wasn&#8217;t doing anything that required HTML 5.  Wrapping classed <code>span</code>s in links in the place of other, more semantic elements?  Yeah, <em>that&#8217;s</em> original.  It&#8217;s just as original as the coding pattern of &#8220;slowly leaching away the document&#8217;s semantics in order to make it, at long last and after much swearing, consistently render as intended&#8221;.  I&#8217;m sure one or two of you know what that&#8217;s like.
</p>
<p>
As a result, I could have gone back to XHTML 1.1 or even HTML 4.01 without incident.  In fact, I almost did, but in the end I decided to stick with HTML 5.  There were two main reasons.
</p>

<ol>
<li>
<p>First, AEA is all about the current state and near future of web design and development.  HTML 5 is already here and in use, and its use will grow over time.  We try to have the site embody the conference itself as much as possible, so using HTML 5 made some sense.</p>
</li>
<li>
<p>
I wanted to try HTML 5 out for myself under field conditions, to get a sense of how similar or dissimilar it is to what&#8217;s gone before.  Turns out the answers are &#8220;very much so&#8221; to the former and &#8220;frustratingly so&#8221; to the latter, assuming you&#8217;re familiar with XHTML.  The major rules are pretty much all the same: mind your trailing slashes on empty elements, that kind of thing.  But you know what the funniest thing about HTML 5 is?  It&#8217;s the little differences.  Like not permitting a <code>value</code> attribute on an image <code>submit</code>.  That one came as a rather large surprise, and as a result our <a href="http://aneventapart.com/subscribe/">subscribe page</a> is XHTML 1.0 Transitional instead of HTML 5.  (Figuring out how to work around this in HTML 5 is on my post-launch list of things to do.)
</p>
<p>
Oh, and we&#8217;re back to being case-insensitive.  <code>&lt;P Class="note"&gt;</code> is just as valid as <code>&lt;p class="note"&gt;</code>.  Having already fought the Casing Wars once, this got a fractional shrug from me, but some people will probably be all excited that they can uppercase their element names again.  I know I would&#8217;ve been, oh, six or seven years ago.
</p>
<p>
Incidentally, I used <a href="http://validator.nu/">validator.nu</a> to check my work.  It seemed the most up to date, but there&#8217;s no guarantee it&#8217;s perfectly accurate.  Ged knows every other validator I&#8217;ve ever used has eventually been shown to be inaccurate in one or more ways.
</p>
</li>
</ol>

<p>
I get the distinct impression that use of HTML 5 is going to cause equal parts of comfort (for the familiar parts) and eye-watering rage (for the apparently idiotic differences).  Thus it would seem the HTML 5 Working Group is succeeding quite nicely at capturing the current state of browser behavior.  Yay, I guess?
</p>
<p>
And then there was the part where I got really grumpy about not being able to nest a hyperlink element inside another hyperlink element&#8230; but that, like so many things referenced in this post, is a story for another day.
</p>
]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2009/01/02/an-event-apart-and-html-5/feed/</wfw:commentRss>
		<slash:comments>66</slash:comments>
		</item>
		<item>
		<title>JavaScript Will Save Us All</title>
		<link>http://meyerweb.com/eric/thoughts/2008/10/22/javascript-will-save-us-all/</link>
		<comments>http://meyerweb.com/eric/thoughts/2008/10/22/javascript-will-save-us-all/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 13:05:57 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[(X)HTML]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Standards]]></category>

		<guid isPermaLink="false">http://meyerweb.com/?p=953</guid>
		<description><![CDATA[Most of the browser development work these days seems to be going into JavaScript performance.  That's a good thing for CSS3 and HTML5.]]></description>
			<content:encoded><![CDATA[<p>
A while back, I woke up one morning thinking, <i>John Resig&#8217;s got some great CSS3 support in <a href="http://jquery.com/">jQuery</a> but it&#8217;s all forced into JS statements.  I should ask him if he could set things up like <a href="http://dean.edwards.name/">Dean Edwards</a>&#8216; <a href="http://dean.edwards.name/ie7/">IE7 script</a> so that the JS scans the author&#8217;s CSS, finds the advanced selectors, does any necessary backend juggling, and makes CSS3 selector support Transparently Just Work.  And then he could put that back into jQuery.</i>
</p>
<p>
And then, after breakfast, I fired up my feed reader and saw <a href="http://simonwillison.net/" rel="acquaintance met">Simon Willison</a>&#8217;s <a href="http://simonwillison.net/2008/Aug/24/jeresigs/">link</a> to John Resig&#8217;s nascent <a href="http://github.com/jeresig/sizzle/tree/master">Sizzle</a> project.
</p>
<p>
I swear to Ged this is how it happened.
</p>
<p>
Personally, I can&#8217;t wait for Sizzle to be finished, because I&#8217;m absolutely going to use it and recommend its use far and wide.  As far as I&#8217;m concerned, though, it&#8217;s a first step into a larger world.
</p>
<p>
Think about it: most of the browser development work these days seems to be going into JavaScript performance.  Those engines are being overhauled and souped up and tuned and re-tuned to the point that performance is improving by orders of magnitude.  Scanning the DOM tree and doing things to it, which used to be slow and difficult, is becoming lightning-fast and easy.
</p>
<p>
So why not write JS to implement <a href="http://www.css3.info/preview/multiple-backgrounds/">multiple background-image</a> support in all browsers?  All that&#8217;s needed is to scan the CSS, find instances of multiple-image backgrounds, and then dynamically add <code>div</code>s, one per extra background image, to get the intended effect.
</p>
<p>
Just like that, you&#8217;ve used the browser&#8217;s JS to extend its CSS support.  This approach advances standards support in browsers from the ground up, instead of waiting for the browser teams to do it for us.
</p>
<p>
I suspect that not quite everything in CSS3 will be amenable to this approach, but you might be surprised.  Seems to me that you could do <a href="http://www.css3.info/preview/background-size/">background sizing</a> with some <code>div</code>-and-positioning tricks, and <code>text-shadow</code> could be supportable using a sIFR-like technique, though line breaks would be a bear to handle.  <a href="http://www.w3.org/TR/2003/CR-css3-color-20030514/#rgba-color">RGBa</a> and <a href="http://www.w3.org/TR/2003/CR-css3-color-20030514/#hsla-color">HSLa</a> colors could be simulated with creative element reworking and <code>opacity</code>, and HSL itself could be (mostly?) supported in IE with HSL-to-RGB calculations.  And so on.
</p>
<p>
There are two primary benefits here.  The first is obvious: we can stop waiting around for browser makers to give us what we want, thanks to their efforts on JS engines, and start using the advanced CSS we&#8217;ve been hearing about for years.  The second is that the process of finding out which parts of the spec work in the real world, and which fall down, will be greatly accelerated.  If it turns out nobody uses (say) <code>background-clip</code>, even given its availability via a CSS/JS library, then that&#8217;s worth knowing.
</p>
<p>
What I wonder is whether the W3C could be convinced that two JavaScript libraries supporting a given CSS module would constitute &#8220;interoperable implementations&#8221;, and thus allow the specification to move forward on the process track.  Or heck, what about considering a single library getting consistent support in two or more browsers as interoperable?  There&#8217;s a chance here to jump-start the entire process, front to back.
</p>
<p>
It is true that browsers without JavaScript will not get the advanced CSS effects, but older browsers don&#8217;t get our current CSS, and we use it anyway.  (Still older browsers don&#8217;t understand any CSS at all.)  It&#8217;s the same problem we&#8217;ve always faced, and everyone will face it differently.
</p>
<p>
We don&#8217;t have to restrict this to CSS, either.  As I showed with my <a href="http://meyerweb.com/eric/html-xhtml/html5-linking-demo.html"><code>href</code>-anywhere demo</a>, it&#8217;s possible to extend markup using JS.  (No, not without breaking validation: you&#8217;d need a custom DTD for that.  Hmmm.)  So it would be possible to use JS to, say, add <code>audio</code> and <code>video</code> support to currently-available browsers, and even older browsers.  All you&#8217;d have to do is convert the HTML5 element into HTML4 elements, dynamically writing out the needed attributes and so forth.  It might not be a perfect 1:1 translation, but it would likely be serviceable&#8212;and would tear down some of the highest barriers to adoption.
</p>
<p>
There&#8217;s more to consider, as well: the ability to create our very own &#8220;standards&#8221;.  Maybe you&#8217;ve always wanted a <code>text-shake</code> property, which jiggles the letters up and down randomly to look like the element got shaken up a bit.  Call it <code>-myCSS-text-shake</code> or something else with a proper &#8220;vendor&#8221; prefix&#8212;we&#8217;re <em>all</em> vendors now, baby!&#8212;and go to town.  Who knows?  If a property or markup element or attribute suddenly takes off like wildfire, it might well make it into a specification.  After all, the HTML 5 Working Group is now explicitly set up to prefer things which are implemented over things that are not.  Perhaps the CSS Working Group would move in a similar direction, given a world where we were all experimenting with our own ideas and seeing the best ideas gain widespread adoption.
</p>
<p>
In the end, <a href="http://www.flickr.com/photos/rohdesign/2951537617/">as I said in Chicago</a> last week, the triumph of standards (specifically, the DOM standard) will permit us to push standards support forward <em>now</em>, and save some standards that are currently dying on the vine.  All we have to do now is start pushing.  Sizzle is a start.  Who will take the next step, and the step after that?
</p>
]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2008/10/22/javascript-will-save-us-all/feed/</wfw:commentRss>
		<slash:comments>64</slash:comments>
		</item>
		<item>
		<title>Need Help With Table Row Events</title>
		<link>http://meyerweb.com/eric/thoughts/2008/05/29/need-help-with-table-row-events/</link>
		<comments>http://meyerweb.com/eric/thoughts/2008/05/29/need-help-with-table-row-events/#comments</comments>
		<pubDate>Thu, 29 May 2008 21:06:01 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://meyerweb.com/?p=906</guid>
		<description><![CDATA[A late-week call for assistance in the JavaScript realm, specifically in making IE do what I need and can make happen in other browsers.]]></description>
			<content:encoded><![CDATA[<p>
Here&#8217;s a late-week call for assistance in the JavaScript realm, specifically in making IE do what I need and can make happen in other browsers.  I&#8217;d call this a LazyWeb request except I&#8217;ve been trying to figure out how to do it all <em>[censored]</em> afternoon, and it doesn&#8217;t <em>[censored]</em> work no matter how many <em>[censored]</em> semi-related examples I find online that work just <em>[censored]</em> fine, but still don&#8217;t <em>[censored]</em> help me <em>[censored]</em> fix this <em>[censored]</em> problem.  <em>[doubly censored]</em>!
</p>
<p>
I have a table.  (Yes, for data.)  In the table are rows, of course, and each row has a number of cells.  I want to walk through the rows and dynamically add an &#8216;onclick&#8217; event to every row.  The actual event is slightly different for each row, but in every case, it&#8217;s supposed to call a function and pass some parameters (which are the things that change).  Here&#8217;s how I&#8217;m doing it:
</p>
<pre>
var event = '5'; // in the real code this is passed into the surrounding function
var mapStates = getElementsByClassName('map','tr');
for (x = 0; x < mapStates.length; x++) {
	var el = mapStates[x];
	var id = el.getAttribute('id');
	var val = "goto('" + id + "','" + event + "');";
	el.setAttribute('onclick',val);
}
</pre>
<p>
Okay, so that works fine in Gecko.  It doesn't work at all in IE.  I changed <code>el.setAttribute('onclick',val);
</code> to <code>el.onclick = val;</code> per some advice I found online and that completely failed in everything.  Firebug told me "el.onclick is not a function".  Explorer just silently did nothing, like always.
</p>
<p>
So how am I supposed to make this work in IE, let alone in IE and Gecko-based and WebKit-based and all other modern browsers?
</p>
<p>
Oh, and do <strong>not</strong> tell me that framework X or library Q does this so easily, because I'm trying to <em>learn</em> here, not have someone else's code hand-wave the problem away.  Pointing me directly to the actual code block inside a framework or library that makes this sort of thing possible:  that's totally fine.  I may not understand it, but at least there will be JS for me to study and ask questions about.  Ditto for pointing me to online examples of doing the exact same thing, which I tried to find in Google but could not: much appreciated.
</p>
<p>
Help, please?
</p>
<p><strong>Update:</strong> many, many commenters helped me see what I was missing and therefore doing wrong---thank you all!  For those wondering what I was wondering, check out the comments.  There are a lot of good examples and quick explanations there.</p></pre>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2008/05/29/need-help-with-table-row-events/feed/</wfw:commentRss>
		<slash:comments>45</slash:comments>
		</item>
		<item>
		<title>Characteristic Confusion</title>
		<link>http://meyerweb.com/eric/thoughts/2008/05/22/characteristic-confusion/</link>
		<comments>http://meyerweb.com/eric/thoughts/2008/05/22/characteristic-confusion/#comments</comments>
		<pubDate>Thu, 22 May 2008 14:00:29 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://meyerweb.com/?p=903</guid>
		<description><![CDATA[When Unicode attacks!]]></description>
			<content:encoded><![CDATA[<p>
In the course of building my <a href="http://meyerweb.com/eric/css/tests/line-height/inspect-multi.html"><code>line-height: normal</code> test page</a>, I settled on defaulting to an unusual but still pervasive font family: Webdings.  The idea was that if you picked a font family in the dropdown and you didn&#8217;t have it installed, you&#8217;d fall back to Webdings and it would be really obvious that it had happened.
</p>
<img src="http://meyerweb.com/pix/2008/ear-etcetera.png" alt="(A screenshot of the symbols expected from Webdings: an ear, a circle with a line through the middle, and a spider.)" class="pic border" />
<p>
Except in Firefox 3b5, there were no dings, web or otherwise.  Instead, some serif-family font (probably my default serif, Times) was being used to display the text &#8220;Oy!&#8221;.
</p>
<p>
<i>It&#8217;s a beta</i>, I thought with a mental shrug, and moved on.  When I made mention of it in <a href="http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/">my post on the subject</a>, I did so mainly so I didn&#8217;t get sixteen people commenting &#8220;No Webdings in Firefox 3 betas!&#8221; when I already knew that.
</p>
<p>
So I didn&#8217;t get any of those comments.  Instead, <a href="http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-375051">Smokey Ardisson posted</a> that what Firefox 3 was doing with my text was correct.  Even though the declared fallback font was Webdings, I shouldn&#8217;t expect to see it being used, because Firefox was doing the proper Unicode thing and finding me a font that had the character glyphs I&#8217;d requested.
</p>
<p>
Wow.  Ignoring a <code>font-family</code> declaration is kosher?  Really?
</p>
<p>
Well, yes.  It&#8217;s been happening ever since the CSS font rules were first implemented.  In fact, it&#8217;s the basis of the whole list-of-alternatives syntax for <code>font-family</code>.  You might&#8217;ve thought that CSS says browsers should look to see if a requested family is available and then if not look at the next one on the list, and then goes to render text.  And it does, but it says they should do that on <em>a per-character basis</em>.
</p>
<p>
That is, if you ask for a character and the primary font face doesn&#8217;t have it, the browser goes to the next family in your list looking for a substitute.  It keeps doing that until it finds the character you wanted, either in your list of preferred families or else in the browser&#8217;s default fonts.  And if the browser just can&#8217;t find the needed symbol anywhere at all, you get an empty box or a question mark or some other symbol that means &#8220;FAIL&#8221; in font-rendering terms.
</p>
<p>
A commonly-cited case for this is specifying a <acronym title="Chinese, Japanese, Korean, and Vietnamese">CJKV</acronym> character in a page and then trying to display it on a computer that doesn&#8217;t have non-Romance language fonts installed.  The same would hold true for any page with any characters that the installed fonts can&#8217;t support.  But think about it: if you browse to a page written in, say, Arabic, and your user style sheet says that all elements&#8217; text should be rendered in New Century Schoolbook, what will happen?  If you have fonts that support Arabic text, you&#8217;re going to see Arabic, not New Century Schoolbook.  If you don&#8217;t, then you&#8217;re going to see a whole lot of &#8220;I can&#8217;t render that&#8221; symbols.  (Though I don&#8217;t know what font those symbols will be in.  Maybe New Century Schoolbook?  Man, I miss that font.)
</p>
<p>
So: when I built my test, I typed &#8220;Oy!&#8221; for the example text, and then wrote styles to use Webdings to display that text.  Here&#8217;s how I represented that, mentally: the same as if I&#8217;d opened up a text editor like, oh, MS Word 5.1a; typed &#8220;Oy!&#8221;; selected that text; and then dropped down the &#8220;Font&#8221; menu and picked &#8220;Webdings&#8221;.
</p>
<p>
But here&#8217;s how Firefox 3 dealt with it: I asked for the character glpyhs &#8220;O&#8221;, &#8220;y&#8221;, and &#8220;!&#8221;; I asked for a specific font family to display that text; the requested font family doesn&#8217;t contain those glyphs or anything like them; the CSS font substitution rules kicked in and the browser picked those glyphs out of the best alternative.  (In this case, the browser&#8217;s default fonts.)
</p>
<p>
In other words, Firefox 3 will not show me the ear-Death Star-spider combo unless I put those exact symbols into my document source, or at least Unicode references that call for those symbols.  Because that&#8217;s what happens in a Unicode world: you get the glyphs you requested, even if you thought you were requesting something else.
</p>
<p>
The problem, of course, is that we <em>don&#8217;t</em> live in a Unicode world&#8212;not yet.  If we did, I wouldn&#8217;t keep seeing line noise on every web page where someone wrote their post in Word with smart quotes turned on and then just did a straight copy-and-paste into their CMS.  <img src="http://meyerweb.com/pix/2008/wallace.png" alt="(Here we have a screenshot of text where a bullet symbol has been mangled into an a-rhone and an American cents sign, thus visually turning 'Wall-E' into 'Wallace'.)" title="Ah, Wallace..." class="pic border" />  Ged knows I would love to be in a Unicode world, or indeed any world where such character-incompatibility idiocy was a thing of the past.  The fact that we still have those problems in 2008 almost smacks of willful malignance on the part of <em>somebody</em>.
</p>
<p>
Furthermore, in most (but not all) of the text editors I have available and tested, I can type &#8220;Oy!&#8221; with the font set to Webdings and get the ear, Death Star, and spider symbols.  So mentally, it&#8217;s very hard to separate those glyphs from the keyboard characters I type, which makes it very hard to just accept that what Firefox 3 is doing is correct.  Instinctively, it feels flat-out <em>wrong</em>.  I can trace the process intellectually, sure, but that doesn&#8217;t mean it has to make sense to me.  I expect a lot of people are going to have similar reactions.
</p>
<p>
Having gone through all that, it&#8217;s worth asking: which is less correct?  Text editors for letting me turn &#8220;Oy!&#8221; into the ear-Death Star-spider combo, or Firefox for its rigid glyph substitution?  I&#8217;m guessing that the answer depends entirely on which side of the Unicode fence you happen to stand.  For those of us who didn&#8217;t know there was a fence, there&#8217;s a bit of a feeling of a slip-and-fall right smack onto it, and that&#8217;s going to hurt no matter who you are.
</p>
]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2008/05/22/characteristic-confusion/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>line-height: abnormal</title>
		<link>http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/</link>
		<comments>http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comments</comments>
		<pubDate>Tue, 06 May 2008 15:13:56 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Standards]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/</guid>
		<description><![CDATA[I wrote the first edition of CSS:TDG back in 1999.  Almost a decade later, line layout and line heights continue to hurt me.]]></description>
			<content:encoded><![CDATA[<p>
When I first wrote <a href="http://meyerweb.com/eric/books/css-tdg/"><cite>Cascading Style Sheets: The Definitive Guide</cite></a>, the part that caused me the most difficulty and headaches was the line layout material.  Several times I was sure I had it all figured out and accurately described, only to find out I was wrong.  For two weeks I corresponded with <a href="http://hixie.ch/" rel="acquaintance colleague met">Ian Hickson</a> and <a href="http://dbaron.org/" rel="acquaintance colleague met">David Baron</a>, arguing for my understanding of things and having them show me, in merciless detail, how I was wrong.  I doubt that I will ever stop owing them for their dedication to getting me through the wilderness of my own misunderstandings.
</p>
<p>
Later on, I produced <a href="http://meyerweb.com/eric/css/inline-format.html">a terse description of line layout</a> which went through a protracted vetting process with the CSS Working Group and the members of <a href="http://lists.w3.org/Archives/Public/www-style/">www-style</a>.  At the time it was published, there was no more detailed and accurate description of line layout available.  Even at that, corrections trickled in over the years, which made me think of it as my own tiny little <a href="http://en.wikipedia.org/wiki/The_Art_of_Computer_Programming"><cite>The Art of Computer Programming</cite></a>.  Only without the small monetary reward for finding errors.
</p>
<p>
The point here is that line layout is very difficult to truly understand&#8212;even given everything I just said, I&#8217;m still not convinced that I do&#8212;and that there are often surprises lurking for anyone who goes looking into the far corners of how it happens.  As I&#8217;ve said before, my knowledge of what goes into the layout of lines of text imparts a sense of astonishment that any page can be successfully displayed in less than the projected age of the universe.
</p>
<p>
Why bring all this up?  Because I went and poked <code>line-height: normal</code> with a stick, and found it to be both squamous and rugose.  As with all driven to such madness, I now seek, grinning wildly, to infect others.
</p>
<p>
Here&#8217;s the punchline: the effects of declaring <code>line-height: normal</code> not only vary from browser to browser, which I had expected&#8212;in fact, quantifying those differences was the whole point&#8212;<em>but they also vary from one font face to another, and can also vary within a given face</em>.
</p>
<p>
I did not expect that.  At least, not consciously.
</p>
<p>
My work, let me show it to you: <a href="http://meyerweb.com/eric/css/tests/line-height/inspect-multi.html">a JavaScript-driven test file</a> where you can pick from a list of fonts and see what happens at a variety of sizes.  (Yes, the JS is completely obtrusive; and yes, the JS is the square of amateur hour.  Let&#8217;s move on, please.  I&#8217;m perfectly happy to replace what&#8217;s there with unobtrusive and sharper JS, as long as the basic point of the page, which is testing <code>line-height: normal</code>, is not compromised.  Again, moving on.)
</p>
<p>
When you first go to the test, you should (I hope) see a bunch of rulered boxes containing text using the very common font face Webdings, set at a bunch of different font sizes.  The table shows you how tall the simple line boxes are at each size, and therefore the numeric equivalent for <code>line-height: normal</code> at those sizes.  So if a line box is using <code>font-size: 50px</code> and the line box is 55 pixels tall, the numeric equivalent for <code>line-height: normal</code> is 1.1 (55 divided by 50).
</p>
<p>
On my PowerBook, Webdings always yields a 1:1 ratio between the <code>font-size</code> and line box height.  The ten-pixel font size yields a ten-pixel-tall line box, and so on.
</p>
<p>
This is actually a little surprising by itself.  <a href="http://www.w3.org/TR/CSS21/visudet.html#propdef-line-height">The CSS 2.1 specification says</a>:
</p>

<blockquote cite="http://www.w3.org/TR/CSS21/visudet.html#propdef-line-height">
<dl>
<dt><strong>normal</strong></dt>
<dd>Tells user agents to set the used value to a &#8220;reasonable&#8221; value based on the font of the element. The value has the same meaning as <a name="x23" href="http://www.w3.org/TR/CSS21/syndata.html#value-def-number" class="noxref">&lt;number&gt;</a>. We recommend a used value for &#8216;normal&#8217; between 1.0 to 1.2. The <a href="http://www.w3.org/TR/CSS21/cascade.html#computed-value">computed value</a> is &#8216;normal&#8217;.
</dd>
</dl>
</blockquote>

<p>
This is basically what CSS has said since its first days (see the equivalent text <a href="http://www.w3.org/TR/CSS1#line-height">in CSS1</a> or <a href="http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height">in CSS2</a> for confirmation) and there&#8217;s always been a widespread assumption that, since 1.0 is probably too crowded, something around 1.2 is much more likely.
</p>
<p>
So finding a value of 1 was a surprise.  It was an even bigger surprise to me that this held true in Camino 1.5.2, Firefox 2.0.0.14, and Safari 2.0.4, all on OS X.  Firefox 3b5 didn&#8217;t render Webdings at all, so I don&#8217;t know if it would do the same.  I actually suspect not, for reasons best left for another time (and, possibly, a final release of Firefox 3).
</p>
<p>
Various browsers doing the same thing in an under-specified area of the spec?  That can&#8217;t be right.  It&#8217;s pretty much an article of faith that given the chance to do <em>anything</em> differently, browsers will.  The sailing was so unexpectedly smooth that I immediately assumed was that a storm lurked just over the horizon.
</p>
<p>
Well, I was right.  All I had to do was start picking other font faces.
</p>
<p>
To start, I picked the next font on the list, Times New Roman, and the equivalent values for <code>normal</code> immediately changed.  In other words, <em>the numeric equivalents for Times New Roman are different than those for Webdings</em>.  The browsers weren&#8217;t maintaining a specific value for <code>normal</code>, but were altering it on a per-face basis.
</p>
<p>
Now, this is legal, given the way <code>normal</code> is under-specified.  There&#8217;s room to allow for this behavior.  It&#8217;s actually, once you think about it, a fairly good thing from a visual point of view: the best default line height for Times New Roman is probably not the best default line height for Courier New.  So while I was initially surprised, I got over it quickly.  The seemingly obvious conclusion was that browsers were actually respecting the fonts&#8217; built-in metrics.  This was reinforced when I found that the results were exactly the same from browser to browser.
</p>
<p>
Then I looked more closely at the numbers, and confusion set back in.  For Times New Roman, I was getting values of 1.1, 1.12, 1.16, 1.15, 1.149, and 1.1499.  If you were to round all of those numbers to two decimal points, you&#8217;d get 1.10, 1.12, 1.16, 1.15, 1.15, 1.15.  If you round them all to one decimal place, you&#8217;d get 1.1, 1.1, 1.2, 1.2, 1.1, 1.1.  They&#8217;re inconsistent.
</p>
<p>
But wait, I thought, I&#8217;m trying to compare numbers I derived by dividing pixels by pixels.  Let&#8217;s turn it around.  If I multiply the most precise measurement I&#8217;ve gotten by the various font sizes, I get&#8230; carry the two&#8230; 11.499, 28.7475, 57.495, 114.99, 1149.9, 11499.  As compared to the actual values I got, which were 11, 28, 58, 115, 1149, and 11499.
</p>
<p>
Which means the results were inappropriately rounded up in some cases and down in others.  28.7475 became 28 and 1149.9 became 1149, whereas 57.495 became 58.  Even though 11.499 became 11 and 114.99 became 115.
</p>
<p>
This was consistent across all the browsers I was testing.  So again, I was suspecting the fonts themselves.
</p>
<p>
And then I switched from Times New Roman to just plain old Times, and the storm was full upon me.  I&#8217;ll give you the results in a table.
</p>

<table class="chart">
<caption>Derived <code>normal</code> equivalents for Times in OS X browsers</caption>
<tr>
<th><code>font-size</code></th>
<th scope="col">Camino 1.5.2</th>
<th scope="col">Firefox 2.0.0.14</th>
<th scope="col">Safari 2.0.4</th>
</tr>
<tr>
<th scope="row">10
<td>1</td>
<td>1.2</td>
<td>1.3</td>
</th></tr>
<tr>
<th scope="row">25
<td>1</td>
<td>1</td>
<td>1.16</td>
</th></tr>
<tr>
<th scope="row">50
<td>1</td>
<td>1</td>
<td>1.18</td>
</th></tr>
<tr>
<th scope="row">100
<td>1</td>
<td>1</td>
<td>1.15</td>
</th></tr>
<tr>
<th scope="row">1000
<td>1</td>
<td>1</td>
<td>1.15</td>
</th></tr>
<tr>
<th scope="row">10000
<td>1</td>
<td>1</td>
<td>1.15</td>
</th></tr>
</table>

<p>
Much the same happened when comparing Courier New with plain old Courier: full consistency on Courier New between browsers, albeit with the same strange (non-)rounding effects as seen with Times New Roman; but inconsistency between browsers on plain Courier&#8212;with Camino yielding a flat 1 down the line, Firefox going from 1.2 to 1, and Safari having a range of values above the others&#8217; values.
</p>
<p>
Squamous!  Not to mention rugose!
</p>
<p>
Now it&#8217;s time for the stunning conclusion that derives from all this information, which is: not here.  Sorry.  So far all I have are observations.  I may turn all this into a summary page which shows the results for all the font faces across multiple browsers and platforms, but first I&#8217;ll need to get those numbers.
</p>
<p>
I do have a few speculations, though:
</p>

<ol>
<li>
<p>
Firefox&#8217;s inconsistency within font faces (see Times and Courier, above) may come from face substitution.  That&#8217;s when a browser doesn&#8217;t have a given character in a given face, so it looks for a substitute in another face.  If Firefox thinks it doesn&#8217;t have 10-pixel Times, it might substitute 10-pixel something else serif-ish, and that face has different line height characteristics than Times.  I don&#8217;t know what that other face might be, since it&#8217;s not Times New Roman or Georgia, but this is one possibility.  It is <strong>not</strong> the minimum font size setting in the preferences, as I&#8217;ve triple-checked to make sure I have that set to &#8220;None&#8221;.
</p>
</li>
<li>
<p>
Another possibility for Firefox&#8217;s line height weirdness is a shift from subpixel font rendering to pixelly font rendering.  10-pixel text in Firefox is distinctly pixelly compared to the other browsers I tested, while sizes above there are nice and smooth.  Why this would drive up the line height by two pixels (20%), though, is not clear to me.
</p>
</li>
<li>
<p>
Much of what I&#8217;ve observed will likely be laid to rest at the doorsteps of the font faces themselves.  I&#8217;d like to know how it is that the rounding behaviors are so (mathematically) messed up within faces, though.  Perhaps ideal line heights are described as an equation rather than a simple ratio?
</p>
</li>
</ol>

<p>
Again, this was all done in OS X; I&#8217;ll be very interested to find out what happens on Windows, Linux, and other operating systems.  Side note for the Mac Opera fans warming up their flamethrowers: I&#8217;ve left Opera 9.27 for OS X out of this because it seems to cap font sizes at a size well below 1000, although this limit varied from one face to another.  Webdings and Courier capped at 507 pixels, whereas Courier capped at 574 pixels and Comic Sans MS stopped at 707 pixels.  I have no explanation, though doubtless someone will, but the upshot is that direct comparisons between Opera and the other browsers are impossible.  For sizes up to 100 pixels, the results were exactly consistent with Camino, if that means anything.
</p>
<p>
The one tentative conclusion I did reach is this: <code>line-height: normal</code> is a jumbled terrain of inconsistent behaviors, and it&#8217;s best avoided in any sort of precision layout work.  I&#8217;d already had that feeling, but at least now there&#8217;s some evidence to back up the feeling.
</p>
<p>
In any case, I doubt this is the last I&#8217;ll have to say on this particular topic.
</p>
<p>
<strong>Update 7 May 08:</strong> I&#8217;ve updated <a href="http://meyerweb.com/eric/css/tests/line-height/inspect-multi.html">the test page</a> with <a href="http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/#comment-372941">a fix</a> from <a href="http://blowery.org/">Ben Lowery</a> so that it works in IE.  Thanks, Ben!  Now all I need is to add a way to type in any arbitrary font-family&#8217;s name, and we&#8217;ll have something everyone can use.  (Or else a way to use JavaScript to suck up the names of all the fonts installed on a machine and put them into the dropdown.  That would be cool, too.)
</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/feed/</wfw:commentRss>
		<slash:comments>58</slash:comments>
		</item>
		<item>
		<title>Acid Redux</title>
		<link>http://meyerweb.com/eric/thoughts/2008/03/27/acid-redux/</link>
		<comments>http://meyerweb.com/eric/thoughts/2008/03/27/acid-redux/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 02:22:42 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Standards]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2008/03/27/acid-redux/</guid>
		<description><![CDATA[On acid tests, browser teams, horse races, and standards.]]></description>
			<content:encoded><![CDATA[<p>
So the feeds I read have been buzzing the past few days with running commentary of the WebKit and Opera teams&#8217; race to be the first to hit 100/100 on <a href="http://acid3.acidtests.org/">Acid3</a>, and then after that the effort to get a pixel-perfect match with the reference image.  Last I saw, <a href="http://my.opera.com/desktopteam/blog/2008/03/26/opera-and-the-acid3-test">Opera claimed to have gotten to 100 first</a> but <a href="http://webkit.org/blog/173/webkit-achieves-acid3-100100-in-public-build/">it looked like WebKit had gotten both with something publicly available</a>, but I haven&#8217;t verified any of this for myself.  Nor do I have any particular plans to do so.
</p>
<p>
Because as lovely as it is to see that you can, in fact, get one or more browser implementation teams to jump in a precisely defined sequence through a series of cunningly (one might say sadistically) placed hoops, half of which are on fire and the other half lined with razor wire, it doesn&#8217;t strike me as the best possible use of the teams&#8217; time and energy.
</p>
<p>
No, I don&#8217;t hate standards, though I may hate freedom (depends on who&#8217;s asking).  What I disagree with is the idea that if you cherry-pick enough obscure and difficult corners of a bunch of different specifications and mix them all together into a spicy meatball of difficulty, it constitutes a useful test of the specifications you cherry-picked.  Because the one does not automatically follow from the other.
</p>
<p>
For example, suppose I told you that WebKit had implemented just the bits of SMIL-related SVG needed to pass the test, and that in doing so they exposed a woefully incomplete SVG implementation, one that gets something like 2% pass rates on actual SMIL/SVG tests.  Laughable, right?  <a href="http://blog.codedread.com/archives/2008/03/26/webkit-nightly-not-smiling/">Yes, well</a>.
</p>
<p>
Of course, that&#8217;s in a nightly build and they might totally support SMIL by the time the corresponding final version is released and we&#8217;ll all look back on this and laugh the carefree laugh of children in springtime.  Maybe.  The real point here is that the Acid3 test isn&#8217;t a broad-spectrum standards-support test.  It&#8217;s a showpiece, and something of a Potemkin village at that.  Which is a shame, because what&#8217;s really needed right now is exhaustive test suites for specifications&#8211; XHTML, CSS, DOM, SVG, you name it.  We&#8217;ve been seeing more of these emerge recently, but they&#8217;re not enough.  I&#8217;d have been much more firmly in the cheering section had the effort that went into Acid3 had gone into, say, an obssessively thorough DOM test suite.
</p>
<p>
I&#8217;d had this post in mind for a while now, really ever since Acid3 was released.  Then the horse race started to develop, and I told myself I really needed to get around to writing that post&#8212;and I got overtaken.  Well, that&#8217;s being busy for you.  It&#8217;s just as well I waited, really, because much of what I was going to say got covered by <a href="http://shaver.off.net/">Mike Shaver</a> in his piece <a href="http://shaver.off.net/diary/2008/03/27/the-missed-opportunity-of-acid-3/">explaining why Firefox 3 isn&#8217;t going to hit 100% on Acid3</a>.  For example:
</p>

<blockquote cite="http://shaver.off.net/diary/2008/03/27/the-missed-opportunity-of-acid-3/">
<p>
Ian&#8217;s Acid3, unlike its predecessors, is not about establishing a baseline of useful web capabilities. It&#8217;s quite explicitly about making browser developers jump&#8230; the Acid tests shouldn&#8217;t be fair to browsers, they should be fair to the <em>web</em>; they should be based on how good the web will be as a platform if all browsers conform, not about how far any given browser has to stretch to get there.
</p>
</blockquote>

<p>
That&#8217;s no doubt more concisely and clearly stated than I would have managed, so it&#8217;s all for the best that he got to say it first.
</p>
<p>
By the by, I was quite intrigued by this part of Mike&#8217;s post:
</p>

<blockquote cite="http://shaver.off.net/diary/2008/03/27/the-missed-opportunity-of-acid-3/">
<p>
You might ask why Mozilla&#8217;s not racking up daily gains, especially if you&#8217;re following the relevant bugs and seeing that people have produced patches for some issues that are covered by Acid3.
</p>
<p>
The most obvious reason is Firefox 3. We&#8217;re in the end-game of building what I really do believe is the best browser the web has ever known, and we expect to be putting it in the hands of more than 170 million users in a pretty short period of time. We&#8217;re still taking fixes for important issues, but virtually none of the issues on <a href="http://spreadsheets.google.com/pub?key=pNgBCwWdyRTT2JeiZn4B2Yw">the Acid3 list</a> are important enough for us to take at this stage. We don&#8217;t want to be rushing fixes in, or rushing out a release, only to find that we&#8217;ve broken important sites or regressed previous standards support, or worse introduced a security problem. Every API that&#8217;s exposed to content needs to be tested for compliance and security and reliability&#8230; We think these remaining late-stage patches are worth the test burden, often because they help make the web platform much more powerful, and reflect real-web compatibility and capability issues. Acid3&#8217;s contents, sadly, are not as often of that nature.
</p>
</blockquote>

<p>
You know, it&#8217;s weird, but that seems really familiar, like I&#8217;ve heard or read something like that before.  Now if only I could remember&#8230;  Oh yeah!  It&#8217;s basically <a href="http://blogs.msdn.com/ie/archive/2005/07/29/445242.aspx">what the IE team said</a> about not passing <a href="http://acid2.acidtests.org/#top">Acid2</a> when the IE7 betas came out, for which they were promptly excoriated.
</p>
<p>
Huh.
</p>
<p>
Well, never mind that now.  Of course it was a <em>totally</em> different set of circumstances and core motivations, and I&#8217;m sure there&#8217;s absolutely no parallel to be drawn between the two situations.  At <em>all</em>.
</p>
<p>
Returning to the main point here:  I&#8217;m a little bit sad, to tell the truth.  The <a href="http://www.w3.org/Style/CSS/Test/CSS1/current/test5526c.htm">original acid test</a> was a prefect example of what I think makes for a good stress test.  Recall that the test&#8217;s original name, before it got shorthanded, was the &#8220;Box Model Acid Test&#8221;.  It was a test of CSS box model handling, including floats.  That&#8217;s all it was designed to do.  It did that fairly well for its time, considering it was part of <a href="http://www.w3.org/Style/CSS/Test/CSS1/">a CSS1 test suite</a>.  It didn&#8217;t try to combine box model testing with tests for PNG support, HTML parse error recovery, and DOM scripting.
</p>
<p>
To me, the ideal CSS test suite is one that has a bunch of basic property/value tests, like the ones I&#8217;ve been responsible for creating (<a href="http://www.w3.org/Style/CSS/Test/CSS1/">1</a>, <a href="http://meyerweb.com/eric/css/tests/css2/">2</a>), along with a bunch of acid tests for specific areas or concepts in that specification.  So an acidified CSS test suite would have individual acid tests for the box model, positioning, fonts, selectors, table layout, and so on.  It would <strong>not</strong> involve scripting or markup parsing (beyond what&#8217;s needed to handle selectors).  It would <strong>not</strong> use animated SVG icons.  Hell, it probably wouldn&#8217;t even use PNGs, except possibly alphaed PNGs when testing opacity and RGBA colors.  And maybe not even then.
</p>
<p>
So in a DOM test suite, you&#8217;d have one test page for each method or attribute, and then build some acid tests out of related bits (say, on an entire interface or set of closely related interfaces).  And maybe, at the end, you&#8217;d build an overarching acid test that rolled verything in the DOM spec into one fiendishly difficult test.  But it would be <em>just about the DOM</em> and whatever absolute minimum of other stuff you needed, like text rendering and maybe GIF support.  (Similarly, the CSS tests had to assume some basic HTML and CSS selector support, or else everything else fell down.)
</p>
<p>
And then, after all those test suites have been built up and a series of acid tests woven into them, with each one culminating in its own spec-spanning acid test, you might think about taking those end-point acid tests and slamming them all together into one super-ultra-hyper-mega acid test, something that even the xenomorphs from the <cite>Alien</cite> series would look at and say, &#8220;<em>That&#8217;s</em> gonna sting&#8221;.  That would be awesome.  But that&#8217;s not what we have.
</p>
<p>
I fully acknowledge that a whole lot of very clever thinking went into the construction of Acid3 (as was true of Acid2), and that a lot of very smart people have worked very hard to pass it.  Congratulations all around, really.  I just can&#8217;t help feeling like some broader and more important point has been missed.  To me, it&#8217;s kind of like meeting the general challenge of finding an economical way to loft broadband transceivers to an altitude of 25,000 feet (in order to get full coverage of large metropolitan areas while avoiding the jetstream) by daring a bunch of teams to plant a transceiver near the summit of Mount Everest&#8212;and then getting them to do it.  Progress toward the summit can be demonstrated and kudos bestowed afterward, but there&#8217;s a wider picture that seems to have been overlooked in the process.
</p>
]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2008/03/27/acid-redux/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>Drugs, Bugs, and IE8</title>
		<link>http://meyerweb.com/eric/thoughts/2008/03/23/drugs-bugs-and-ie8/</link>
		<comments>http://meyerweb.com/eric/thoughts/2008/03/23/drugs-bugs-and-ie8/#comments</comments>
		<pubDate>Sun, 23 Mar 2008 22:04:04 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Browsers]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2008/03/23/drugs-bugs-and-ie8/</guid>
		<description><![CDATA[In which I muse on becoming a cyborg, the effects of narcotics, and the IE8 beta release.]]></description>
			<content:encoded><![CDATA[<p>
If there&#8217;s a downside to <a href="http://twitter.com/meyerweb/statuses/774695615">becoming a cyborg</a>, it&#8217;s the aftermath.  I&#8217;m not talking about the dystopian corporate-state shenanigans: those are fully expected.  No, it&#8217;s the painkillers that really suck.  They basically do their job, but at the cost of mental acuity.  That is not a trade I&#8217;m happy to make.  Granted, there were some interesting physical hallucinations that came along for the ride, but that&#8217;s nowhere near enough to balance the scales.
</p>
<p>
Here&#8217;s what I mean on that last part.  At one point yesterday, lying in bed as I had been all day, I decided it was about time to straighten out my legs, which were crossed at the ankles and starting to feel a little funny.  When I sent the relevant signals to my legs, nothing really happened.  Slowly I came to realize that nothing was happening because my legs weren&#8217;t actually crossed at all.  Furthermore, it gradually dawned on me that if the sensoria I&#8217;d been getting had been correct, it would have to mean that my legs were not only crossed at the ankles, but also attached to my body backwards.
</p>
<p>
So anyway, I thought I&#8217;d write up some of my observations (thus far) regarding <a href="http://www.microsoft.com/windows/products/winfamily/ie/ie8/readiness/">IE8 beta 1</a>.  What?
</p>
<p>
I&#8217;m going to say basically <a href="http://meyerweb.com/eric/thoughts/2006/02/03/charting-ie7b2/">the same thing I said about the first betas of IE7</a>: <strong>test and report, but don&#8217;t fix</strong>.  That is to say, you should absolutely grab it and run it across all your own sites, and all your common destinations.  Find out what&#8217;s different, broken, or just plain strange.
</p>
<p>
But don&#8217;t start searching for workarounds.  Not yet.  <a href="http://go.microsoft.com/fwlink/?LinkId=110518">Submit bug reports</a>, yes.  Boil down the problems you hit to basic test cases and submit those, if you like.  (I do like, but I&#8217;ve got kind of a history with that sort of thing.)  Just don&#8217;t think that beta 1 represents what we&#8217;ll face in the final release.
</p>
<p>
No, I don&#8217;t have some sort of inside track; never have.  That conclusion simply seems obvious to me just by looking at how this beta acts.  For example, there&#8217;s no support at all for <code>:first-line</code> and <code>:first-letter</code>.  That&#8217;s not just a glitch.  That&#8217;s a lack of support for a CSS feature that&#8217;s been present for three major releases.  I just can&#8217;t see that omission persisting to final release.
</p>
<p>
Another problem I noticed is evident here on the home page of meyerweb.  In the sidebar, each list item has a left margin and negative text indentation, creating a classic &#8220;outdent&#8221;.  Like so:
</p>

<pre>
#extra .panel li {margin-left: 1em; text-indent: -1em;}
</pre>

<p>
In each of those list items is a link of some kind, usually text.  The fun part is this: the hanging outdent part of that text isn&#8217;t clickable.  So the first couple of letters of each sidebar link are inactive.  They&#8217;re colored properly, but do nothing if you try to click them.  If you click on the active part of a link, the focus outline only draws around the active part.  And, for bonus yay, scrolling the page will wipe away any outdents that are offscreen.  So as you scroll down the page, you end up with all the sidebar links having their first few letters chopped off.  Whoops.
</p>
<p>
Again, that&#8217;s something I just can&#8217;t see going unaddressed in the final release.
</p>
<p>
In both these cases, flipping IE8 back to IE7 mode makes the weirdness go away.
</p>
<p>
I&#8217;ve seen more serious problems on the wider web.  Google Maps is currently busted beyond any hope of usefulness in IE8, as many have reported.  Also, I came across a site where loading the home page just locked up IE8 completely.  I had to force-quit and relaunch.  Every time I hit that page, lockup.
</p>
<p>
Flipping to IE7 mode allowed me to browse the site without any trouble at all.
</p>
<p>
These things, taken together, have really driven something home for me: there really is a new rendering engine in there.  I don&#8217;t just mean in the sense of fixing and adding enough things that the behavior is different.  I mean that I believe there&#8217;s truly a whole new engine under the hood of IE8.  And if the Acid 2 results and public statements of the IE team are to be believed, there&#8217;s a whole new <em>standards-based</em> rendering engine under that hood.
</p>
<p>
That&#8217;s kind of a big deal in any event.  The last time I remember a browser with an extended release history replacing its old, creaky, grown-over-time, crap-piled-on-crap engine with (what the browser team felt was) a new, improved one was the transition from Netscape 4.5 to Netscape 6.0.  And remember how well <em>that</em> went?  Yee haw.
</p>
<p>
I really shouldn&#8217;t be surprised about this.  Chris Wilson, for example, used the exact words &#8220;our new layout engine&#8221; <a href="http://www.webstandards.org/2008/02/24/wasp-round-table-ie8s-default-version-targeting-behavior/">during the WaSP roundtable</a> (<a href="http://www.glendathegood.com/wasp/transcript.html">transcript</a>).  I guess I&#8217;d been assuming that was verbal shorthand for &#8220;our much-improved version of our old layout engine&#8221;.  I guess I was wrong.
</p>
<p>
So I would personally argue that this release was mislabelled.  This is not a beta release.  As far as I&#8217;m concerned, it&#8217;s an alpha, even under the kinds of old-school naming conventions I prefer.  I&#8217;m not going to go around calling it that, because that would just be unnecessarily confusing, but it&#8217;s how I&#8217;m going to think of it.
</p>
<p>
Now I&#8217;m wondering just how long it will be until final release, given the kinds of distances one usually sees between alpha and final.
</p>
<p>
Unfortunately, I just took the 6pm set of painkillers, so I&#8217;ll be wondering at about one-third speed.
</p>
]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2008/03/23/drugs-bugs-and-ie8/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Principles and Legality</title>
		<link>http://meyerweb.com/eric/thoughts/2008/03/04/principles-and-legality/</link>
		<comments>http://meyerweb.com/eric/thoughts/2008/03/04/principles-and-legality/#comments</comments>
		<pubDate>Tue, 04 Mar 2008 14:29:32 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Standards]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/2008/03/04/principles-and-legality/</guid>
		<description><![CDATA[A little bit of divination over the reasons behind the change in version targeting.]]></description>
			<content:encoded><![CDATA[<p>
I woke up this morning (duh DAAAH dah DUH) and yesterday&#8217;s announcement was the first thing on my mind.  No doubt it&#8217;ll be a recurrent topic, at least for a little while.
</p>
<p>
One of the takeaways is what this change demonstrates about the IE team:  standards is and was their preferred default.  If it weren&#8217;t, they just would have found a way to square the IE7-default behavior with the <a href="http://www.microsoft.com/presspass/presskits/interoperability/default.mspx">Interoperability Principles</a> announced late last month (slightly tricky but entirely possible).  That they initially chose otherwise speaks volumes about the pressures they face internally, and their willingness to publicly change direction speaks volumes about their commitment to supporting standards.  While I&#8217;m sure community feedback informed their decision, they pretty much knew what the reaction would be from the get-go.  If that was going to be the deciding factor, they would&#8217;ve chosen differently up front.
</p>
<p>
So what drove that change?  I keep coming back to two things, both of which were explicitly mentioned in yesterday&#8217;s announcement.
</p>
<p>
The first is, perhaps obviously, the previously mentioned <a href="http://www.microsoft.com/interop/principles/default.mspx">Interoperability Principles</a>.  Head on over there and read Principle II, &#8220;Support for Standards&#8221;.  If that isn&#8217;t a solid foundation on which to build an internal case for change, I don&#8217;t know what is.  I&#8217;m wryly amused by the idea that the IE team used the Interoperability Principles as a way to batter their way out of the grip of those internal pressures I mentioned.  The former aikido student in me finds that very satisfying.  True, the Principles came under fire for being just another set of empty words, but it would seem that they can be used for at least some concrete good.
</p>
<p>
As for the second, there&#8217;s a phrase repeated between the two announcements that I didn&#8217;t quote yesterday because I was still pondering its meaning.  I&#8217;m still not <em>certain</em> about it, but having had a chance to sleep on it, my initial reading hasn&#8217;t changed, so I&#8217;m going to quote and comment on it now.  First, from <a href="http://www.microsoft.com/presspass/press/2008/mar08/03-03WebStandards.mspx">the press release</a>:
</p>

<blockquote cite="http://www.microsoft.com/presspass/press/2008/mar08/03-03WebStandards.mspx">
<p>
&#8220;While we do not believe there are currently any legal requirements that would dictate which rendering mode must be chosen as the default for a given browser, this step clearly removes this question as a potential legal and regulatory issue,&#8221; said Brad Smith, Microsoft senior vice president and general counsel.
</p>
</blockquote>

<p>
And then in <a href="http://blogs.msdn.com/ie/archive/2008/03/03/microsoft-s-interoperability-principles-and-ie8.aspx">Dean&#8217;s IEblog post</a>:
</p>

<blockquote cite="http://blogs.msdn.com/ie/archive/2008/03/03/microsoft-s-interoperability-principles-and-ie8.aspx">
<p>
While we do not believe any current legal requirements would dictate which rendering mode a browser must use, this step clearly removes this question as a potential legal and regulatory issue.
</p>
</blockquote>

<p>
Okay, so they&#8217;re on message.  And the message seems to be this: that <a href="http://www.opera.com/pressreleases/en/2007/12/13/">Opera&#8217;s move to link IE development to the larger EU anti-trust investigation</a> bore fruit.  I was <a href="http://meyerweb.com/eric/thoughts/2007/12/13/bad-timing/">highly critical</a> of that move, and unless I&#8217;m seriously misreading what I see here, I was wrong.  I&#8217;m still no fan of the tone that was used in announcing the move, but that&#8217;s window dressing.  Results matter most.
</p>
<p>
Speaking of Opera, there&#8217;s another side to all this that I find quite interesting.  So far, the reaction to Microsoft&#8217;s announcement has been overwhelmingly positive.  The sense I&#8217;ve picked up is, &#8220;Hooray! IE will act like browsers always have, and the problem is solved!&#8221;.
</p>
<p>
But is it?  The primary objection raised by Opera and several members of the community was that version targeting is an anti-competitive move, one which will force browser makers like Opera and authors of JavaScript libraries to support an ever-increasing and complex web (sorry) of rendering-engine behaviors in the market leader.  So far as I can tell, the change in default behavior does next to nothing to address that objection.  The various versions will still be there and still invoke-able by any page author who so chooses.  Yes, the default will be better for authors, but I don&#8217;t see how things get any better for Opera, Firefox, Safari, jQuery, Prototype, et. al.
</p>
<p>
Perhaps I&#8217;ve missed something basic (&#8220;Again!&#8221; shouts the chorus).  If so, what?  If not, then why all the hosannas?
</p>
]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2008/03/04/principles-and-legality/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
	</channel>
</rss>
