<?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; Standards</title>
	<atom:link href="http://meyerweb.com/eric/thoughts/category/tech/standards/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>Fri, 25 May 2012 13:41:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Defining ‘ch’</title>
		<link>http://meyerweb.com/eric/thoughts/2012/05/15/defining-ch/</link>
		<comments>http://meyerweb.com/eric/thoughts/2012/05/15/defining-ch/#comments</comments>
		<pubDate>Tue, 15 May 2012 13:37:03 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Standards]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1838</guid>
		<description><![CDATA[I’m working my way through a rewrite of Two Salmon (more on that anon), and I just recently came to the <code>ch</code> unit.]]></description>
			<content:encoded><![CDATA[<p>I’m working my way through a rewrite of Two Salmon (more on that anon), and I just recently came to the <code>ch</code> unit.  Its definition in <a href="http://w3.org/TR/2012/WD-css3-values-20120308/">the latest CSS Values and Units module</a> is as follows:</p>

<blockquote cite="http://w3.org/TR/2012/WD-css3-values-20120308/#ch-unit">
<dl>
<dt><dfn id=ch-unit title=ch>ch unit</dfn></dt>
<dd><p>Equal to the advance measure of the &#8220;0&#8243; (ZERO, U+0030) glyph found in the font used to render it.</p></dd>
</dl>
</blockquote>

<p>…and that’s it.  I had never heard the term “advance measure” before, and a bit of Googling for <kbd>font "advance measure"</kbd> only led me to copies of the CSS Values and Units module and some configuration files for <a href="https://www.panda3d.org/">the Panda 3D game engine</a>.  So I asked the editor and it turns out that “advance measure” is a CSS-ism that corresponds to the term “advance width”, which I had also never heard before but which yielded <em>way</em> more Google results.  Wikipedia’s <a href="http://en.wikipedia.org/wiki/Font">entry for “Font”</a> has this definition:</p>

<blockquote cite="http://en.wikipedia.org/wiki/Font#Metrics">
<p>Glyph-level metrics include … the advance width (the proper distance between the glyph&#8217;s initial pen position and the next glyph&#8217;s initial pen position)…</p>
</blockquote>

<p>My question for the font geeks in the room is this:  is that the generally accepted definition for “advance width”?  If not, is there a better definition out there; and if so, where?  I’d like to be able to recommend the best known definition for inclusion in the specification; or, if there’s no agreement as to the best, then at least a good one.  The Wikipedia definition certainly sounds good, assuming it’s accurate.  Is it?</p>

<p>In CSS terms, if I’ve understood things correctly, <code>1ch</code> is equal to the width of the character box for the glyph for “0”.  In other words, if I were to create a floated element with just a “0” and no whitespace between it and the element’s open and close tags, then the float’s width would be precisely <code>1ch</code>.  But that’s if I’ve understood things correctly.  If I haven’t, I hope I’ll be corrected soon!</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2012/05/15/defining-ch/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Linear Gradient Keywords</title>
		<link>http://meyerweb.com/eric/thoughts/2012/04/26/lineargradient-keywords/</link>
		<comments>http://meyerweb.com/eric/thoughts/2012/04/26/lineargradient-keywords/#comments</comments>
		<pubDate>Thu, 26 Apr 2012 18:54:52 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Standards]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1800</guid>
		<description><![CDATA[Linear gradients in CSS can lead to all kinds of wacky, wacky results—some of them, it sometimes seems, in the syntax itself.]]></description>
			<content:encoded><![CDATA[<p>Linear gradients in CSS can lead to all kinds of wacky, wacky results—some of them, it sometimes seems, in the syntax itself.</p>

<p>Let me note right up front that some of what I’m talking about here isn’t widely deployed yet, nor for that matter even truly set in stone.  Close, maybe, but there could still be changes.  Even if nothing actually does change, this isn’t a “news you can use <strong>RIGHT NOW</strong>” article.  Like so much of what I produce, it’s more of a stroll through a small corner of CSS, just to see what we might see.</p>

<p>For all their apparent complexity, linear gradients are pretty simple.  You define a direction along which the gradient progresses, and then list as many color stops as you like.  In doing so, you describe an image with text, sort of like SVG does.  That’s an important point to keep in mind:  a linear (or radial) gradient is an image, just as much as any GIF or PNG.  That means, among other things, that you can mix raster images and gradient images in the background of an element using the multiple background syntax.</p>

<p>But back to gradients.  Here’s a very simple gradient image:</p>

<pre><code>linear-gradient(45deg, red, blue)</code></pre>

<p>The <code>45deg</code> defines the <em>gradient line</em>, which is the line that defines how the gradient progresses.  The gradient line <strong>always</strong> passes through the center of the background area, and its specific direction is declared by you, the author.  In this case, it’s been declared to point toward the 45-degree angle.  <code>red</code> and <code>blue</code> are the color stops.  Since the colors don’t have stop distances defined, the distances are assumed to be <code>0%</code> and <code>100%</code>, respectively, which means you get a gradient blend from red to blue that progresses along the gradient line.</p>

<p>You can create hard stops, too:</p>

<pre><code>linear-gradient(45deg, green 50%, lightblue 50%)</code></pre>

<img src="http://meyerweb.com/pix/2012/04gradients01.gif" alt="Figure 1" class="pic" />

<p>That gets you the result shown in Figure 1, to which I’ve added (in Photoshop) an arrow showing the direction of the gradient line, as well as the centerpoint of the background area.  Each individual “stripe” in the gradient is perpendicular to the gradient line; that’s why the boundary between the two colors at the 50% point is perpendicular to the gradient line.  This perpendicularness is <em>always</em> the case.</p>

<p>Now, degrees are cool and all (and they’ll be changing from math angles to compass angles in order to harmonize with animations, but that’s a subject for another time), but you can also use directional keywords.  Two different kinds, as it happens.</p>

<p>The first way to use keywords is to just declare a direction, mixing and matching from the terms <code>top</code>, <code>bottom</code>, <code>right</code>, and <code>left</code>.  The funky part is that in this case, you’re declaring the direction the gradient line comes <em>from</em>, not that toward which it’s going; that is, you specify its origin instead of its destination.  So if you want your gradient to progress from the bottom left corner to the top right corner, you actually say <code>bottom left</code>:</p>

<pre><code>linear-gradient(bottom left, green 50%, lightblue 50%)</code></pre>

<img src="http://meyerweb.com/pix/2012/04gradients02.gif" alt="Figure 2" class="pic" />

<p>But <code>bottom left</code> does not equal <code>45deg</code>, unless the background area is exactly square.  If the area is not square, then the gradient line goes from one corner to another, with the boundary lines perpendicular to that, as shown in Figure 2.  Again, I added a gradient line and centerpoint in Photoshop for clarity.</p>

<p>Of course, this means that if the background area resizes in either direction, then the angle of the gradient line will also change.  Make the element taller or more narrow, and the line will rotate counter-clockwise (UK: anti-clockwise); go shorter or wider and it will rotate clockwise (UK: clockwise).  This might well be exactly what you want.  It’s certainly different than an degree angle value, which will never rotate due to changes in the background’s size.</p>

<p>The second way to use keywords looks similar, but has quite different results.  You use the same top/bottom/left/right terms, but in addition you prepend the <code>to</code> keyword, like so:</p>

<pre><code>linear-gradient(to top right, green 50%, lightblue 50%)</code></pre>

<img src="http://meyerweb.com/pix/2012/04gradients03.gif" alt="Figure 3" class="pic" />

<p>In this case, it’s clear that you’re declaring the gradient line’s destination and not its origin; after all, you’re saying <code>to top right</code>.  However, when you do it this way, you are <em>not</em> specifying the top right corner of the background area.  You’re specifying a general topward-and-rightward direction.  You can see the result of the previous sample in Figure 3; once more, Photoshop was used to add the gradient line.</p>

<p>Notice the hard-stop boundary line.  It’s actually stretching from top left to bottom right (neither of which is <code>top right</code>).  That’s because with the <code>to</code> keyword in front, you’re triggering what’s been referred to as “magic corners” behavior.  When you do this, no matter how the background area is (re)sized, that boundary line will always stretch from top left to bottom right.  Those are the magic corners.  The gradient line thus doesn’t point into the top right corner, unless the background area is perfectly square—it points into the top right quadrant (quarter) of the background area.  Apparently the term “magic quadrants” was not considered better than “magic corners”.</p>

<p>The effect of changing the background area’s size is the same as before; decreasing the height or increasing the width of the background area will deflect the gradient line clockwise, and the opposite change to either axis will produce the opposite deflection.  The only difference is the starting condition.</p>

<p>Beyond all this, if you want to use keywords that always point <em>toward</em> a corner, as in Figure 2 except specifying the destination instead of the origin, that doesn’t appear to be an option.  Similarly, neither can you declare an origin quadrant.  Having the gradient line always traverse from corner to corner means declaring the origin of the gradient line (Figure 2).  If you want the “magic corners” effect where the 50% color-stop line points from corner to corner, with the gradient line’s destination flexible, then you declare a destination quadrant (Figure 3).</p>

<p>As for actual support:  as of this writing, only Firefox and Opera support “magic corners”.  All current browsers—in Explorer’s case, that means IE10—support angles and non-magic keywords, which means Opera and Firefox support <em>both</em> keyword behaviors.  Nobody has yet switched from math angles to compass angles.  (I used <code>45deg</code> very intentionally, as it’s the same direction in either system.)</p>

<p>That’s the state of things with linear gradients right now.  I’m interested to know what you think of the various keyword patterns and behaviors—I know I had some initial trouble grasping them, and having rather different effects for the two patterns seems like it will be confusing.  What say you?</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2012/04/26/lineargradient-keywords/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Firefox Failing localStorage Due to Cookie Policy</title>
		<link>http://meyerweb.com/eric/thoughts/2012/04/25/firefox-failing-localstorage/</link>
		<comments>http://meyerweb.com/eric/thoughts/2012/04/25/firefox-failing-localstorage/#comments</comments>
		<pubDate>Wed, 25 Apr 2012 14:07:07 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1781</guid>
		<description><![CDATA[I recently stumbled over a subtle interaction between cookie policies and <code>localStorage</code> in Firefox.  Herewith, I document it for anyone who might run into the same problem (all four of you).]]></description>
			<content:encoded><![CDATA[<p>I recently stumbled over a subtle interaction between cookie policies and <code>localStorage</code> in Firefox.  Herewith, I document it for anyone who might run into the same problem (all four of you) as well as for you JS developers who are using, or thinking about using, locally stored data.  Also, there’s <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=748620">a Bugzilla report</a>, so either it’ll get fixed and then this won’t be a problem or else it will get resolved WONTFIX and I’ll have to figure out what to do next.</p>

<p>The basic problem is, every newfangled “try code out for yourself” site I hit is just failing in Firefox 11 and 12.  <a href="http://dabblet.com/">Dabblet</a>, for example, just returns a big blank page with the toolbar across the top, and none of the top-right buttons work except for the Help (“?”) button.  And I write all that in the present tense because the problem still exists as I write this.</p>

<p>What’s happening is that any attempt to access <code>localStorage</code>, whether writing or reading, returns a security error.  Here’s an anonymized example from Firefox’s error console:</p>

<p><code>Error: uncaught exception: [Exception... "Security error"  code: "1000" nsresult: "0x805303e8 (NS_ERROR_DOM_SECURITY_ERR)"  location: "http://example.com/code.js Line: 666"]</code></p>

<p>When you go to line 666, you discover it refers to <code>localStorage</code>.  Usually it’s a write attempt, but reading gets you the same error.</p>

<p>But here’s the thing: it only does this if your browser preferences are set so that, when it comes to accepting cookies, the “Keep until:” option is set to “ask me every time”.  If you change that to either of the other two options, then <code>localStorage</code> can be written and read without incident.  No security errors.  Switch it back to “ask me every time”, and the security errors come back.</p>

<p>Just to cover all the bases regarding my configuration:</p>

<ol>
<li>Firefox is <em>not</em> in Private Browsing mode.</li>
<li><code>dom.storage.default_quota</code> is <code>5120</code>.</li>
<li><code>dom.storage.enabled</code> is <code>true</code>.</li>
</ol>

<p>Also:  yes, I have my cookie policy set that way on purpose.  It might not work for you, but it definitely works for me.  “Just change your cookie policy” is the new “use a different browser” (which is the new “get a better OS”) and it ain’t gonna fly here.</p>

<p>To my way of thinking, this behavior doesn’t conform to step one of <a href="http://w3.org/TR/webstorage/#dom-localstorage"><cite>4.3 The <code>localStorage</code> attribute</cite></a>, which states:</p>

<blockquote cite="http://w3.org/TR/webstorage/#dom-localstorage"><p>The user agent may throw a <code>SecurityError</code> exception instead of returning a <code>Storage</code> object if the request violates a policy decision (e.g. if the user agent is configured to not allow the page to persist data). </p></blockquote>

<p>I haven’t configured anything to not persist data—quite the opposite—and my policy decision is not to refuse cookies, it’s to ask me about expiration times so I can decide how I want a given cookie handled.  It seems to me that, given my current preferences, Firefox ought to ask me if I want to accept local storage of data whenever a script tries to write to <code>localStorage</code>.  If that’s somehow impossible, then there should at least be a global preference for how I want to handle <code>localStorage</code> actions.</p>

<p>Of course, that’s all true only if <code>localStorage</code> data has expiration times.  If it doesn’t, then I’ve already said I’ll accept cookies, even from third-party sites.  I just want a say on their expiration times (or, if I choose, to deny the cookie through the dialog box; it’s an option).  I’m not entirely clear on this, so if someone can point to hard information on whether <code>localStorage</code> does or doesn’t time out, that would be fantastic.  I did see:</p>

<blockquote cite="http://w3.org/TR/webstorage/#dom-localstorage"><p>User agents should expire data from the local storage areas only for security reasons or when requested to do so by the user.</p></blockquote>

<p>…from <a href="http://w3.org/TR/webstorage/#dom-localstorage">the same section</a>, which to me sounds like <code>localStorage</code> doesn’t have expiration times, but maybe there’s another bit I haven’t seen that casts a new light on things.  As always, tender application of the Clue-by-Four of Enlightenment is welcome.</p>

<p>Okay, so the point of all this: if you’re getting <code>localStorage</code> failures in Firefox, check your cookies expiration policy.  If that’s the problem, then at least you know how to fix it—or, as in my case, why you’ll continue to have <code>localStorage</code> problems for the next little while.  Furthermore, if you’re writing JS that interacts with <code>localStorage</code> or a similar local-data technology, <em>please</em> make sure you’re looking for security exceptions and other errors, and planning appropriate fallbacks.</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2012/04/25/firefox-failing-localstorage/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Whitespace in CSS Calculations</title>
		<link>http://meyerweb.com/eric/thoughts/2012/04/10/whitespace-in-css-calculations/</link>
		<comments>http://meyerweb.com/eric/thoughts/2012/04/10/whitespace-in-css-calculations/#comments</comments>
		<pubDate>Tue, 10 Apr 2012 15:00:12 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Standards]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1747</guid>
		<description><![CDATA[I’ve been messing around with native calculated values in CSS, and there’s something a bit surprising buried in the value format.]]></description>
			<content:encoded><![CDATA[<p>I’ve been messing around with native calculated values in CSS, and there’s something a bit surprising buried in the value format.  To quote the <a href="http://www.w3.org/TR/css3-values/">CSS3 Values and Units specification</a>:</p>

<blockquote cite="http://www.w3.org/TR/css3-values/#calc"><p>Note that the grammar requires spaces around binary ‘+’ and ‘-’ operators. The ‘*’ and ‘/’ operators do not require spaces.</p></blockquote>

<p>In other words, two out of four calculation operators require whitespace around them, and for the other two it doesn’t matter.  Nothing like consistency, eh?</p>

<p>This is why you see examples like this:</p>

<pre><code>width: calc(100%/3 - 2*1em - 2*1px);</code>
</pre>

<p>That’s actually the minimum number of characters you need to write that particular expression, so far as I can tell.  Given the grammar requirements, you could legitimately rewrite that example like so:</p>

<pre><code>width: calc(100% / 3 - 2 * 1em - 2 * 1px);</code>
</pre>

<p>…but <strong>not</strong> like so:</p>

<pre><code>width: calc(100%/3-2*1em-2*1px);</code>
</pre>

<p>The removal of the spaces around the ‘-’ operators means the whole value is invalid, and will be discarded outright by browsers.</p>

<p>We can of course say that this last example is kind of unreadable and so it’s better to have the spaces in there, but the part that trips me up is the general inconsistency in whitespace requirements.  There are apparently very good reasons, or at least very historical reasons, why the spaces around ‘+’ and ‘-’ are necessary.  In which case, I personally would have required spaces around all the operators, just to keep things consistent.  But maybe that’s just me.</p>

<p>Regardless, this is something to keep in mind as we move forward into an era of wider browser support for <code>calc()</code>.</p>

<p>Oh, and by the way, the specification also says:</p>

<blockquote cite="http://www.w3.org/TR/css3-values/#calc"><p>The ‘calc()’ expression represents the result of the mathematical calculation it contains, using standard operator precedence rules.</p></blockquote>

<p>Unfortunately, the specification doesn’t seem to actually define these “standard operator precedence rules”.  This makes for some interesting ambiguities because, as with most standards, <a href="http://en.wikipedia.org/wiki/Order_of_operations#Mnemonics">there are so many to choose from</a>.  For example, <code>3em / 2 * 3</code> could be “three em divided by two, with the result multiplied by three” (thus 4.5em) or “three em divided by six” (thus 0.5em), depending on whether you privilege multipliers over dividers or vice versa.</p>

<p>I’ve looked around the Values and Units specification but haven’t found any text defining the actual rules of precedence, so I’m going to assume US rules (which would yield 4.5em) unless proven otherwise.  <a href="http://meyerweb.com/eric/css/tests/calc.html">Initial testing</a> seems to bear this out, but not every browser line supports these sorts of expressions yet, so there’s still plenty of time for them to introduce inconsistencies.  If you want to be clear about how you want your operators to be resolved, use parentheses: they trump all.  If you want to be sure <code>3em / 2 * 3</code> resolves to 4.5em, then write it <code>(3em / 2) * 3</code>, or <code>(3em/2)*3</code> if you care to use inconsistent whitespacing.</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2012/04/10/whitespace-in-css-calculations/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Customizing Your Markup</title>
		<link>http://meyerweb.com/eric/thoughts/2012/03/28/customizing-your-markup/</link>
		<comments>http://meyerweb.com/eric/thoughts/2012/03/28/customizing-your-markup/#comments</comments>
		<pubDate>Wed, 28 Mar 2012 14:55:49 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[(X)HTML]]></category>
		<category><![CDATA[Commentary]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Microformats]]></category>
		<category><![CDATA[semantic web]]></category>
		<category><![CDATA[Standards]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1713</guid>
		<description><![CDATA[HTML5 allows you (at the moment) to create your own custom elements.  Only, not really.]]></description>
			<content:encoded><![CDATA[<p>So HTML5 allows you (at the moment) to create your own custom elements.  Only, not really.</p>

<p><em>(Ed. note: this post has been corrected since its publication, and <a href="http://meyerweb.com/eric/thoughts/2012/04/10/element-customization/">a followup clarification has been posted</a>.)</em></p>

<p>Suppose you’re creating a super-sweet JavaScript library to improve text presentation—like, say, <a href="http://typebutter.com/">TypeButter</a>—and you need to insert a bunch of elements that won’t accidentally pick up pre-existing CSS.  That rules <code>span</code> right out the door, and anything else would be either a bad semantic match, likely to pick up CSS by mistake, or both.</p>

<p>Assuming you don’t want to spend the hours and lines of code necessary to push ahead with <code>span</code> and a whole lot of dynamic CSS rewriting, the obvious solution is to invent a new element and drop that into place.  If you’re doing kerning, then a <code>kern</code> element makes a lot of sense, right?  Right.  And you can certainly do that in browsers today, as well as years back.  Stuff in a new element, hit it up with some CSS, and you’re done.</p>

<p>Now, how does this fit with the HTML5 specification?  Not at all well.  HTML5 does <em>not</em> allow you to invent new elements and stuff them into your document willy-nilly.  You can’t even do it with a prefix like <code>x-kern</code>, because hyphens aren’t valid characters for element names (unless I read <a href="http://www.w3.org/TR/html5/syntax.html#syntax-tag-name">the rules</a> incorrectly, which is always possible).</p>

<p>No, here’s what you do instead <ins datetime="2012-04-10T18:58:15+00:00">(corrected 10 Apr 12)</ins>:</p>

<ol>
<li><del datetime="2012-04-10T18:58:15+00:00">Wrap your document, or at least the portion of it where you plan to use your custom markup,</del><ins datetime="2012-04-10T18:58:15+00:00">Define the element customization you want</ins> with an <code>element</code> element.  That’s not a typo.</li>
<li>To your <code>element</code> element, add an <code>extends</code> attribute whose value is the HTML5 element you plan to extend.  We’ll use <code>span</code>, but you can extend any element.</li>
<li>Now add a <code>name</code> attribute that names your custom “element” name, like <code>x-kern</code>.</li>
<li>Okay, you’re ready!  Now anywhere you want to add a customized element, drop in the elements named by <code>extends</code> and then supply the <code>name</code> via an <code>is</code> attribute.</li>
</ol>

<p>Did you follow all that?  No?  Okay, maybe this will make it a bit less unclear.  <ins datetime="2012-04-10T18:58:15+00:00">(Note: the following code block was corrected 10 Apr 12.)</ins></p>

<pre><code>&lt;element extends="span" name="x-kern"&gt;&lt;/element&gt;
&lt;h1&gt;
&lt;span is="x-kern" style="…"&gt;A&lt;/span&gt;
&lt;span is="x-kern" style="…"&gt;u&lt;/span&gt;
&lt;span is="x-kern" style="…"&gt;t&lt;/span&gt;
&lt;span is="x-kern" style="…"&gt;u&lt;/span&gt;
mn
&lt;/h1&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
</code></pre>

<p>(Based on markup taken from the <a href="http://typebutter.com/demo/">TypeButter demo page</a>.  I simplified the inline <code>style</code> attributes that TypeButter generates for purposes of clarity.)</p>

<p>So that’s <a href="http://dvcs.w3.org/hg/webcomponents/raw-file/tip/explainer/index.html#custom-element-section">how you create “custom elements” in HTML5 as of now</a>.  Which is to say, you don’t.  All you’re doing is attaching a label to an existing element; you’re sort of customizing an existing element, not creating a customized element.  That’s not going to help prevent CSS from being mistakenly applied to those elements.</p>

<p>Personally, I find this a really, really, <em>really</em> clumsy approach—so clumsy that I don’t think I could recommend its use.  Given that browsers will accept, render, and style arbitrary elements, I’d pretty much say to just go ahead and do it.  Do try to name your elements so they won’t run into problems later, such as prefixing them with an “x” or your username or something, but since browsers support it, may as well capitalize on their capabilities.</p>

<p>I’m not in the habit of saying that sort of thing lightly, either.  While I’m not the wild-eyed standards-or-be-damned radical some people think I am, I have always striven to play within the rules when possible.  Yes, there are always situations where you work counter to general best practices or even the rules, but I rarely do so lightly.  As an example, my co-founders and I went to some effort to play nice when we created the principles for <a href="http://microformats.org/">Microformats</a>, segregating our semantics into attribute values—but only because <a href="http://tantek.com/" rel="friend colleague muse met">Tantek</a>, <a href="http://ma.tt/" rel="friend met">Matt</a>, and I cared a <em>lot</em> about long-term stability and validation.  We went as far as necessary to play nice, and not one millimeter further, and all the while we wished mightily for the ability to create custom attributes and elements.</p>

<p>Most people aren’t going to exert that much effort: they’re going to see that something works and never stop to question if what they’re doing is valid or has long-term stability.  “If the browser let me do it, it must be okay” is the background assumption that runs through our profession, and why wouldn’t it?  It’s an entirely understandable assumption to make.</p>

<p>We need something better.  My personal preference would be to expand the “<a href="http://www.w3.org/TR/html5/syntax.html#foreign-elements">foreign elements</a>” definition to encompass any unrecognized element, and let the parser deal with any structural problems like lack of well-formedness.  Perhaps also expand the rules about element names to permit hyphens, so that we could do things like <code>x-kern</code> or <code>emeyer-disambiguate</code> or whatever.  I could even see my way clear to defining an way to let an author list their customized elements.  Say, something like <code>&lt;meta name=&quot;custom-elements&quot; content=&quot;kern lead follow embiggen shrink&quot;/&gt;</code>.  I just made that up off the top of my head, so feel free to ignore the syntax if it’s too limiting. The general concept is what’s important.</p>

<p>The creation of customized elements isn’t a common use case, but it’s an incredibly valuable ability, and people are going to do it.  They’re <em>already</em> doing it, in fact.  It’s important to figure out how to make the process of doing so simpler and more elegant.</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2012/03/28/customizing-your-markup/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Invented Elements</title>
		<link>http://meyerweb.com/eric/thoughts/2012/03/23/invented-elements/</link>
		<comments>http://meyerweb.com/eric/thoughts/2012/03/23/invented-elements/#comments</comments>
		<pubDate>Fri, 23 Mar 2012 14:16:58 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[(X)HTML]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1703</guid>
		<description><![CDATA[This morning I caught <a href="https://twitter.com/#!/fontdeck/status/183176353347153920">a pointer</a> to <a href="http://typebutter.com/">TypeButter</a>, and I’m very interested by how TypeButter accomplishes its kerning.]]></description>
			<content:encoded><![CDATA[<p>This morning I caught <a href="https://twitter.com/#!/fontdeck/status/183176353347153920">a pointer</a> to <a href="http://typebutter.com/">TypeButter</a>, which is a jQuery library that does “optical kerning” in an attempt to improve the appearance of type.  I’m not going to get into its design utility because I’m not qualified; I only notice kerning either when it’s set insanely wide or when it crosses over into <a href="http://www.ironicsans.com/2008/02/idea_a_new_typography_term.html">keming</a>.  I suppose I’ve been looking at web type for so many years, it looks normal to me now.  (Well, <em>almost</em> normal, but I’m not going to get into my personal typographic idiosyncrasies now.)</p>

<p>My reason to bring this up is that I’m very interested by how TypeButter accomplishes its kerning: it inserts <code>kern</code> elements with inline <code>style</code> attributes that bear <code>letter-spacing</code> values.  Not <code>span</code> elements, <code>kern</code> elements.  No, you didn’t miss an HTML5 news bite; there is no <code>kern</code> element, nor am I aware of a plan for one.  TypeButter basically invents a specific-purpose element.</p>

<p>I believe I understand the reasoning.  Had they used <code>span</code>, they would’ve likely tripped over existing author styles that apply to <code>span</code>.  Browsers these days don’t really have a problem accepting and styling arbitrary elements, and any that do would simply render type their usual way.  Because the markup is script-generated, markup validation services don’t throw conniption fits.  There might well be browser performance problems, particularly if you <a href="http://cdn.memegenerator.net/instances/400x/17134306.jpg">optically kern <strong>all</strong> the things</a>, but used in moderation (say, on headings) I wouldn’t expect too much of a hit.</p>

<p>The one potential drawback I can see, as <a href="https://twitter.com/#!/jaffathecake/status/183183488550318080">articulated by Jake Archibald</a>, is the possibility of a future <code>kern</code> element that might have different effects, or at least be styled by future author CSS and thus get picked up by TypeButter’s <code>kern</code>s.  The currently accepted way to avoid that sort of problem is to prefix with <code>x-</code>, as in <code>x-kern</code>.  Personally, I find it deeply unlikely that there will ever be an official <code>kern</code> element; it’s too presentationally focused.  But, of course, one never knows.</p>

<p>If TypeButter shifted to generating <code>x-kern</code> before reaching v1.0 final, I doubt it would degrade the TypeButter experience at all, and it would indeed be more future-proof.  It’s likely worth doing, if only to set a good example for libraries to follow, unless of course there’s downside I haven’t thought of yet.  It’s definitely worth discussing, because as more browser enhancements are written, this sort of issue will come up more and more.  Settling on some community best practices could save us some trouble down the road.</p>

<p><strong>Update 23 Mar 12:</strong> it turns out custom elements are not as simple as we might prefer; see <a href="http://meyerweb.com/eric/thoughts/2012/03/23/invented-elements/?#comment-653402">the comment below</a> for details.  That throws a fairly large wrench into the gears, and requires further contemplation.</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2012/03/23/invented-elements/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>“The Vendor Prefix Predicament” at ALA</title>
		<link>http://meyerweb.com/eric/thoughts/2012/02/14/the-vendor-prefix-predicament-at-ala/</link>
		<comments>http://meyerweb.com/eric/thoughts/2012/02/14/the-vendor-prefix-predicament-at-ala/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 18:11:36 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[W3C]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1652</guid>
		<description><![CDATA[Published this morning in A List Apart #344: an interview I conducted with Tantek Çelik, web standards lead at Mozilla, on the subject of Mozilla’s plan to honor -webkit- prefixes on some properties in their mobile browser. Even better: Lea Verou’s Every Time You Call a Proprietary Feature ‘CSS3,’ a Kitten Dies. Please—think of the [...]]]></description>
			<content:encoded><![CDATA[<p>Published this morning in <a href="http://alistapart.com/">A List Apart</a> #344: <a href="http://www.alistapart.com/articles/the-vendor-prefix-predicament-alas-eric-meyer-interviews-tantek-celik/">an interview I conducted with Tantek Çelik</a>, web standards lead at Mozilla, on the subject of Mozilla’s plan to honor <code>-webkit-</code> prefixes on some properties in their mobile browser.  Even better: Lea Verou’s <a href="http://www.alistapart.com/articles/every-time-you-call-a-proprietary-feature-css3-a-kitten-dies/">Every Time You Call a Proprietary Feature ‘CSS3,’ a Kitten Dies</a>.  Please—think of the kittens!</p>

<p>My hope is that the interview brings clarity to a situation that has suffered from a number of misconceptions.  I do not necessarily hope that you agree with Tantek, nor for that matter do I hope you disagree.  While I did press him on certain points, my goal for the interview was to provide him a chance to supply information, and insight into his position.  If that job was done, then the reader can fairly evaluate the claims and plans presented.  What conclusion they reach is, as ever, up to them.</p>

<p>We’ve learned a lot over the past 15-20 years, but I’m not convinced the lessons have settled in deeply enough.  At any rate, there are interesting times ahead.  If you care at all about the course we chart through them, be involved now.  Discuss.  Deliberate.  Make your own case, or support someone else’s case if they’ve captured your thoughts.  Debate with someone who has a different case to make.  Don’t just sit back and assume everything will work out—for while things usually do work out, they don’t always work out for the best.  Push for the best.</p>

<p>And fix your browser-specific sites already!</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2012/02/14/the-vendor-prefix-predicament-at-ala/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Unfixed</title>
		<link>http://meyerweb.com/eric/thoughts/2012/02/09/unfixed/</link>
		<comments>http://meyerweb.com/eric/thoughts/2012/02/09/unfixed/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 18:37:49 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[W3C]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1622</guid>
		<description><![CDATA[Vendor prefixes may soon be a thing of the past, and in the worst possible way.]]></description>
			<content:encoded><![CDATA[<p>Right in the middle of AEA Atlanta—which was <em>awesome</em>, I really must say—there were two announcements that stand to invalidate (or at least greatly alter) portions of the talk I delivered.  One, which I believe came out as I was on stage, was the publication of <a href="http://www.w3.org/TR/2012/WD-css3-positioning-20120207/">the latest draft of the CSS3 Positioned Layout Module</a>.  We’ll see if it triggers change or not; I haven’t read it yet.</p>

<p>The other was the publication of <a href="http://lists.w3.org/Archives/Public/www-style/2012Feb/0313.html">the minutes of the CSS Working Group meeting in Paris</a>, where it was revealed that several vendors are about to support the <code>-webkit-</code> vendor prefix in their own very non-WebKit browsers.  Thus, to pick but a single random example, Firefox would throw a drop shadow on a heading whose entire author CSS is <code>h1 {-webkit-box-shadow: 2px 5px 3px gray;}</code>.</p>

<p>As an author, it sounds good as long as you haven’t really thought about it very hard, or if perhaps you have a very weak sense of the history of web standards and browser development.  It fits right in with the recurring question, “Why are we screwing around with prefixes when vendors should just implement properties completely correctly, or not at all?”  Those idealized end-states always sound great, but years of evidence (and reams upon reams of bug-charting material) indicate it’s an unrealistic approach.</p>

<p>As a vendor, it may be the least bad choice available in an ever-competitive marketplace.  After all, if there were a few million sites that you could render as intended if only the authors used your prefix instead of just one, which would you rather: embark on a protracted, massive awareness campaign that would probably be contradicted to death by people with their own axes to grind; or just support the damn prefix and move on with life?</p>

<p>The practical upshot is that browsers “supporting alien CSS vendor prefixes”, <a href="http://www.netmagazine.com/news/css-vendor-prefixes-threaten-open-web-121757">as Craig Grannell put it</a>, seriously cripples the whole concept of vendor prefixes.  It may well reduce them to outright pointlessness.  I am <a href="http://alistapart.com/articles/prefix-or-posthack/">on record as being a fan of vendor prefixes</a>, and furthermore as someone who advocated for the formalization of prefixing as a part of the specification-approval process.  Of course I still think I had good ideas, but those ideas are currently being sliced to death on the shoals of reality.  Fingers can point all they like, but in the end what matters is what happened, not what should have happened if only we’d been a little smarter, a little more angelic, whatever.</p>

<p>I’ve seen a proposal that vendors agree to only support other prefixes in cases where they are un-prefixing their own support.  To continue the previous example, that would mean that when Firefox starts supporting the bare <code>box-shadow</code>, they will also support <code>-webkit-box-shadow</code> (and, one presumes, <code>-ms-box-shadow</code> and <code>-o-box-shadow</code> and so on).  That would mitigate the worst of the damage, and it’s probably worth trying.  It could well buy us a few years.</p>

<p>Developers are also trying to help repair the damage before it’s too late.  Christian Heilmann has <a href="http://christianheilmann.com/2012/02/09/now-vendor-prefixes-have-become-a-problem-want-to-help-fix-it/">launched an effort to get GitHub-based projects updated</a> to stop being WebKit-only, and Aarron Gustafson <a href="http://blog.easy-designs.net/archives/2012/02/09/this-must-not-happen/">has published a UNIX command to find all your CSS files containing <code>webkit</code></a> along with a call to update anything that’s not cross-browser friendly.  Others are making similar calls and recommendations.  You could use <a href="http://leaverou.github.com/prefixfree/">PrefixFree</a> as a quick stopgap while going through the effort of doing manual updates.  You could make sure your CSS pre-processor, if that’s how you swing, is set up to do auto-prefixing.</p>

<p>Non-WebKit vendors are in a corner, and we helped put them there.  If the proposed prefix change is going to be forestalled, we have to get them out.  Doing that will take a lot of time and effort and awareness and, above all, widespread interest in doing the right thing.</p>

<p>Thus my fairly deep pessimism.  I’d love to be proven wrong, but I have to assume the vendors will push ahead with this regardless.  It’s <a href="http://meyerweb.com/eric/thoughts/2008/01/24/almost-target/">what we did at Netscape ten years ago</a>, and almost certainly would have done despite any outcry.  I don’t mean to denigrate or undermine any of the efforts I mentioned before—they’re absolutely worth doing even if every non-WebKit browser starts supporting <code>-webkit-</code> properties next week.  If nothing else, it will serve as evidence of your commitment to professional craftsmanship.  The real question is: how many of your fellow developers come close to that level of commitment?</p>

<p>And I identify that as the real question because it’s the question vendors are asking—<em>must</em> ask—themselves, and the answer serves as the compass for their course.</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2012/02/09/unfixed/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>CSS Editors Leaderboard</title>
		<link>http://meyerweb.com/eric/thoughts/2011/02/04/css-editors-leaderboard/</link>
		<comments>http://meyerweb.com/eric/thoughts/2011/02/04/css-editors-leaderboard/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 20:15:29 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[W3C]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1478</guid>
		<description><![CDATA[My attempt to rank the various editors of CSS modules based on the current process status of their modules, how current the modules are, and so on.]]></description>
			<content:encoded><![CDATA[<p>I recently decided to create a <a href="http://meyerweb.com/eric/css/editors/">CSS Editors Leaderboard</a>, which is my attempt to rank the various editors of CSS modules based on the current process status of their modules, how current the modules are, and so on.  It&#8217;s kind of a turn of the wheel for me, given that I started out my CSS career with browser support leaderboards.  Now you can see who&#8217;s amassed the most spec points, and who&#8217;s made the most effective use of their time and energy.  Who knows?  Maybe some editors will try to game the system by pushing their specs along the process track.  That&#8217;d be just <em>awful</em>.</p>

<p>One thing of note: I decided to write the leaderboard script so that it directly parses an HTML file to figure out the rankings.  You can <a href="http://meyerweb.com/eric/css/editors/editors.html">see the file yourself</a>, if you like.  At the moment it&#8217;s just a bunch of <tt>dl</tt>s, but at some point I suspect I&#8217;ll convert it to a table.  The advantage is that it&#8217;s easier for other people to fact-check the source data this way: just load it up in a browser.</p>

<p>I thought about just parsing specs directly but it seemed like overkill to load the entirety of the CSS2.1 module just to figure out the process status, publication date, and editor list.  And then do that same thing for every one of the 38 tracked modules.  This way I have the leaderboard <em>and</em> a central summary of the modules&#8217; status, and hopefully the latter will be even more human-readable in the future.</p>

<p>Anyway, it was a fun little project and now it&#8217;s loose in the world.  Enjoy.</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2011/02/04/css-editors-leaderboard/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Vendor Prefix Lists</title>
		<link>http://meyerweb.com/eric/thoughts/2010/10/08/vendor-prefix-lists/</link>
		<comments>http://meyerweb.com/eric/thoughts/2010/10/08/vendor-prefix-lists/#comments</comments>
		<pubDate>Fri, 08 Oct 2010 15:51:19 +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=1386</guid>
		<description><![CDATA[At the prompting of an inquiry from a respected software vendor, I asked The Twitters for pointers to "canonical" lists of vendor-prefixed properties, values, and selectors.  Here's what the crowd sourced at me.]]></description>
			<content:encoded><![CDATA[<p>
At the prompting of an inquiry from a respected software vendor, <a href="https://twitter.com/meyerweb/status/26579041578">I asked The Twitters</a> for pointers to &#8220;canonical&#8221; lists of vendor-prefixed properties, values, and selectors.  Here&#8217;s what the crowd sourced at me:
</p>

<ul>
	<li><a href="http://msdn.microsoft.com/en-us/library/ms531207(VS.85).aspx">Microsoft</a><sup>†</sup></li>
	<li><a href="https://developer.mozilla.org/en/CSS_Reference/Mozilla_Extensions">Mozilla</a></li>
	<li><a href="http://www.opera.com/docs/specs/presto26/css/o-vendor/">Opera</a></li>
	<li><a href="http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariCSSRef/Articles/StandardCSSProperties.html">Safari</a><sup>†</sup></li>
</ul>

<p class="note"><sup>†</sup>Lists more than just prefixed properties, values, and so on.</p>
<p>
While there&#8217;s no guarantee of completeness or accuracy, these are at least what the vendors themselves provide and so we can cling to some hope of both.  I was also pointed to the following third-party lists:
</p>

<ul>
<li><a href="http://peter.sh/experiments/vendor-prefixed-css-property-overview/">Vendor-prefixed CSS Property Overview &laquo;  Peter Beverloo</a></li>
<li><a href="http://qooxdoo.org/documentation/general/webkit_css_styles">qooxdoo &raquo; WebKit CSS Styles</a></li>
<li><a href="http://css-infos.net/properties/webkit.php">CSS Infos : Webkit CSS Properties</a></li>
<li><a href="http://css-infos.net/properties/firefox.php">CSS Infos : Firefox CSS Properties</a></li>
</ul>

<p>
If you know of great vendor-prefix lists that aren&#8217;t listed here, particularly anything from the vendors themselves, please let us know in the comments!
</p>

<p>
Somewhat if not obviously related: does anyone know of a way to add full Textile support to BBEdit 9.x?  Having it be a Unix filter is fine.  I know BBEdit already supports Markdown, but since Basecamp uses Textile and lots of people I work with use Basecamp, I&#8217;d like stick to one syntax rather than confuse myself trying to switch between two similar syntaxes.
</p>
]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2010/10/08/vendor-prefix-lists/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>In Defense of Vendor Prefixes</title>
		<link>http://meyerweb.com/eric/thoughts/2010/07/07/in-defense-of-vendor-prefixes/</link>
		<comments>http://meyerweb.com/eric/thoughts/2010/07/07/in-defense-of-vendor-prefixes/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 17:53:44 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Writing]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1360</guid>
		<description><![CDATA[In a fairly quick <cite>A List Apart</cite> article, I make the case that vendor prefixes are not only good, they have the potential to be great <em>and</em> to deliver greater interoperability and advancement of CSS.]]></description>
			<content:encoded><![CDATA[<a href="http://alistapart.com/articles/prefix-or-posthack/"><img src="http://meyerweb.com/pix/2010/prefix-or-posthack-crop.png" alt="" class="pic left" /></a>
<p>
&#8230;that having been the original working title for &#8220;<a href="http://alistapart.com/articles/prefix-or-posthack/">Prefix or Posthack</a>&#8220;, my latest article for <a href="http://alistapart.com/">A List Apart</a>.  (Sort of like <cite>Return of the Jedi</cite> had a working title of <cite>Blue Harvest</cite>.)  In a fairly quick read, I make the case that vendor prefixes are not only good, they have the potential to be great <em>and</em> to deliver greater interoperability and advancement of CSS.
</p>
<p>
So far the reaction has been overwhelmingly positive, which frankly came as a bit of a surprise.  The annoyance factor of prefixes is undeniable, and it&#8217;s been my experience that annoyance dramatically hardens opposition regardless of whether or not there are good reasons to oppose.  I could flatter myself that the agreement is due to the Obvious Rightness of my argument, but I suspect it&#8217;s actually that I merely articulated what most people had already instinctively decided for themselves.  Which isn&#8217;t a bad place to be.
</p>
<p>
Anyway, if you haven&#8217;t already, feel free to decide for yourself by <a href="http://alistapart.com/articles/prefix-or-posthack/">reading the article</a>—which, I feel like mentioning for no clear reason, is only the fourth piece I&#8217;ve ever written for ALA.
</p>
]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2010/07/07/in-defense-of-vendor-prefixes/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>The Web Stack</title>
		<link>http://meyerweb.com/eric/thoughts/2010/05/19/the-web-stack/</link>
		<comments>http://meyerweb.com/eric/thoughts/2010/05/19/the-web-stack/#comments</comments>
		<pubDate>Wed, 19 May 2010 14:43:00 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1343</guid>
		<description><![CDATA[Following on <a href="http://meyerweb.com/eric/thoughts/2010/05/07/web-2-0-talk-html5-vs-flash/">my "HTML5 vs. Flash" talk</a> of a couple of weeks ago, I'm hoping to do a bit of blogging about HTML5, Flash, mobile apps, and more.  But first I need to get some terminology straight.]]></description>
			<content:encoded><![CDATA[<p>
Following on <a href="http://meyerweb.com/eric/thoughts/2010/05/07/web-2-0-talk-html5-vs-flash/">my &#8220;HTML5 vs. Flash&#8221; talk</a> of a couple of weeks ago, I&#8217;m hoping to do a bit of blogging about HTML5, Flash, mobile apps, and more.  But first I need to get some terminology straight.
</p>
<p>
As I did in my talk, I&#8217;m going to refer to the collection of front-end web-standards technologies—(X)HTML (of any flavor), CSS, and JavaScript—as &#8220;the web stack&#8221;.  I&#8217;ve seen the term used here and there and it makes the most sense to me as a condensed verbal shorthand.  It beats writing out the specific technologies every time or trying to use similarly clumsy constructions like &#8220;front-end tech&#8221;.  If you like, think of &#8220;web stack&#8221; as a rough equivalent to &#8220;Ajax&#8221;—a term that was invented because continually saying &#8220;asynchronous JavaScript + CSS + DOM + XMLHttpRequest&#8221; was unworkable.
</p>
<p>
The web stack sort of includes downloadable fonts, but only in the same sense that images or any other external resource is part of the stack.  SImilarly, it encompasses frameworks like jQuery in the sense that they&#8217;re built out of the components of the web stack.
</p>
<p>
When I use the term &#8220;web stack&#8221;, though, I&#8217;m not referring to back-end technologies.  Those things are important, certainly, but not from the front-end point of view.  A browser doesn&#8217;t care if your page was generated by PHP, Django, Rails, Perl, or what have you.  It doesn&#8217;t even care if the server runs on Apache or something else.
</p>
<p>
Furthermore, it doesn&#8217;t refer to plugins.  Yes, that means Flash, but it also means QuickTime, Real, ActiveX, and so forth.  What I need to make clear is that I&#8217;m not doing this in an attempt to imply that plugins don&#8217;t belong on the web at all.  They&#8217;re just not part of that core web stack any more than the web stack is part of them.  That doesn&#8217;t stop them working together, obviously.
</p>
<p>
Okay, so that&#8217;s out of the way, and I hope my meaning is sufficiently clear to everyone.  Please do leave a comment if it isn&#8217;t.  Onward!
</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2010/05/19/the-web-stack/feed/</wfw:commentRss>
		<slash:comments>44</slash:comments>
		</item>
		<item>
		<title>MIXmasters</title>
		<link>http://meyerweb.com/eric/thoughts/2010/02/24/mixmasters/</link>
		<comments>http://meyerweb.com/eric/thoughts/2010/02/24/mixmasters/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 21:22:46 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Standards]]></category>

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