 <?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, 30 Jul 2010 00:10:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<atom:link rel='hub' href='http://www.broken-links.com/?pushpress=hub'/>
		<item>
		<title>Using SVG in background-image</title>
		<link>http://www.broken-links.com/2010/06/08/using-svg-in-background-image/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=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[XML]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[standards]]></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 or Opera — ironically, this doesn’t seem to be implemented in Firefox nightlies at the time of writing:</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>If you’re looking at the demo in a WebKit browser, you’ll notice an empty box labelled ‘<abbr>SVGZ</abbr>’ — the <code>background-image</code> on this element is in the compressed <abbr>SVG</abbr> format, <abbr>SVGZ</abbr>, which only Opera supports:</p>
<pre>E { background-image: url('image.svgz'); }</pre>
<p>The file size is less than one-third of the non-compressed version.</p>
<p>The drawback of this 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>
]]></content:encoded>
			<wfw:commentRss>http://www.broken-links.com/2010/06/08/using-svg-in-background-image/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</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/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=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>
]]></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>
		</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/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=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[OS]]></category>
		<category><![CDATA[browsers]]></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>
]]></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>
		</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/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=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>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>
]]></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>15</slash:comments>
		</item>
		<item>
		<title>CSS gradient syntax: comparison of Mozilla and WebKit</title>
		<link>http://www.broken-links.com/2009/11/26/css-gradient-syntax-comparison-of-mozilla-and-webkit/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=css-gradient-syntax-comparison-of-mozilla-and-webkit</link>
		<comments>http://www.broken-links.com/2009/11/26/css-gradient-syntax-comparison-of-mozilla-and-webkit/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 15:48:32 +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[gradients]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[webkit]]></category>

		<guid isPermaLink="false">http://www.broken-links.com/?p=624</guid>
		<description><![CDATA[CSS Gradients were <a href="http://webkit.org/blog/175/introducing-css-gradients/">originally proposed by the WebKit team</a> in April 2008, modified from the syntax proposed for <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#colors-and-styles">the Canvas element of HTML5</a>. In August of this year, Mozilla announced <a href="/2009/08/08/new-background-rules-in-firefox-3-6/">an implementation slightly modified from that of WebKit</a> would be in the next version of Firefox (3.6).

Since then, however, the <abbr title="CSS Working Group">CSS WG</abbr> have discussed a <a href="http://www.xanthir.com/:4bhipd">different syntax</a>, and <a href="http://www.w3.org/blog/CSS/2009/10/01/resolutions_79">a resolution passed</a> to add this to the <a href="http://www.w3.org/TR/css3-images/">Image Values module</a>. <a href="http://weblogs.mozillazine.org/roc/archives/2009/11/css_gradient_sy.html">Mozilla have decided to implement the new syntax</a>, which is simpler than WebKit's but less flexible.

In this article, which will be split into at least two parts, I'm going to compare the two syntaxes.]]></description>
			<content:encoded><![CDATA[<p>CSS Gradients were <a href="http://webkit.org/blog/175/introducing-css-gradients/">originally proposed by the WebKit team</a> in April 2008, modified from the syntax proposed for <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#colors-and-styles">the Canvas element of HTML5</a>. In August of this year, Mozilla announced that <a href="http://www.broken-links.com/2009/08/08/new-background-rules-in-firefox-3-6/">an implementation slightly modified from that of WebKit</a> would be in the next version of Firefox (3.6).</p>
<p>Since then, however, the <abbr title="CSS Working Group">CSS WG</abbr> have discussed a <a href="http://www.xanthir.com/:4bhipd">different syntax</a>, and <a href="http://www.w3.org/blog/CSS/2009/10/01/resolutions_79">a resolution was passed</a> to add this to the <a href="http://www.w3.org/TR/css3-images/">Image Values module</a>. <a href="http://weblogs.mozillazine.org/roc/archives/2009/11/css_gradient_sy.html">Mozilla have decided to implement the new syntax</a>, which is simpler than WebKit’s but less flexible.</p>
<p>In this article, which will be split into at least two parts, I’m going to compare the two syntaxes.</p>
<p><span id="more-624"></span></p>
<p>Throughout both parts, I will be referring to the following demo page; you’ll need to be using Safari 4, Chrome, or Firefox 3.6beta3+ in order to see it working:</p>
<p><a href="http://www.broken-links.com/tests/gradients/">CSS Gradients comparison: Mozilla &amp; WebKit</a>.</p>
<p>The first and most noticeable difference is that the Mozilla implementation uses two properties – <code>–moz-linear-gradient</code> and <code>–moz-radial-gradient</code> – whereas WebKit use only a single property – <code>–webkit-gradient</code> – with two type values: <code>linear</code> and <code>radial</code>. That should become clearer as I progress.</p>
<p>Please note that I’ve tried to use the simplest syntax possible for all examples, but there may be occasions where I’ve slipped up. Feel free to correct me.</p>
<h2>Linear gradients</h2>
<p>The <a href="https://developer.mozilla.org/en/CSS/-moz-linear-gradient">Mozilla syntax</a> accepts three different properties: start point, angle of direction, and colour stops. <a href="http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariCSSRef/Articles/Functions.html#//apple_ref/doc/uid/TP40007955">WebKit’s</a> also takes three (excluding type: linear, as mentioned previously): start point, end point, and colour stops.</p>
<p>So a simple left-right gradient change (<strong>Linear 1</strong>) between two colours in Mozilla:</p>
<pre>-moz-linear-gradient (left, green, yellow);</pre>
<p>The <em>left</em> value sets the default position to the middle of the left-hand side (<em>0deg</em>, <em>0 50%</em> or <em>left center</em> does the same); the line then goes horizontally out passing from green to yellow in equal proportion.</p>
<p>To get the same pattern in WebKit:</p>
<pre>-webkit-gradient (linear, left center, right center, from(green), to(yellow));</pre>
<p>The start point is at <em>left center</em> (I could use unit values or percentages as Mozilla does, but not an angle), the end point at <em>right center</em>, and it also passes from green to yellow in equal proportion.</p>
<p>We can tweak those values slightly to get a diagonal gradient from the bottom left corner (<strong>Linear 2</strong>); for Mozilla I specify an angle, for WebKit I set new start and end points:</p>
<pre>-moz-linear-gradient(45deg,green,yellow);
-webkit-gradient(linear,left bottom,right top,from(green),to(yellow));</pre>
<p>I’ll tweak those values again to make a bottom-top gradient with an extra colour (<strong>Linear 3</strong>):</p>
<pre>-moz-linear-gradient(90deg,green,yellow,blue);
-webkit-gradient(linear,center bottom,center top,from(green),color-stop(0.5, yellow),to(blue));</pre>
<p>The big difference here is that Mozilla distributes the three colours proportionally, whereas WebKit’s <code>color-stop</code> function requires that I set a stop point — I’ve used <em>0.5</em> here, although I could have used <em>50%</em>. The <code>from</code> and <code>to</code> functions are shorthand for <code>color-stop</code> values <em>0</em> and <em>1</em> (or <em>100%</em>), respectively.</p>
<p>I don’t have to distribute the colours evenly, however; by changing the value in the colour stop I can choose my own ratio. In the final example (<strong>Linear 4</strong>) I’ve set the yellow to begin 25% along the length of the gradient:</p>
<pre>-moz-linear-gradient(90deg,green,yellow 25%,blue);
-webkit-gradient(linear,center bottom,center top,from(green),color-stop(25%, yellow),to(blue));</pre>
<p>For Webkit I only have to update the <code>color-stop</code> value; for Mozilla, I have to specify it.</p>
<h2>Conclusions</h2>
<p>There are a few differences in the syntaxes for linear gradients, but they’re not major; Mozilla use an angle value, where WebKit use a point-to-point system. I’d say Mozilla’s is the easier to grasp purely because of its brevity, but it’s not that important. In the second part of this article I’ll talk about radial gradients, and it’s there that the differences in implementation become more pronounced.</p>
<p><strong>Update:</strong> <a href="http://www.broken-links.com/2009/11/30/css-gradient-syntax-comparison-of-mozilla-and-webkit-part-2/">Part 2 of this article, about Radial Gradients, is now available</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.broken-links.com/2009/11/26/css-gradient-syntax-comparison-of-mozilla-and-webkit/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>HTML5 Round-up</title>
		<link>http://www.broken-links.com/2009/09/28/html5-round-up/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=html5-round-up</link>
		<comments>http://www.broken-links.com/2009/09/28/html5-round-up/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 22:45:53 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[html]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://www.broken-links.com/?p=567</guid>
		<description><![CDATA[There’s been a noticeable increase in chatter about HTML5 recently, as the spec is moving towards Last Call status in October. The working group now has three co-chairs (from Apple, Microsoft, and IBM) and, despite some debate over semantics, the Working Draft of the spec was recently updated.]]></description>
			<content:encoded><![CDATA[<p>There’s been a noticeable increase in chatter about HTML5 recently, as the spec is moving towards Last Call status in October. <a href="http://www.theregister.co.uk/2009/08/31/three_html_5_leads/">The working group now has three co-chairs</a> (from Apple, Microsoft, and IBM) and, despite some <a href="http://visitmix.com/Opinions/The-HTML5-Semantics-Debate">debate over semantics</a>, the <a href="http://www.w3.org/TR/2009/WD-html5-20090825/">Working Draft of the spec was recently updated</a>.</p>
<p><span id="more-567"></span></p>
<p>Earlier this month a group of high-profile developers—including <a href="http://simplebits.com/notebook/2009/08/31/html5.html">Dan Cederholm</a> and <a href="http://www.zeldman.com/2009/08/31/loving-html5/">Jeffrey Zeldman</a>—got together to discuss the spec and declare their support (albeit with some caveats) for the direction it’s moving in. Although I’m not comfortable with the self-aggrandising name they chose—the <a href="http://www.zeldman.com/superfriends/">HTML5 Super Friends</a>—their support is a positive move and their concerns have already made an impact in the <a href="http://html5doctor.com/september-html5-spec-changes/">September updates</a> to the language.</p>
<p>It must be noted, however, that the ‘Super Friends’ concentrated on the markup language, while another aspect (the drag and drop module) has been <a href="http://www.quirksmode.org/blog/archives/2009/09/the_html5_drag.html">roundly savaged in a strongly-worded attack by QuirksBlog’s Peter-Paul Koch</a>.</p>
<p>Many browsers now have HTML5 implemented to varying degrees (Opera 10 is first with <a href="http://people.opera.com/brucel/demo/html5-forms-demo.html">HTML5 Forms</a>, for example), so if you haven’t already, it’s time to start learning. <a href="http://www.alistapart.com/articles/get-ready-for-html-5/">A List Apart gave a concise introduction</a>, and the document highlighting <a href="http://www.w3.org/TR/2009/WD-html5-diff-20090825/">differences from HTML4</a> is also a good starting point.</p>
<p>But if you want advice, the best thing you can do is see <a href="http://html5doctor.com/">the Doctor</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.broken-links.com/2009/09/28/html5-round-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Misunderstanding markup</title>
		<link>http://www.broken-links.com/2009/07/31/misunderstanding-markup/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=misunderstanding-markup</link>
		<comments>http://www.broken-links.com/2009/07/31/misunderstanding-markup/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 00:22:20 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Asides]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[comics]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.broken-links.com/?p=490</guid>
		<description><![CDATA[Misunderstanding Markup: an explanation of the different flavours of HTML &#38; XHTML, in comic strip form, by Brad Colbow. I’m not sure if it makes Jeremy Keith’s original blog post any easier to understand, but it’s certainly more fun to look at.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.smashingmagazine.com/2009/07/29/misunderstanding-markup-xhtml-2-comic-strip/">Misunderstanding Markup: an explanation of the different flavours of HTML &amp; XHTML, in comic strip form</a>, by <a href="http://www.bradcolbow.com/">Brad Colbow</a>. I’m not sure if it makes <a href="http://adactio.com/journal/1595">Jeremy Keith’s original blog post</a> any easier to understand, but it’s certainly more fun to look at.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.broken-links.com/2009/07/31/misunderstanding-markup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bad advice: people still teaching CSS hacks</title>
		<link>http://www.broken-links.com/2009/07/27/bad-advice-people-still-teaching-css-hacks/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=bad-advice-people-still-teaching-css-hacks</link>
		<comments>http://www.broken-links.com/2009/07/27/bad-advice-people-still-teaching-css-hacks/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 22:13:26 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[best practice]]></category>
		<category><![CDATA[hacks]]></category>

		<guid isPermaLink="false">http://www.broken-links.com/?p=476</guid>
		<description><![CDATA[There's so much great stuff written about web standards available for free on the web that it's easy to forget how much bad stuff is also out there; and how many people are willing to support it just because it's easier than putting in a little extra effort to follow best practice.]]></description>
			<content:encoded><![CDATA[<p>There’s so much great stuff written about web standards available for free on the web that it’s easy to forget how much bad stuff is also out there; and how many people are willing to support it just because it’s easier than putting in a little extra effort to follow best practice.</p>
<p>Over the weekend one of the most popular stories on Delicious.com was teaching the use of <a href="http://briancray.com/2009/04/16/target-ie6-and-ie7-with-only-1-extra-character-in-your-css/">lazy CSS hacks</a>, the type of which I thought everybody was convinced enough to do away with; <a href="http://www.ejeliot.com/blog/63">the star and underscore hacks</a> for targeting IE6 &amp; IE7, the hacks which we’ve been saying (<a href="http://24ways.org/2005/avoiding-css-hacks-for-internet-explorer">for years</a>) shouldn’t be used anymore.</p>
<p>Disregarding the ‘rights’ and ‘wrongs’, and the validation argument — some of my stylesheets don’t validate, and there are good reasons for that — I’d like to give a few other reasons why using this method is not a good idea.</p>
<p><span id="more-476"></span></p>
<p>First and foremost, <strong>maintainability</strong>; separating out the rules for outdated browsers with conditional comments leaves your standards-compliant stylesheets clean and easy to manage; you don’t have to wade through multiple rules looking for the ones you need. IE6 &amp; IE7 styles are safely out of sight.</p>
<p>Second, and one of the core arguments for not using hacks, is <strong>future-proofing</strong>; using a hack like this in the main stylesheet could lead to a situation in the future where a new browser — or new version of a current browser — could render this hack incorrectly. It may not be likely, but can you <em>guarantee</em> no future browser will not render strangely when interpreting these rules?</p>
<p>As well as practical reasons not to use hacks, there is one good moral reason: <strong>to not be lazy</strong>. Writing the syntax for conditional comments takes less than a minute, and while using hacks means there is some reduction in the number of characters required,  complex stylesheets can contain dozens — or even hundreds — of rules, and adding those hacks for each rule will mean you end up using almost as many characters as you would with conditional comments.</p>
<p>It’s pretty disheartening to see comments that suggest standards are just for people who want to sell books or conference tickets; standards are to make the jobs of web developers easier. Even the lazy and bone-headed ones.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.broken-links.com/2009/07/27/bad-advice-people-still-teaching-css-hacks/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>The state of video on the web</title>
		<link>http://www.broken-links.com/2009/07/01/the-state-of-video-on-the-web/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=the-state-of-video-on-the-web</link>
		<comments>http://www.broken-links.com/2009/07/01/the-state-of-video-on-the-web/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 09:52:03 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Asides]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[patents]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[w3c]]></category>

		<guid isPermaLink="false">http://www.broken-links.com/2009/07/01/the-state-of-video-on-the-web/</guid>
		<description><![CDATA[As Firefox 3.5 brings open video to the web, the W3C decide to drop codec requirements from the HTML 5 spec, citing disagreement between browser makers and concern over patents. Luckily, there’s a way to make video for everybody, which means encoding each clip only twice.]]></description>
			<content:encoded><![CDATA[<p>As <a href="http://www.webmonkey.com/blog/How_Firefox_Is_Pushing_Open_Video_Onto_the_Web">Firefox 3.5 brings open video to the web</a>, <a href="http://www.webmonkey.com/blog/W3C_Drops_Audio_and_Video_Codec_Requirements_From_HTML_5">the W3C decide to drop codec requirements from the HTML 5 spec</a>, citing disagreement between browser makers and concern over patents. Luckily, there’s a way to make <a href="http://camendesign.com/code/video_for_everybody">video for everybody</a>, which means encoding each clip only twice.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.broken-links.com/2009/07/01/the-state-of-video-on-the-web/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HTML 5 &amp; web fonts; exciting times</title>
		<link>http://www.broken-links.com/2009/05/28/exciting-times-html-5-web-fonts/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=exciting-times-html-5-web-fonts</link>
		<comments>http://www.broken-links.com/2009/05/28/exciting-times-html-5-web-fonts/#comments</comments>
		<pubDate>Thu, 28 May 2009 23:24:57 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Typography]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[web fonts]]></category>

		<guid isPermaLink="false">http://www.broken-links.com/?p=422</guid>
		<description><![CDATA[With (standards-compliant) browser innovation firmly back on the agenda, there's a lot of exciting new technology to get to grips with. This week, Google have thrown their weight firmly behind HTML5, while a new start-up aims to bring web fonts to all.]]></description>
			<content:encoded><![CDATA[<p>With (standards-compliant) browser innovation firmly back on the agenda, there’s a lot of exciting new technology to get to grips with. This week, Google have thrown their weight firmly behind HTML5, while a new start-up aims to bring web fonts to all.</p>
<p><span id="more-422"></span></p>
<p>Starting with the latter, I today discovered that Jeffrey Veen’s new company, Small Batch Inc., has started touting a new licensing service for web fonts. It’s called <a href="http://blog.typekit.com/2009/05/27/introducing-typekit/">TypeKit</a> and, while details are scarce, it seems to be a server to host web fonts with some Javascript magic to not make them downloadable to end users.</p>
<p>It’s an intriguing solution to <a href="http://www.broken-links.com/2008/08/04/an-alternative-suggestion-for-web-fonts-licensing/">the problem I mentioned before</a>, even if I’m not convinced it is the right solution; without knowing the specifics, it seems to me there are two fairly obvious sticking points:</p>
<p>First, how do we develop the site using the font if the license is only for the production server? Will there be a special development license, or will we have to buy a copy of the font and then an extra licensing fee?</p>
<p>Second, what about server latency (will there be a long lag until the fonts appear?) and uptime (how irritating will it be if the server is constantly falling over?).</p>
<p>I look forward to seeing how those issues are addressed. I personally don’t see a problem in the current/forthcoming Safari/Firefox implementation — but then, I’m not a type foundry.</p>
<p>It’s Google’s I/O event this week, and <a href="http://www.webmonkey.com/blog/Google_Throws_Its_Weight_Behind_HTML_5">they’re making a big deal about supporting some of the new HTML5 syntax</a> — principally, the <code>video</code> element, an example of which is on this <a href="http://www.youtube.com/html5">YouTube mock-up</a> (Firefox 3.5, Safari 4, or Chrome 3 required).</p>
<p>So stable is the new element that video site <a href="http://blog.dailymotion.com/2009/05/27/watch-videowithout-flash/">dailymotion.com have announced that they have converted 300,000 of their videos to use it</a>, and the open video codec Ogg Theora. With all of the main non-IE browsers about to launch their implementation, adoption will hopefully be pretty rapid.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.broken-links.com/2009/05/28/exciting-times-html-5-web-fonts/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
