<?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>Broken Links &#187; standards</title>
	<atom:link href="http://www.broken-links.com/category/standards/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.broken-links.com</link>
	<description>Thoughts on web development and technologies by Peter Gasston</description>
	<lastBuildDate>Fri, 03 Feb 2012 19:47:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<atom:link rel='hub' href='http://www.broken-links.com/?pushpress=hub'/>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>An Argument In Favour Of Vendor Prefixes</title>
		<link>http://www.broken-links.com/2011/11/15/an-argument-in-favour-of-vendor-prefixes/</link>
		<comments>http://www.broken-links.com/2011/11/15/an-argument-in-favour-of-vendor-prefixes/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 21:06:03 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[standards]]></category>

		<guid isPermaLink="false">http://www.broken-links.com/?p=1418</guid>
		<description><![CDATA[Henri Sivonen has written a fantastically well-considered post called Vendor Prefixes Are Hurting The Web which I urge you to read in full, as I’m about to discuss it. I think some of his points are absolutely right, but I disagree on the final conclusion. The points that I think he nails are: Demos that [...]]]></description>
			<content:encoded><![CDATA[<p>Henri Sivonen has written a fantastically well-considered post called <a href="http://hsivonen.iki.fi/vendor-prefixes/">Vendor Prefixes Are Hurting The Web</a> which I urge you to read in full, as I’m about to discuss it. I think some of his points are absolutely right, but I disagree on the final conclusion. The points that I think he nails are:</p>
<ul>
<li>Demos that work in one browser/engine only and aren’t updated even when other browsers implement the new features, are harmful.</li>
<li>Using prefixed features as a way of actively excluding other browsers is lazy and anti-competitive.</li>
<li>Including an unprefixed property in anticipation of eventual standardisation works against the principle of using prefixes</li>
<li>When browsers have working, largely compatible, implementations of properties (like transform) they should remove the prefix even if the spec hasn’t reached the stage required by the W3C.</li>
</ul>
<p>However, I still think using prefixed properties is the right approach. If we do as Henri suggests and leave experimental features in experimental builds (an eminently sensible suggestion, I might add), the pace of progress will be much slower. I believe that having these features out there and getting people using them encourages competition (and collaboration) between browser makers, and the benefits of that competition are given to us, the developers, and passed on to the audiences of the sites we build.</p>
<p>That doesn’t mean that the current situation is ideal; far from it. But improving things will involve more effort from us, the developers and writers, the community in general. Chief responsibilities will be:</p>
<ul>
<li>Commit to supporting old demos that we have made.</li>
<li>Always make sure we plan our designs and builds in a way that they are not reliant on prefixed features, but degrade gracefully.</li>
<li>Don’t use an unprefixed property before standardisation has happened unless we can have reasonable confidence that it is safe.</li>
<li>Make sure we stress that the things we use and teach are experimental and subject to change.</li>
</ul>
<p>As an author and writer I’m guilty of some of the faults that are pointed out in his article, and I promise to do better in the future.</p>
<p>In closing, I want to congratulate Henri on writing this thought-provoking post. I was ready to dismiss it as one of the lazy articles criticising prefixes that occur regularly, but the argument was very well thought and well made, and made me change my mind a few times while I was writing this post.</p>
 <p><a href="http://www.broken-links.com/?flattrss_redirect&amp;id=1418&amp;md5=025c8b4a066ca165fe12cee5997a7a71" title="Flattr" target="_blank"><img src="http://www.broken-links.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.broken-links.com/2011/11/15/an-argument-in-favour-of-vendor-prefixes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<atom:link rel="payment" href="http://www.broken-links.com/?flattrss_redirect&amp;id=1418&amp;md5=025c8b4a066ca165fe12cee5997a7a71" type="text/html" />
	</item>
		<item>
		<title>On Mark Boulton’s Grids Proposal</title>
		<link>http://www.broken-links.com/2011/08/11/on-mark-boultons-grids-proposal/</link>
		<comments>http://www.broken-links.com/2011/08/11/on-mark-boultons-grids-proposal/#comments</comments>
		<pubDate>Thu, 11 Aug 2011 21:23:00 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[feedback]]></category>
		<category><![CDATA[grids]]></category>
		<category><![CDATA[typographic grids]]></category>

		<guid isPermaLink="false">http://www.broken-links.com/?p=1260</guid>
		<description><![CDATA[I recently wrote a feature for .net Magazine, The Future of CSS Layouts, which took a look at several proposed CSS modules intended to provide more flexibility for laying out websites. One of those modules, Grid Layout, has been experimentally implemented in IE10 Platform Preview, and it prompted Mark Boulton to propose an alternative approach [...]]]></description>
			<content:encoded><![CDATA[<p>I recently wrote a feature for .net Magazine, <a href="http://www.netmagazine.com/features/future-css-layouts">The Future of CSS Layouts</a>, which took a look at several proposed CSS modules intended to provide more flexibility for laying out websites. One of those modules, <a href="http://dev.w3.org/csswg/css3-grid-align/">Grid Layout</a>, has been experimentally implemented in <a href="http://ie.microsoft.com/testdrive/">IE10 Platform Preview</a>, and it prompted Mark Boulton to propose an alternative approach in his article <a href="http://www.markboulton.co.uk/journal/comments/rethinking-css-grids">Rethinking CSS Grids</a>.</p>
<p>While I think the alternative syntax is pretty robust, I did detect a couple of flaws in it which I promised Mark I would write about, and that’s what I’ll do in this article. Before I get to that, I just want to quickly address one of the key points from his proposal.</p>
<p><span id="more-1260"></span></p>
<h2>Defining a Grid</h2>
<blockquote><p>grids have been around for quite a while and there is established words for things like Columns, Fields, Modules and Gutters. It’s my feeling that the CSS grid module should speak the same language as designers, not that of developers.</p></blockquote>
<p>I’m not certain that I wholeheartedly agree with this; not that the Grid Layout syntax uses terms that are more familiar from tables or spreadsheets rather than typographic grids, as this is certainly true; but the contention in the second sentence, that the Grid module should be aimed at designers rather than developers.</p>
<p>The language of grids may be obvious to those that are trained in using them, but I wonder just how many people that includes. For the non-typographically savvy I think it’s not as literal; speaking for myself I find Rows and Cells more logical than Fields and Modules.</p>
<p>And while Mark’s proposed syntax works well for typographic grids, it does mean that making an irregular grid becomes extremely hard. Using the Grid Layout syntax you can make regular and irregular grids very easily, whereas this new proposal is really intended only to make one very strict type of grid.</p>
<p>Anyway, that’s kind of besides the point; I’m not strongly convinced of my own argument, just thought it was worth raising. But I’ll take Mark’s premise at face value and go along with the syntax that he proposes. If that’s a more logical way to think about grids, then the syntax seems pretty solid. There are, however, a few potential problems I can see with it.</p>
<h2>Fractions</h2>
<p>The first problem is that basing the grid on modules eliminates the effectiveness of the <code>fr</code> (<em>fraction</em>) unit. In the example in section 4 of the article a three column grid is created using this code (NB: I’ve changed some of the values a little to bring them into line with existing properties):</p>
<pre>div {
grid-columns: 3md 1fr 2md;
grid-x-count: 10;
}</pre>
<p>As this is on a grid made of 10 horizontal modules, the central column is five modules wide. But what if we used four columns, with two fraction units?</p>
<pre>div { grid-columns: 3md <mark>1fr 1fr</mark> 2md; }</pre>
<p><img src="/wp-content/uploads/2011/08/grids-fractions.png" alt="" width="580" height="296" /></p>
<p>That would make the second and third columns 2.5 modules wide. I’m presuming that we can’t have fractions of modules, so if the fraction unit can’t be used to create fractions then it becomes useless (or, at least, very hard to work with). In this case we should just go back to using the <code>md</code> unit for everything:</p>
<pre>div { grid-columns: 3md <mark>5md</mark> 2md; }</pre>
<p>And if we’re doing it this way, then we don’t need the proposed <code>grid-x-count</code> property any more; that count can be obtained by the sum of the <code>md</code> units in <code>grid-columns</code>. This brings it a little closer to the existing Grid Layout syntax.</p>
<h2>Breaking the Grid</h2>
<p>The second problem is that the grid is now very hard to break out of. What if, after we’ve laid out our grid, we wanted to put an item that broke into the gutters:</p>
<p><img src="/wp-content/uploads/2011/08/grids-break.png" alt="" width="580" height="296" /></p>
<p>How do I position that? Unlike in the Grid Layout syntax, gutters aren’t available as slots to position elements in. I could use relative positioning to move it into the gutter, but how do I also expand the element so that it’s larger than the modules it covers? Maybe with padding:</p>
<pre>div {
left: -21px;
padding: 21px;
position: relative;
top: -21px;
}</pre>
<p>But if, in this box model, padding is added to make the element bigger, then how would I put put internal padding on an element which I didn’t want to get bigger? A possible alternative solution to this would be to add a new property, something like:</p>
<pre>grid-gutter-span: all;</pre>
<p>This could also have the keywords <em>top</em>, <em>right</em>, <em>bottom</em>, <em>left</em>, or <em>none</em>, to provide flexibility to the elements that are placed in the grid.</p>
<h2>Conclusion</h2>
<p>For defining a typographic grid I think this syntax is pretty well thought out, certainly for a first draft, and the problems I’ve pointed out here are not insurmountable, but just require some more consideration. I hope that the feedback I’ve given is constructive — well, most of all I hope that I’ve understood the proposed syntax correctly and not made any stupid mistakes! If you’ve anything you’d like to add, feel free to leave a comment.</p>
 <p><a href="http://www.broken-links.com/?flattrss_redirect&amp;id=1260&amp;md5=5b586789412316d1249f41b1800f1d55" title="Flattr" target="_blank"><img src="http://www.broken-links.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.broken-links.com/2011/08/11/on-mark-boultons-grids-proposal/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<atom:link rel="payment" href="http://www.broken-links.com/?flattrss_redirect&amp;id=1260&amp;md5=5b586789412316d1249f41b1800f1d55" type="text/html" />
	</item>
		<item>
		<title>HTML5 Form Validation</title>
		<link>http://www.broken-links.com/2011/03/28/html5-form-validation/</link>
		<comments>http://www.broken-links.com/2011/03/28/html5-form-validation/#comments</comments>
		<pubDate>Mon, 28 Mar 2011 13:21:46 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[constraint validation api]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://www.broken-links.com/?p=1127</guid>
		<description><![CDATA[A lot of the attention paid to HTML5 Forms has been centred around the new input types. email, url, date, and the rest are all very convenient, but for me the really useful feature is the built-in validation. In case you’re not aware of it, the browser will now handle all of the validation that [...]]]></description>
			<content:encoded><![CDATA[<p>A lot of the attention paid to HTML5 Forms has been centred around the new input types. <code>email</code>, <code>url</code>, <code>date</code>, and the rest are all very convenient, but for me the really useful feature is the built-in validation. In case you’re not aware of it, the browser will now handle all of the validation that we used to use JavaScript for.</p>
<p>This is great for the future, but although you can start using these functions now (in many browsers), they aren’t without their drawbacks — well, one big drawback really. I’m going to explain briefly the problem, and then propose a solution.</p>
<p><span id="more-1127"></span></p>
<h2>How Form Validation Works</h2>
<p>The simplest form of validation is to say that a field is required, which is done by adding the <code>required</code> attribute (it’s boolean, so needs no explicit value):</p>
<pre>&lt;input type="text" <mark>required</mark>&gt;</pre>
<p>This will check to see if a value is supplied, and returns an error if it isn’t. You can add parameters to validation by using the <code>pattern</code> attribute with a JavaScript regex value; for example, to only accept a numeric value you would use the following:</p>
<pre>&lt;input type="text" <mark>pattern="[-0-9]+"</mark> required&gt;</pre>
<p>Some field types have pattern validation baked in; <code>email</code> and <code>url</code> will only accept correctly formatted email addresses and URLs, respectively, while <code>number</code> and <code>range</code> can have maximum and minimum numeric values applied. There’s also a <code>maxlength</code> attribute to restrict the number of characters, which can also cause a validation error.</p>
<h2>The Problem With Error Messages</h2>
<p>Probably the biggest drawback of the validation process is that the error messages are, for the most part — and there’s no polite way to put this — ugly. Take a look at this image showing the validation error message in (from the top) Chrome, Opera, and Firefox:</p>
<p><img src="/wp-content/uploads/2011/03/errormessages.png" alt="Validation error messages in different browsers" width="317" height="270"></p>
<p>I think the Opera message is the better of the three, but I think it’s fair to say that the designers weren’t having their best days when they made these. (I’m using Ubuntu here, but they really aren’t any better in any other <abbr>OS</abbr>.) The problem I have with these is that I’d like to use them, but I don’t think any designer I work with would find these acceptable and I’d no doubt end up using a <abbr>JS</abbr> implementation just to get some form of consistency.</p>
<p>Using <abbr>JS</abbr> is a short term solution, and there’s a good <a href="https://developer.mozilla.org/en/HTML/HTML5/Forms_in_HTML5#Constraint_Validation_API">Validation <abbr>API</abbr></a> to aid in using it (which I aim to write about soon). But longer term we will need better-designed messages, or a way to style them ourselves, or both. I don’t think that the error messages need to look identical in every browser on every OS, but I do think they should be more closely aligned with the browser chrome and sympathetic to the OS; they should feel like a natural part of the platform, rather than an add-on.</p>
<h2>A Proposal For Styling Error Messages</h2>
<p>There’s no formalised suggestion for CSS styling of error messages, but I think it’s probably inevitable that there will be. This could take the form of a pseudo-element, perhaps something like:</p>
<pre>input<mark>::error</mark> {}</pre>
<p>This would allow us to set background, colour and font options. It may be necessary to also have a property to set where the validation error message appears in relation to the input it’s attached to; perhaps modifying <code>position</code> with values of <em>above</em>, <em>below</em>, <em>before</em>, or <em>after</em>:</p>
<pre>input::error { <mark>position: below</mark>; }</pre>
<p> And, perhaps, another property to set the appearance of the box which contains the message; perhaps the <code>appearance</code> property with values of <em>box</em> for a rectangle, or <em>balloon</em> for the current speech balloon style:</p>
<pre>input::error { <mark>appearance: balloon</mark>; }</pre>
<p>There’s also the text inside the validation error; the main message, and an optional extra which can be set with the <code>title</code> attribute (or JavaScript). These could have further pseudo-elements for finer control over the text formatting:</p>
<pre>input<mark>::error-message</mark> { }
input<mark>::error-text</mark> { }</pre>
<p>This is all straight off the top of my head, of course, and no doubt needs plenty of development; but as there’s no formal proposal at the moment, it’s a good time to be thinking about these things.</p>
 <p><a href="http://www.broken-links.com/?flattrss_redirect&amp;id=1127&amp;md5=c6c601da1f07e0e07763a86b3876f7c7" title="Flattr" target="_blank"><img src="http://www.broken-links.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.broken-links.com/2011/03/28/html5-form-validation/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		<atom:link rel="payment" href="http://www.broken-links.com/?flattrss_redirect&amp;id=1127&amp;md5=c6c601da1f07e0e07763a86b3876f7c7" type="text/html" />
	</item>
		<item>
		<title>State of the Browser</title>
		<link>http://www.broken-links.com/2011/03/22/state-of-the-browser/</link>
		<comments>http://www.broken-links.com/2011/03/22/state-of-the-browser/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 11:46:24 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[browsers]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[london]]></category>
		<category><![CDATA[london web standards]]></category>

		<guid isPermaLink="false">http://www.broken-links.com/?p=1144</guid>
		<description><![CDATA[This weekend I attended the London Web Standards group’s State of the Browser, a one-day event with representatives of many of the major browser makers giving us status reports on their products. Chrome, Firefox, Opera and Blackberry were all there; a member of the IE team was due to show but had to pull out [...]]]></description>
			<content:encoded><![CDATA[<p>This weekend I attended the <a href="http://www.londonwebstandards.org/">London Web Standards</a> group’s <a href="http://browser.londonwebstandards.org/">State of the Browser</a>, a one-day event with representatives of many of the major browser makers giving us status reports on their products. Chrome, Firefox, Opera and Blackberry were all there; a member of the <abbr>IE</abbr> team was due to show but had to pull out for personal reasons (he viewed the live stream and <a href="http://ubelly.com/2011/03/twitter-qa-from-state-of-the-browser/">answered some questions from home</a>). The notable absence was Safari, whose community engagement is really not good enough.</p>
<p>There were long talks and shorter breakout sessions, as well as plenty of time to socialise; the <abbr>LWS</abbr> must really be congratulated on organising such a good event. There was plenty of news and talking points throughout the day — far too much, really, for me to write here, so I’ll just write up notes of what I found most interesting to me.</p>
<p><span id="more-1144"></span></p>
<p>After a fun introduction from Terence Eden, the first full session was by Michael Mahemoff of Google. He showed that Chrome’s V8 JavaScript engine is now  some 700% faster than when it was first released, and then mentioned a few <a href="http://www.chromium.org/developers/web-platform-status">features that have just landed (or are about to land)</a> in the browser: the <a href="http://www.html5rocks.com/tutorials/file/filesystem/"><abbr>HTML5</abbr> File System</a>, <a href="http://dev.w3.org/html5/workers/#shared-workers-introduction">Shared Workers</a>, and <a href="http://dev.w3.org/html5/eventsource/">Server-Sent Events</a>. The big round of applause, though, was reserved for speech input in forms, which is supported in Chrome (dev channel) right now; you just need to add the attribute <code>x-webkit-speech</code>:</p>
<pre>&lt;input type="text" x-webkit-speech&gt;</pre>
<input type="text" placeholder="View in Chrome" x-webkit-speech style="margin: 0 0 20px 10px">
<p>He also showed off the Chrome Web Store and a neat little utility, <a href="http://www.appmator.com/">Appmator</a>, which you can use to easily publish your own app. <a href="http://prez.mahemoff.com/state-chrome/#0">His slides are available online</a>, but they only work in WebKit browsers. :(</p>
<p>Next was Paul Rouget of Firefox, showing off a load of neat demos of the capabilities of open web media, many of which can be found at Mozilla’s <a href="https://demos.mozilla.org/">Web O’ Wonder</a>. He also demonstrated them all running perfectly on <a href="http://www.mozilla.com/mobile/">Firefox Mobile</a>, which pretty much has feature parity with its desktop sibling — indeed it may even have more, as it includes the <a href="http://dev.w3.org/2006/webapi/WebNotifications/publish/">Notifications <abbr>API</abbr></a> which isn’t in Firefox desktop yet. There’s a cool little <a href="https://mozillademos.org/demos/dashboard/demo.html">dashboard demo which showcases many of Firefox 4’s new features</a>, and an impressive mobile version which doesn’t seem to be online yet.</p>
<p>He then talked about Firefox’s new release schedule, which is moving to quarterly releases meaning that Firefox 7 could be out by the end of this year. Features planned for inclusion in Firefox 5 include Web Sockets, Server-Sent Events, the Fullscreen <abbr>API</abbr>, Notification <abbr>API</abbr>, and an Account Manager. No mention of what Firefox 6 may have, but Firefox 7 may include an update to the Gecko engine.</p>
<p>Chris Mills of Opera was next. In his talk, <a href="http://www.vimeo.com/21308036">A Matter of Good Form</a>, he focused a lot on Opera’s implementation of HTML5 Forms, which it must be said are streets ahead of anyone else. I’m putting together a couple of posts on forms, so I’ll save discussion of this until that time.</p>
<p>After lunch there were some breakout sessions to choose from. I attended first Google’s Malte Ubl’s session, Performance Optimization for <abbr>HTML5</abbr> Apps. In fact this was a really good overview of performance best practices, not limited to only HTML5 apps. One of his points was to let the browser take as much of the work from the <abbr>JS</abbr> engine as it can; use <abbr>CSS</abbr> transitions instead of <abbr>JS</abbr> animations where possible, as this uses the browser’s hardware acceleration and therefore less processor resource. Another was to interact with the <abbr>DOM</abbr> as few times as possible, and to also to group those interactions; if your <abbr>JS</abbr> is currently structured Read-Write-Read-Write, changing it to Read-Read-Write-Write means less <abbr>DOM</abbr> interaction, and increased speed.</p>
<p>An interesting aside: he said that this generation’s equivalent of <code>zoom:1</code> (which triggers <a href="http://www.satzansatz.de/cssd/onhavinglayout.html"><code>hasLayout</code></a> in older versions of <abbr>IE</abbr>) could be:</p>
<pre><em>E</em> { transform: translate3D(0,0,0); }</pre>
<p>This triggers hardware acceleration on elements which don’t already use it (in Safari, at least). I think this may have been partly a joke, however!</p>
<p>The second session was The Dos and Don’ts on the Mobile Web by Blackberry’s Mathew Staikos, which covered some similar ground but had more good tips, notably not to use <code>position:fixed</code> with WebKit Mobile — it can cause a complete repaint after every scroll action! Also, use <em>touch</em> events where possible as they’re faster than <em>click</em>, which has to wait anywhere up to 500ms to see if the action will be <em>doubleclick</em> before firing. He also used a tool I hadn’t seen before which provides <a href="http://www.webkit.org/misc/WebKitDetect.html">information about the version of WebKit you are running</a>. His colleague Sanyu Kiruluta then gave us a very rapid overview of the <a href="http://appworld.blackberry.com/webstore/">Blackberry App World</a> (link is Windows-only) and their tool <a href="http://www.blackberry.com/developers/webworks">WebWorks</a>, which is similar to Phonegap.</p>
<p>To round the afternoon off we had <a href="http://www.vimeo.com/21310419">a <abbr>Q&amp;A</abbr> with all of the main speakers</a>, then off to the pub for a free beer courtesy of BlackBerry. Thanks, BlackBerry, and thanks again to everyone else who organised, spoke and attended. </p>
<p><abbr>NB</abbr>: I’ll update this post with more slides and videos from the event as they become available.</p>
 <p><a href="http://www.broken-links.com/?flattrss_redirect&amp;id=1144&amp;md5=3da3e093271da05dc5f6939962e7530f" title="Flattr" target="_blank"><img src="http://www.broken-links.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.broken-links.com/2011/03/22/state-of-the-browser/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<atom:link rel="payment" href="http://www.broken-links.com/?flattrss_redirect&amp;id=1144&amp;md5=3da3e093271da05dc5f6939962e7530f" type="text/html" />
	</item>
		<item>
		<title>On Internet Explorer and Microsoft</title>
		<link>http://www.broken-links.com/2010/10/26/on-internet-explorer-and-microsoft/</link>
		<comments>http://www.broken-links.com/2010/10/26/on-internet-explorer-and-microsoft/#comments</comments>
		<pubDate>Tue, 26 Oct 2010 09:45:38 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[browsers]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[ie7]]></category>
		<category><![CDATA[ie9]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[windows phone 7]]></category>

		<guid isPermaLink="false">http://www.broken-links.com/?p=1030</guid>
		<description><![CDATA[I’m not a blind Microsoft-basher, neither am I an MS fanboy (in fact, I think the whole idea of aligning yourself with any single technology or brand is pretty narrow-minded). I think MS do some things well, and some things poorly. I am going to have a bit of a pop at them at the [...]]]></description>
			<content:encoded><![CDATA[<p>I’m not a blind Microsoft-basher, neither am I an <abbr title="Microsoft">MS</abbr> fanboy (in fact, I think the whole idea of aligning yourself with any single technology or brand is pretty narrow-minded). I think <abbr>MS</abbr> do some things well, and some things poorly. I <em>am</em> going to have a bit of a pop at them at the end of this article, but I’m going to start by defending them.</p>
<p><span id="more-1030"></span></p>
<p>Recently I read this piece of hyperbolic link-bait: <a href="http://css3wizardry.com/2010/08/14/ie9-is-the-ie6-of-css3/"><abbr>IE9</abbr> is the <abbr>IE6</abbr> of <abbr>CSS3</abbr></a>. In the article the author bemoans the fact that a layout he’s created using some new <abbr>CSS3</abbr> features doesn’t display well in <abbr>IE9</abbr>. His complaints betray his basic misunderstanding of software development, the standards process, and Microsoft themselves.</p>
<p>Browser makers are under no obligation to include <abbr>CSS3</abbr> features just because other browsers do. Just because WebKit proposed a bunch of new modules and the <abbr>W3C</abbr> have agreed to open a consultation on them, doesn’t mean they are an ‘official’ part of <abbr>CSS3</abbr>. In Microsoft’s case they also have a policy of not implementing features that don’t have a full suite of tests; one of the features in the article that the author mentions is the Flexible Box Layout module, which is far from complete — Firefox and WebKit have it implemented, but it behaves differently in each and the spec is still undergoing revision.</p>
<p>Also, it must be remembered that <abbr>IE9</abbr> is still in Beta; new features are being added, removed and changed constantly. If you encounter an inconsistency in the way those features are implemented, stop griping and <a href="http://connect.microsoft.com/IE">file a bug report</a>. Personally, I’d favour a browser with fewer, more stable features than one which ships with non-conforming or badly implemented features (this is how we’d <em>really</em> end up with a new <abbr>IE6</abbr>). I actually think that <abbr>IE9</abbr> provides a pretty good snapshot of the most stable components of <abbr>CSS3</abbr>, and I’m looking forward to seeing it adopted by users.</p>
<p>So, onto the gripe. With all of the hard work that the <abbr>IE</abbr> dev team have put into bringing their browser up to scratch in the last few years, it must be immensely dispiriting for them that nobody else within Microsoft seems to want to use it. First we had the news that Outlook was to use Word as it’s default <abbr>HTML</abbr> renderer*, and now we have the launch of Windows Phone 7 with a modded version of <abbr>IE7</abbr> as its browser.</p>
<p><abbr>IE7</abbr> was, essentially, a bug-fix version of <abbr>IE6</abbr>. It is not a modern browser, and not in the same league as the Mobile versions of WebKit, Firefox and Opera. It has none of the features which make those browsers so useful. If you’re building a website for touch-enabled smartphones you now have to take into account that if you want to support Windows Phone 7, you have to work around the lack of geolocation, local storage, offline storage, <abbr>SVG</abbr>, <code>canvas</code> and much more.</p>
<p>The only saving grace in this is that apparently the browser has been implemented in a way which means it can be updated separately from the rest of the software, so improvements can be made without a full firmware update. I hope that this is the case, and that updates are made frequently, and soon.</p>
<p><i>* It seems that <a href="http://www.9to5mac.com/32191/outlook-2011-uses-webkit-to-render-html">future versions of Outlook (on Mac, at least) may use WebKit</a></i>.</p>
 <p><a href="http://www.broken-links.com/?flattrss_redirect&amp;id=1030&amp;md5=e000a1d7a606743b1d8143380aaf8adb" title="Flattr" target="_blank"><img src="http://www.broken-links.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.broken-links.com/2010/10/26/on-internet-explorer-and-microsoft/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<atom:link rel="payment" href="http://www.broken-links.com/?flattrss_redirect&amp;id=1030&amp;md5=e000a1d7a606743b1d8143380aaf8adb" type="text/html" />
	</item>
		<item>
		<title>Playing WebM in Safari with plugins</title>
		<link>http://www.broken-links.com/2010/09/01/playing-webm-in-safari-with-plugins/</link>
		<comments>http://www.broken-links.com/2010/09/01/playing-webm-in-safari-with-plugins/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 13:33:10 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[html]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[h264]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[webm]]></category>

		<guid isPermaLink="false">http://www.broken-links.com/?p=919</guid>
		<description><![CDATA[As you're no doubt aware, HTML5 video is this year's big thing - but there's a dispute going on about which should become the default standard video codec. The current nascent <span lang="la">de facto</span> standard is <abbr>H.264</abbr>, but recently the new <a href="http://www.webmproject.org/">WebM</a> format is gaining traction. But this post isn't really about that; it's about clearing up a misconception.]]></description>
			<content:encoded><![CDATA[<p>As you’re no doubt aware, <abbr>HTML5</abbr> video is this year’s big thing — but there’s a dispute going on about which should become the default standard video codec. The current nascent <span lang="la">de facto</span> standard is <abbr>H.264</abbr>, but recently the new <a href="http://www.webmproject.org/">WebM</a> format is gaining traction.</p>
<p>I’ve no idea how the web video format war will end. My preference is that a free, non-patent encumbered, high-quality video codec will become the standard, and WebM is the best fit for that description. Despite the recent announcement by the <abbr>MPEG LA</abbr>, the patent pool which controls licensing of H.264, that it will <a href="http://www.pcmag.com/article2/0,2817,2368359,00.asp">always be free for ‘video delivered to the internet without charge’</a>, that still doesn’t make it free-as-in-speech, and still not free-as-in-beer for anyone wanting to build a business around video encoding/decoding (which includes, if I’m not mistaken, bundling it with a browser). All that said, my preference is meaningless in the face of so many vested business interests.</p>
<p><span id="more-919"></span></p>
<p>But this post isn’t really about that; it’s about clearing up a misconception. One common statement I keep seeing repeated (<a href="http://www.webmonkey.com/2010/05/on-web-video-support-safari-now-stands-alone/">WebMonkey said this in May</a>, but I’ve seen it even more recently) is that Safari will be the only browser to not support WebM, when even the Internet Explorer team have promised to. That’s not the case. What the IE team said was that <a href="http://windowsteamblog.com/windows/b/bloggingwindows/archive/2010/05/19/another-follow-up-on-html5-video-in-ie9.aspx">they will support WebM (or rather, the <abbr>VP8</abbr> codec) as long as the user has installed the codec on Windows</a>. Safari’s position is identical, they just haven’t publicly stated so.</p>
<p>The current free alternative to <abbr>H.264</abbr>, <abbr>OGG</abbr> video, is also not supported in Safari — but you can play <abbr>OGG</abbr> videos in Safari by downloading and installing the <a href="http://www.xiph.org/quicktime/">Xiph Quicktime Components</a>. Likewise, Windows Media files are supported through <a href="http://www.microsoft.com/mac/products/flip4mac.mspx">Flip4Mac</a>. WebM can be supported in Safari in the same way, as soon as someone creates a QuickTime plugin (I believe experimental support is in <a href="http://perian.org/">Perian</a> already). This is <strong>exactly</strong> the same situation as with <abbr>IE</abbr>.</p>
<p>Where this doesn’t apply is on mobile devices; many — principal amongst them, the <abbr>iOS</abbr> range — don’t allow extra codecs to be installed. However, this is slightly supplemental to my point, which is that both <abbr>IE</abbr> and Safari — on desktop — are capable of playing WebM via a plugin. I believe that if people will install the Flash plugin, they will install the WebM plugin — and when we have choice and competition, a true standard can be reached by consensus, rather than financial clout.</p>
 <p><a href="http://www.broken-links.com/?flattrss_redirect&amp;id=919&amp;md5=87063ea1ab31800d9134c30594d622e8" title="Flattr" target="_blank"><img src="http://www.broken-links.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.broken-links.com/2010/09/01/playing-webm-in-safari-with-plugins/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<atom:link rel="payment" href="http://www.broken-links.com/?flattrss_redirect&amp;id=919&amp;md5=87063ea1ab31800d9134c30594d622e8" type="text/html" />
	</item>
		<item>
		<title>Using SVG in background-image</title>
		<link>http://www.broken-links.com/2010/06/08/using-svg-in-background-image/</link>
		<comments>http://www.broken-links.com/2010/06/08/using-svg-in-background-image/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 22:14:51 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[firefox 4]]></category>
		<category><![CDATA[opera]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[svg]]></category>

		<guid isPermaLink="false">http://www.broken-links.com/?p=843</guid>
		<description><![CDATA[While having a look through the list of features for developers planned for Firefox 4 earlier today, I noticed this: You can now use SVG with the img element, as well as the background image in CSS. I know you can already use SVG in background-image with Safari, Chrome and Opera, and this, coupled with [...]]]></description>
			<content:encoded><![CDATA[<p>While having a look through the list of <a href="https://developer.mozilla.org/en/Firefox_4_for_developers">features for developers planned for Firefox 4</a> earlier today, I noticed this:</p>
<blockquote><p>
You can now use <abbr title="Scalable Vector Graphics">SVG</abbr> with the <code>img</code> element, as well as the background image in <abbr>CSS</abbr>.
</p></blockquote>
<p>I know you can already use <abbr>SVG</abbr> in <code>background-image</code>  with Safari, Chrome and Opera, and this, coupled with Internet Explorer’s push towards <abbr>SVG</abbr> and the strong chance this will be available in IE9, made me decide to take a closer look.</p>
<p><span id="more-843"></span></p>
<p>I’ve put together a little demo page which you can view with Safari, Chrome, Opera or Firefox 4 nightlies:</p>
<p><a href="http://www.broken-links.com/tests/svg/"><abbr>SVG</abbr> in background-image demo</a></p>
<p>The same image is used many times at different sizes on this page, displaying the grand advantage of <abbr>SVG</abbr> over <abbr>PNG</abbr>: it can be resized without the same loss of quality that bitmap images suffer.</p>
<p>Implementation is very easy:</p>
<pre>E { background-image: url('image.svg'); }</pre>
<p>You’ll notice also a box labelled ‘<abbr>SVGZ</abbr>’ — the <code>background-image</code> on this element is in the compressed <abbr>SVG</abbr> format, <abbr>SVGZ</abbr>:</p>
<pre>E { background-image: url('image.svgz'); }</pre>
<p>The file size is less than one-third of the non-compressed version. In order to use this, you may need to configure your server; <a href="http://kaioa.com/node/45">full instructions for Apache servers can be found here</a>.</p>
<p>The drawback is that it’s not ready for use just yet — browsers that don’t support <abbr>SVG</abbr> in <code>background-image</code> will not provide any fallback, even if you supply another <code>background-image</code> value; so in non-supporting browsers, no image at all will be displayed.</p>
<p><strong>Update:</strong> I’ve found a technique for <a href="http://www.broken-links.com/2010/06/14/using-svg-in-backgrounds-with-png-fallback/">using <abbr>SVG</abbr> images with <abbr>PNG</abbr> fallback</a>.</p>
<p><em>The image used in this demo is from <a href="http://www.allfreevectors.com/free-tree-with-heart-13840.html">All Free Vectors</a>.</em></p>
<p><strong>Update (21/12/2010):</strong> Changed information about SVGZ, thanks to the comment from Robert Longson below.</p>
 <p><a href="http://www.broken-links.com/?flattrss_redirect&amp;id=843&amp;md5=bbb28108c5059a6f4f095cc04ceb625f" title="Flattr" target="_blank"><img src="http://www.broken-links.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.broken-links.com/2010/06/08/using-svg-in-background-image/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<atom:link rel="payment" href="http://www.broken-links.com/?flattrss_redirect&amp;id=843&amp;md5=bbb28108c5059a6f4f095cc04ceb625f" type="text/html" />
	</item>
		<item>
		<title>The importance of semantics on the web</title>
		<link>http://www.broken-links.com/2010/03/03/the-importance-of-semantics-on-the-web/</link>
		<comments>http://www.broken-links.com/2010/03/03/the-importance-of-semantics-on-the-web/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 10:14:44 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Basics]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[aboutness]]></category>
		<category><![CDATA[findability]]></category>
		<category><![CDATA[semantic web]]></category>
		<category><![CDATA[seo]]></category>

		<guid isPermaLink="false">http://www.broken-links.com/?p=690</guid>
		<description><![CDATA[We, as website makers, quite often advise our clients to avoid generic link text (read more,click here, etc.), and explain that more verbose descriptions help give context to users with screen readers. But using semantic link descriptions actually helps everyone.

I recently read Peter Morville's fantastic book, <a href="http://books.google.com/books?id=xJNLJXXbhusC">Ambient Findability</a>, which defined really well the motivation to use semantic descriptions for links: they give the target page <a href="http://en.wikipedia.org/wiki/Aboutness">aboutness</a>.]]></description>
			<content:encoded><![CDATA[<p>We, as website makers, quite often advise our clients to avoid generic link text (read more,click here, etc.), and explain that more verbose descriptions help give context to users with screen readers. But using semantic link descriptions actually helps everyone.</p>
<p>I recently read Peter Morville’s fantastic book, <a href="http://books.google.com/books?id=xJNLJXXbhusC">Ambient Findability</a>, which defined really well the motivation to use semantic descriptions for links: they give the target page <a href="http://en.wikipedia.org/wiki/Aboutness">aboutness</a>.</p>
<p><span id="more-690"></span></p>
<p>Simply defined, <strong>aboutness</strong> is the quality of meaning; what something is about is defined by its aboutness. To extend an example from Morville’s book, let’s regard a web page which contains W.H. Auden’s poem, <a href="http://www.davidpbrown.co.uk/poetry/wystan-hugh-auden.html">Funeral Blues</a>:</p>
<blockquote><p>
He was my North, my South, my East and West,<br />
My working week and my Sunday rest,<br />
My noon, my midnight, my talk, my song,<br />
I thought that love would last forever; I was wrong
</p></blockquote>
<p>Although <em>we</em> know that the poem is about death, the word itself doesn’t appear in the poem; so how could a search engine that indexed the page know what it was about, and return it in the results of a search on that topic?</p>
<p>In order to gain some context, the search engine will look at the text of the links to that page*; so a link with the text ‘read more’ will provide no context whatsoever, whereas a link with the text ‘W.H. Auden’s poem about death’ provides aboutness.</p>
<p>And it’s not just for our link text that semantics are important; the same principle applies with HTML — your markup gives aboutness to your content. So if you’re a front-end coder, be sure to at least use appropriate container elements (the <a href="http://html5doctor.com/">HTML5 Doctor</a> can help with this), and if you want to go further take a look at the likes of <a href="http://microformats.org/">Microformats</a> and <a href="http://www.w3.org/TR/xhtml-rdfa-primer/">RDFa</a>.</p>
<p>* Search engines look at more than this, of course, but this is the most obvious example.</p>
 <p><a href="http://www.broken-links.com/?flattrss_redirect&amp;id=690&amp;md5=27988b3c8adde05f750894b0a6e6e658" title="Flattr" target="_blank"><img src="http://www.broken-links.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.broken-links.com/2010/03/03/the-importance-of-semantics-on-the-web/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<atom:link rel="payment" href="http://www.broken-links.com/?flattrss_redirect&amp;id=690&amp;md5=27988b3c8adde05f750894b0a6e6e658" type="text/html" />
	</item>
		<item>
		<title>Firefox 3.6 uses the W3C File API</title>
		<link>http://www.broken-links.com/2009/12/15/firefox-3-6-uses-the-w3c-file-api/</link>
		<comments>http://www.broken-links.com/2009/12/15/firefox-3-6-uses-the-w3c-file-api/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 22:23:04 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[browsers]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[file api]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[firefox 3.6]]></category>

		<guid isPermaLink="false">http://www.broken-links.com/?p=670</guid>
		<description><![CDATA[Last month the W3C released a working draft of the <a href="http://www.w3.org/TR/FileAPI/">File API</a>, which <q cite="http://www.w3.org/TR/FileAPI/">defines the basic representations for files, lists of files, errors raised by access to files, and programmatic ways to read files</q>. The Firefox team <a href="http://hacks.mozilla.org/2009/12/w3c-fileapi-in-firefox-3-6/">have already implemented much of it</a>, and have released a series of impressive demos on <a href="http://hacks.mozilla.org/">hacks.mozilla.org</a>, which you can see if you have a recent beta of Firefox 3.6 (or a nightly trunk build).]]></description>
			<content:encoded><![CDATA[<p>Last month the W3C released a working draft of the <a href="http://www.w3.org/TR/FileAPI/">File API</a>, which <q cite="http://www.w3.org/TR/FileAPI/">defines the basic representations for files, lists of files, errors raised by access to files, and programmatic ways to read files</q>. The Firefox team <a href="http://hacks.mozilla.org/2009/12/w3c-fileapi-in-firefox-3-6/">have already implemented much of it</a>, and have released a series of impressive demos on <a href="http://hacks.mozilla.org/">hacks.mozilla.org</a>, which you can see if you have a recent beta of Firefox 3.6 (or a nightly trunk build).</p>
<p>The four demos shown to date display different (although related) aspects of the API, showing first <a href="http://hacks.mozilla.org/2009/12/multiple-file-input-in-firefox-3-6/">multiple file uploads</a>, then a <a href="http://hacks.mozilla.org/2009/12/file-drag-and-drop-in-firefox-3-6/">drag and drop upload interface</a>, next adding <a href="http://hacks.mozilla.org/2009/12/uploading-files-with-xmlhttprequest/">progress information</a> (although this doesn’t work for me), then <a href="http://hacks.mozilla.org/2009/12/firefox-36-fileapi-demo-reading-exif-data-from-a-local-jpeg-file/">reading EXIF data from a JPEG image</a>. You can imagine how these combined would be used for native drag and drop uploading to Flickr, for example.</p>
<p>The File API plays a big part in integrating the browser more tightly with the OS, particularly when combined with the drag and drop functionality, and I’m sure it’s only a matter of time until the other browsers implement this. Congratulations to the Firefox team for their work on this, and hacks.mozilla.org for some great demos.</p>
 <p><a href="http://www.broken-links.com/?flattrss_redirect&amp;id=670&amp;md5=88f47fb3c2819aa0e8a3a663227ee5d1" title="Flattr" target="_blank"><img src="http://www.broken-links.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.broken-links.com/2009/12/15/firefox-3-6-uses-the-w3c-file-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="http://www.broken-links.com/?flattrss_redirect&amp;id=670&amp;md5=88f47fb3c2819aa0e8a3a663227ee5d1" type="text/html" />
	</item>
		<item>
		<title>CSS gradient syntax: comparison of Mozilla and WebKit (Part 2)</title>
		<link>http://www.broken-links.com/2009/11/30/css-gradient-syntax-comparison-of-mozilla-and-webkit-part-2/</link>
		<comments>http://www.broken-links.com/2009/11/30/css-gradient-syntax-comparison-of-mozilla-and-webkit-part-2/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 19:23:11 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[browsers]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[syntax]]></category>
		<category><![CDATA[webkit]]></category>

		<guid isPermaLink="false">http://www.broken-links.com/?p=649</guid>
		<description><![CDATA[In <a href="/2009/11/26/css-gradient-syntax-comparison-of-mozilla-and-webkit/">the first part of this post</a> I gave a potted history of the differing syntaxes, and provided an overview of how that affected linear gradients. In this second part I'm going to look at radial gradients.

Here the syntaxes diverge slightly more, with WebKit requiring more values than Mozilla; while that adds some flexibility, it also increases the complexity.]]></description>
			<content:encoded><![CDATA[<p><em><strong>Update:</strong> I wrote this article in 2009. In early 2011 WebKit decided to change their syntax to match that used in Firefox (and the W3C specification). The syntax contained in these articles will be maintained for reasons of backwards-compatibility, but you should use the new syntax for the future.</em></p>
<p>In <a href="http://www.broken-links.com/2009/11/26/css-gradient-syntax-comparison-of-mozilla-and-webkit/">the first part of this post</a> I gave a potted history of the differing syntaxes, and provided an overview of how that affected linear gradients. In this second part I’m going to look at radial gradients.</p>
<p>Here the syntaxes diverge slightly more, with WebKit requiring more values than Mozilla; while that adds some flexibility, it also increases the complexity.</p>
<p><span id="more-649"></span></p>
<p>I’ll be using the same page of examples, which you’ll need to view in Safari / Chrome (or other WebKit derivative) or Firefox 3.6 (beta 3+):</p>
<p><a href="http://www.broken-links.com/tests/gradients/">CSS Gradients comparison: Mozilla &amp; WebKit</a></p>
<h2>Radial gradients</h2>
<p>As with linear gradients, the key differentiation between the <a href="https://developer.mozilla.org/en/CSS/-moz-radial-gradient">Mozilla syntax</a> and the <a href="http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariCSSRef/Articles/Functions.html#//apple_ref/doc/uid/TP40007955-SW25">WebKit syntax</a> is that the latter requires a start and end point, whereas the former is constrained by the bounding box.</p>
<p>You can see in this first example (<strong>Radial 1</strong>) that the Mozilla syntax is much shorter when making a simple two-colour radial gradient:</p>
<pre>-moz-radial-gradient(green, yellow);
-webkit-gradient(radial, center center, 0, center center, 70.5, from(green), to(yellow));</pre>
<p>In Mozilla’s case I set only start and end <code>color-stop</code>s; for WebKit I must specify a position (<em>50% 50%</em>) and radius (<em>0</em> — I’ll explain that later) for the start point, and a position (<em>50% 50%</em>) and radius (<em>70.5</em>) for the end point, as well as the <code>color-stop</code>s.</p>
<p>As far as I can see the radius value has to be a value in pixels, so in order for the end radius to be the diagonal of the square (where Mozilla defaults to) you need to use the calculation<em> (side)(sqrt(2))</em> — or, do what I did and use this <a href="http://easycalculation.com/area/square.php">online calculator</a>.</p>
<p>In the next example (<strong>Radial 2</strong>) I’ve offset the center of the gradient and set it to end at the furthest edge of the containing box:</p>
<pre>-moz-radial-gradient(40% 40%, farthest-side, green, yellow);
-webkit-gradient(radial, 40% 40%, 0, 40% 40%, 60, from(green), to(yellow));</pre>
<p>And then used the same center offset but constrained the radius to the distance of the nearest wall (<strong>Radial 3</strong>):</p>
<pre>-moz-radial-gradient(40% 40%, closest-side, green, yellow);
-webkit-gradient(radial, 40% 40%, 0, 40% 40%, 40, from(green), to(yellow));</pre>
<p>As you can see, Mozilla takes a series of constants using natural language — <code>farthest-side</code>, <code>closest-side</code>, <code>contain</code>, etc — to set the limits of the gradient, where WebKit accepts only pixel values. The advantage to the former approach is that the syntax is simpler and no calculations are required; the disadvantage is that if you want to create a radial gradient that is smaller than the limits of the containing box, you have to combine it with the <code>background-size</code> property.</p>
<p>Next (<strong>Radial 4</strong>) I’ve set the center of the gradient to the top-right corner, using three colours equally distributed; here’s where you can start to see the WebKit syntax start to become really unwieldy:</p>
<pre>-moz-radial-gradient(right top, green, yellow, blue);
-webkit-gradient(radial, right top, 0, right top, 141, from(green), color-stop(50%, yellow), to(blue));</pre>
<p>With WebKit I again have to specify start and end points (with radii), and also specify the stop position of the middle colour. Both outcomes are the same, but the Mozilla syntax is significantly easier.</p>
<p>One aspect of WebKit’s syntax which allows for more flexibility in a gradient is the start point and end point; by providing two separate values you can set the start gradient at a different point to the end gradient, as well as providing different radius values, allowing for effects that Mozilla can’t easily replicate (<strong>Radial 5</strong>):</p>
<pre>-moz-radial-gradient(60% 60%,circle contain,yellow,green 75%,rgba(255,255,255,0));
-webkit-gradient(radial,45% 45%,5,60% 60%,40,from(yellow),color-stop(75%, green),to(rgba(255,255,255,0)));</pre>
<p>You can see how that is rendered here (Mozilla on the left, WebKit on the right):</p>
<p><img src="/wp-content/uploads/2009/11/radial_gradient.png" alt="Comparison of CSS gradients" width="200" height="100" /></p>
<p>Achieving the same effect is only possible in Mozilla by using multiple values on the <code>background-image</code> property, <del datetime="2009-11-30T22:04:27+00:00">along with <code>background-size</code></del> (<strong>Update:</strong> This isn’t necessary; see <a href="#comment-35677">Tab Atkins Jr’s comment</a>, below).</p>
<h2>Conclusions</h2>
<p>While the (original) WebKit syntax does allow for a few effects that the simpler Mozilla implementation can’t easily copy, I think these are really edge cases and the simplicity of the newer syntax is more than ample compensation. It seems the CSS WG agree, which is why the simple syntax is to become an official proposal; I hope the WebKit team accept the proposal and implement it soon.</p>
<p>It was suggested that I also compare these with <a href="http://msdn.microsoft.com/en-us/library/ms532997%28VS.85%29.aspx">Internet Explorer’s Gradient filter</a>, but that’s a browser-specific implementation that has no chance of becoming a standard, so I didn’t feel it was suitable for this article; perhaps in a future extension.</p>
<p><strong>Update:</strong> Just after I finished this article, <a href="http://hacks.mozilla.org/2009/11/css-gradients-firefox-36/">Mozilla Hacks published an in-depth look at the new syntax</a>.</p>
 <p><a href="http://www.broken-links.com/?flattrss_redirect&amp;id=649&amp;md5=d771af7795b9926c9404f19880247bce" title="Flattr" target="_blank"><img src="http://www.broken-links.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.broken-links.com/2009/11/30/css-gradient-syntax-comparison-of-mozilla-and-webkit-part-2/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		<atom:link rel="payment" href="http://www.broken-links.com/?flattrss_redirect&amp;id=649&amp;md5=d771af7795b9926c9404f19880247bce" type="text/html" />
	</item>
	</channel>
</rss>

