<?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>Wed, 05 Jun 2013 17:16:07 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Unsupportable Promises</title>
		<link>http://meyerweb.com/eric/thoughts/2013/03/19/unsupportable-promises/</link>
		<comments>http://meyerweb.com/eric/thoughts/2013/03/19/unsupportable-promises/#comments</comments>
		<pubDate>Tue, 19 Mar 2013 16:01:42 +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=2183</guid>
		<description><![CDATA[What do <em>you</em> think <code>@supports</code> means?]]></description>
				<content:encoded><![CDATA[<p>Over the past year and a half, the CSS Working Group has been working on a <a href="http://www.w3.org/TR/css3-conditional/">CSS Conditional Rules Module Level 3</a> module.  Now, don’t get overexcited: this is not a proposal to add generalized, formal if/then/else or switch statements to CSS—though in a very limited way, it does just that.  This is the home of the <a href="http://www.w3.org/TR/css3-conditional/#at-media"><code>@media</code> rule</a>, which lets you create if/then conditions with regard to the media environment.  It’s also the home of the <a href="http://www.w3.org/TR/css3-conditional/#at-supports"><code>@supports</code> rule</a>, which lets you…well, that’s actually more complicated than you might think.</p>

<p>I mean, what do <em>you</em> think <code>@supports</code> means?  Take a moment to formulate a one-line definition of your understanding of what it does, before moving on to the rest of this piece.</p>

<p>If you’ve never heard of it before and wonder how it works, here’s a very basic example:</p>

<pre><code>body {background-color: white;}
@supports (background-color: cornflowerblue) {
	body {background-color: cornflowerblue;}
}
</code></pre>

<p>The idea is that if the browser supports that property:value combination, then it will apply the rule or rules found inside the curly brackets.  In this sense, it’s just like <code>@media</code> rules: if the conditions in the parentheses are deemed to apply, then the rules inside the declaration block are used.  The module refers to this ability as “feature queries”.</p>

<p>There are some logical combination keywords available: <code>and</code>, <code>or</code>, and <code>not</code>.  So you can say things like:</p>

<pre><code>body {color: #222; background-color: white;}
@supports ((background-color: cornflowerblue) and (color: rgba(0,0,0,0.5))) {
	body {background-color: cornflowerblue; color: rgba(0,0,0,0.5);}
}
</code></pre>

<p>Okay, but what does that actually mean?  Here’s what the specification says:</p>

<blockquote><p>A CSS processor is considered to <em><strong>support</strong></em> a declaration (consisting of a property and value) if it accepts that declaration (rather than discarding it as a parse error). If a processor does not implement, with a usable level of support, the value given, then it <strong>must not</strong> accept the declaration or claim support for it.</p></blockquote>

<p>So in that first sentence, what we’re told is that “support” means “accepts [a] declaration” and doesn’t drop it on the floor as something it doesn’t recognize.  In other words, if a browser parses a property:value pair, then that qualifies as “support” for said pair.  Note that this sentence says <em>nothing</em> about what happens after parsing.  According to this, a browser could have a completely botched, partial, and generally unusable implementation of the property:value pair, but the act of recognizing means that there’s “support”.</p>

<p>But wait!  That second sentence adds an additional constraint, after a fashion: there must be “a usable level of support”, the lack of which means that a browser “<strong>must not</strong>…claim support”.  So not only must a browser parse a property:value pair, but support it to “a usable level”.</p>

<p>But what constitutes a “usable level”?  According to everyone who’s told me that I was wrong about vendor prefixes, any browser implementation of a feature should be complete and error-free.  Is that what’s required to be regarded as a usable level?  How about if the implementation has one known bug?  Three?  Ten?  Can any of them be severe bugs?  What about merely serious bugs?  What if two browsers claim usable support, and yet are not interoperable?</p>

<p>So.  How does the definition of <code>@supports</code> match the one-line definition I asked you to formulate, back at the beginning?  Are they exactly the same, or is there a difference?</p>

<p>I suspect that most people, especially those coming across <code>@supports</code> for the first time, will assume that the word means that a browser has complete, error-free support.  That’s the implicit promise.  Very few people think of “supports” as a synonym for “recognizes” (let alone “parses”).  There’s a difference, sometimes a very large one, between recognizing a thing and supporting it.  I’m sure that browser teams will do their best to avoid situations where a property:value pair is parsed but not well supported, but it’s only a matter of time before a “supported” pair proves to be badly flawed, or retroactively made wrong by specification changes.  Assuming that such things will be allowed, in an environment where <code>@supports</code> exists.</p>

<p>If feature queries were set with <code>@feature</code>, as media queries are set using <code>@media</code>, or even if the name were something along the lines of <code>@parses</code> or <code>@recognizes</code>, I’d be a lot less bothered.  The implicit promise would be quite a bit different.  What I feel like we face here is the exact inversion of vendor prefixes: instead of a marker for possible instability and a warning that preserves the possibility of changing the specification when needed, this pretends to promise stability and safety while restricting the WG’s ability to make changes, however necessary.  My instinct is that <code>@supports</code> will end up in the same place: abused, broken, and eventually reviled—except this time, there will be the extra bitterness of authors feeling that they were betrayed.</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2013/03/19/unsupportable-promises/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
		<item>
		<title>The Stinger</title>
		<link>http://meyerweb.com/eric/thoughts/2013/03/04/the-stinger/</link>
		<comments>http://meyerweb.com/eric/thoughts/2013/03/04/the-stinger/#comments</comments>
		<pubDate>Mon, 04 Mar 2013 17:44:19 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Commentary]]></category>
		<category><![CDATA[History]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=2155</guid>
		<description><![CDATA[On Friday, the Web Standards Project <a href="http://www.webstandards.org/2013/03/01/our-work-here-is-done/">announced its own dissolution</a>.  I felt a lot of things upon reading the announcement, once I got over my initial surprise: nostalgia, wistfulness, closure.]]></description>
				<content:encoded><![CDATA[<p>(In television, the “stinger” is the clip that plays during or just after the closing credits of a show.)</p>

<p>On Friday, the Web Standards Project <a href="http://www.webstandards.org/2013/03/01/our-work-here-is-done/">announced its own dissolution</a>.  I felt a lot of things upon reading the announcement, once I got over my initial surprise: nostalgia, wistfulness, closure.  And over it all, a deep sense of respect for the Project as a whole, from its inception to its peak to its final act.</p>

<p>In some ways, the announcement was a simple formalization of a longstanding state of affairs, as the Project has gradually grown quieter and quieter over the years, and its initiatives had been passed on to other, more active homes.  It was still impressive to see the group explicitly shut down.  I can’t think of the last time I saw a group that had been so influential and effective recognize that it was time to turn off the lights, and exit with dignity.  As they wrote:</p>

<blockquote cite="http://www.webstandards.org/2013/03/01/our-work-here-is-done"><p>Thanks to the hard work of countless WaSP members and supporters (like you), Tim Berners-Lee’s vision of the web as an open, accessible, and universal community is largely the reality. While there is still work to be done, the sting of the WaSP is no longer necessary. And so it is time for us to close down The Web Standards Project.</p></blockquote>

<p>I have a long history with the WaSP.  Way, way back, deep in the thick of the browser wars, I was invited to be a member of the CSS Action Committee, better known as the CSS Samurai.  We spent the next couple of years documenting how things worked (or, more often, didn’t) in CSS implementations, and—and this was the clever bit, if you ask me—writing up specific plans of action for browsers.  The <a href="http://archive.webstandards.org/css/#The_Top_10_Lists">standards compliance reviews</a> we published told browsers what they needed to fix first, not just what they were getting wrong.  I can’t claim that our every word was agreed with, let alone acted upon, but I’m pretty confident those reviews helped push browser teams in the right direction.  Or, more likely, helped browser teams push their bosses in the direction the teams already wanted to go.</p>

<p>Succumbing to a wave of nostalgia, I spent a few minutes trawling my archives.  I still have what I think is all the mail from the Samurai’s mailing list, run through Project Cool’s servers, from when it was set up in August 1998 up through June of 2000.  My archive totals 1,716 messages from the group, as well as some of the Steering Committee members (mostly Glenn Davis, though George Olsen was our primary contact during the Microsoft style sheets patent brouhaha of February 1999).  If I’m not reading too much into plain text messages over a decade old, we had a pretty great time.  And then, after a while, we were done.  Unlike the WaSP itself, we never really declared an end.  We didn’t even march off into the sunset having declared that the farmers always win.  We just faded away.</p>

<p>Not that that’s entirely a bad thing.  At a certain point, our work was done, and we moved on.  Still, I look back now and wish we’d made it a little more formal.  Had we done so, we might have said something like the WaSP did:</p>

<blockquote cite="http://www.webstandards.org/2013/03/01/our-work-here-is-done"><p>The job’s not over, but instead of being the work of a small activist group, it’s a job for tens of thousands of developers who care about ensuring that the web remains a free, open, interoperable, and accessible competitor to native apps and closed eco-systems. It’s <em>your</em> job now…</p></blockquote>

<p>And so it is.  These last years have shown that the job is in very good hands.</p>

<p>“Never doubt that a small group of thoughtful, committed citizens can change the world. Indeed, it is the only thing that ever has.” said Margaret Mead.  I see now that the way those small groups truly change the world is by convincing the rest of the world that they are right, thus co-opting the world to their cause.  Done properly, the change makes the group obsolete.  It’s a lesson worth remembering, as we look at the world today.</p>

<p>I’m honored to have been a part of the WaSP, and I offer my deepest samurai bow of respect to its founders, its members, and its leaders.  Thank you all for making the web today what it is.</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2013/03/04/the-stinger/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sixth Annual Blue Beanie Day</title>
		<link>http://meyerweb.com/eric/thoughts/2012/11/23/bbd6/</link>
		<comments>http://meyerweb.com/eric/thoughts/2012/11/23/bbd6/#comments</comments>
		<pubDate>Fri, 23 Nov 2012 19:14:25 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Standards]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=2003</guid>
		<description><![CDATA[Come November 30th, thousands of us will don our blue beanies.  I hope you’ll be among us.]]></description>
				<content:encoded><![CDATA[<p>I just recently stumbled across a years-ago post where I said, almost as an aside:</p>

<blockquote><p> Web design isn’t like chemistry, where the precipitate either forms or it doesn’t. If chemical engineers had to work in conditions equivalent to web developers, they’d have to mix their solutions in several parallel universes, each one with different physical constants, and get the same result in all of them. </p></blockquote>

<p>While that’s still true, the constants are a lot less divergent these days.  The parallel universes that are web browsers are much closer to unity than once they were.</p>

<p>Remember those days?  When major web sites had a home page with two links: one for Netscape users to enter, the other for IE users?</p>

<p>Madness.</p>

<img src="http://meyerweb.com/pix/2012/bbd-eric.png" class="pic"/>

<p>We know better now, of course.  Thanks to early pioneers like the organizers of the Web Standards Project, the path of web development was bent to a much saner course.  We still have little glitches and frustrations, of course, but it could be so unimaginably worse.  We know that it could be, because it was, once.</p>

<p>Along the way, the book cover of <a href="http://zeldman.com/" rel="friend colleague co-worker met">my friend and business partner</a>’s book, <a href="http://zeldman.com/dwws/"><cite>Designing With Web Standards</cite></a>, gave rise to <a href="http://zeldman.com/bbd/">Blue Beanie Day</a>, the day on which we give visible presence to our solidarity with the idea that web standards make possible the web as we know it.  Pictures go up on Twitter, Instagram, and Flickr with the tag <code>#bbd12</code>, and can be added to <a href="http://flickr.com/groups/bbd12/">the Flickr group</a> if you post there.</p>

<p>In this rapidly unfolding age of multiple device platforms and web access experiences, standards are more important than ever, even as they come under renewed pressure.  There will always be those who proclaim that standards are a failed process, an obstruction, an anachronism.  The desire to go faster and be shinier will always tempt developers to run down proprietary box canyons.</p>

<p>But so too will there always be those of us who remember the madness that lies that way.  Come November 30th, thousands of us will don our blue beanies.  I hope you’ll be among us.</p>

<p class="footnote">Image © Kevin Cornell.  Used with permission.</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2012/11/23/bbd6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pricing ‘CSS:The Definitive Guide’</title>
		<link>http://meyerweb.com/eric/thoughts/2012/10/03/pricing-csstdg4e/</link>
		<comments>http://meyerweb.com/eric/thoughts/2012/10/03/pricing-csstdg4e/#comments</comments>
		<pubDate>Wed, 03 Oct 2012 15:17:38 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[Writing]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=2010</guid>
		<description><![CDATA[When I "announced the serial publication of <cite>CSS: The Definitive Guide</cite>, Fourth Edition":http://meyerweb.com/eric/thoughts/2012/10/01/csstdg4e/, I left out the question of how pricing will work.  There are two components to the answer.]]></description>
				<content:encoded><![CDATA[<p>When I <a href="http://meyerweb.com/eric/thoughts/2012/10/01/csstdg4e/">announced the serial publication of <cite>CSS: The Definitive Guide</cite>, Fourth Edition</a>, I failed to address the question how pricing will work.  Well, more decided to break it out into its own post, really.  As it turns out, there are two components to the answer.</p>

<p>First component is the pricing of the pre-books.  Roughly speaking, each pre-book will be priced according to its length.  The assumed base for the electronic version is $2.99, and $7.99 for the print version, with significantly longer pre-books (say, <a href="http://shop.oreilly.com/product/0636920027614.do">one where two chapters are combined</a>) priced somewhat higher.  How much higher depends on the length.  It’s possible that prices will drift a bit over time as production or printing costs change, but there’s no way to guarantee that.  We’re basically pricing them as they come out.</p>

<p>At the end of the process, when all the chapters are written and bundled into an omnibus book edition, there will be discounts tied to the chapters you’ve already purchased.  The more chapters you bought ahead, the deeper the discount.  If you bought the pre-books direct from O’Reilly, then you’ll automatically get a discount code tailored to the number of pre-book you’ve already bought.  If you bought them elsewhere, then O’Reilly’s customer service will work to create a comparable discount, though that will obviously be a slower process.</p>

<p>The second component is: how much will the codes cut the price of the final, complete book?  That I cannot say.  The reason is that I don’t know (nor does anyone) what minimum price O’Reilly will need to charge to cover its costs while taking into account the money already paid.  I’m hopeful that if you bought all of the pre-books, then the electronic version of the final book will be very close to free, but again, we have to see where things stand once we reach that point.  It might be that the production costs of the complete book mean that it’s still a couple of bucks even at the deepest discount, but we’ll see!  One of the exciting things about this experiment is that even <a href="http://simonstl.com/" rel="acquaintance colleague met">my editor</a> and I don’t know exactly how it will all turn out.  We really are forging a new trail here, one that I hope will benefit other authors—and, by direct extension, readers—in the future.</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2012/10/03/pricing-csstdg4e/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>‘CSS: The Definitive Guide’, Fourth Edition</title>
		<link>http://meyerweb.com/eric/thoughts/2012/10/01/csstdg4e/</link>
		<comments>http://meyerweb.com/eric/thoughts/2012/10/01/csstdg4e/#comments</comments>
		<pubDate>Mon, 01 Oct 2012 17:42:42 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[Writing]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1995</guid>
		<description><![CDATA[I’m really excited to announce that <cite>CSS: The Definitive Guide</cite>, Fourth Edition, is being released one piece at a time.]]></description>
				<content:encoded><![CDATA[<p>I’m really excited to announce that <cite>CSS: The Definitive Guide</cite>, Fourth Edition, is being released one piece at a time.</p>

<p>As <a href="http://toc.oreilly.com/2012/09/serializing-css-the-definitive-guide.html">announced last week</a> on the O’Reilly Tools of Change for Publishing blog, the next edition of <cite>CSS:TDG</cite> will be released chapter by chapter.  As each one is finished, it will go into production right away instead of waiting for the entire omnibus book to be completed.  You’ll be able to get each standalone as an e-book, a print-on-demand paper copy, or even as both if that’s how you roll.  I’ve taken to calling these “pre-books”, which I hope isn’t too confusing or inaccurate.</p>

<p>There are a lot of advantages to this, which I wrote about in some detail for the TOC post.  Boiled down, they are: accuracy, agility, and à la carte.  If you have the e-book version, then updates can be downloaded for free as errata are corrected or rewrites are triggered by changes to CSS itself.  And, of course, you can only buy the pre-books that interest you, if you don’t feel like you need the whole thing.</p>

<p>I should clarify that not every pre-book is a single chapter; occasionally, more than one chapter of the final product will be bundled together into a single pre-book.  For example, <a href="http://shop.oreilly.com/product/0636920027614.do">Selectors, Specificity, and the Cascade</a> is actually chapters 2 and 3 of the final book combined.  It just made no sense to sell them separately, so we didn’t.  “<a href="http://shop.oreilly.com/product/0636920027621.do">Values, Units, and Colors</a>”. on the other hand, is Chapter 4 all by itself.  (So if anyone was wondering about the pricing differences between those two pre-books, there’s your explanation.)</p>

<p>If you want to see what the e-book versions are like, <a href="http://shop.oreilly.com/product/0636920027607.do">CSS and Documents</a> (otherwise known as Chapter 1) has been given <strong>the low, low price of $0.00</strong>.  Give it a whirl, see if you like the way the pre-books work as bits.</p>

<p>My current plan is to work through the chapters sequentially, but I’m always willing to depart from that plan if it seems like a good idea.  What amuses me about all this is the way the writing of <cite>CSS: The Definitive Guide</cite> has come to mirror CSS itself—split up into modules that can be tackled independently of the others, and eventually collected into a snapshot tome that reflects a point in time instead of an overarching version number.</p>

<p>Every pre-book is a significantly updated version of their third-edition counterparts, though of course a great deal of material has stayed the same.  In some cases I rewrote or rearranged existing sections for greater clarity, and in all but “CSS and Documents”&nbsp;I’ve added a fair amount of new material.  I think they’re just as useful today as the older editions were in their day, and I hope you’ll agree.</p>

<p>Just to reiterate, these are the three pre-books currently available:</p>

<ul>
<li><a href="http://shop.oreilly.com/product/0636920027607.do">CSS and Documents</a> (free) —&nbsp;the basics of CSS and how it’s associated with HTML, covering things like <code>link</code> and <code>style</code> as well as obscure topics like HTTP header linking</li>
<li><a href="http://shop.oreilly.com/product/0636920027614.do">Selectors, Specificity, and the Cascade</a> —&nbsp;including all of the level 3 selectors, examples of use, and how conflicts are resolved</li>
<li><a href="http://shop.oreilly.com/product/0636920027621.do">Values, Units, and Colors</a> —&nbsp;fairly up to date, including HSL/HSLa/RGBa and the full run of X11-based keywords, and also the newest units except for the very, very latest—and as they firm up and gain support, we’ll add them into an update!</li>
</ul>

<p>As future pre-books come out, I’ll definitely announce them here and in the usual social spaces.  I really think this is a good move for the book and the topic, and I’m very excited to explore this method of publishing with O’Reilly!</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2012/10/01/csstdg4e/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<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>19</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>10</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>8</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>21</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>
	</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! -->