 <?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</title>
	<atom:link href="http://www.broken-links.com/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>Thu, 02 Sep 2010 10:34:27 +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>Playing WebM in Safari with plugins</title>
		<link>http://www.broken-links.com/2010/09/01/playing-webm-in-safari-with-plugins/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=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[Plugins]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[standards]]></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>
]]></content:encoded>
			<wfw:commentRss>http://www.broken-links.com/2010/09/01/playing-webm-in-safari-with-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Where do I find out what’s new in WebKit?</title>
		<link>http://www.broken-links.com/2010/08/22/where-do-i-find-out-whats-new-in-webkit/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=where-do-i-find-out-whats-new-in-webkit</link>
		<comments>http://www.broken-links.com/2010/08/22/where-do-i-find-out-whats-new-in-webkit/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 22:07:05 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[browsers]]></category>

		<guid isPermaLink="false">http://www.broken-links.com/?p=917</guid>
		<description><![CDATA[I’m a big fan of using nightly and pre-release versions of browsers; not for day-to-day use, but to find out what new features are on their way. Obviously this is made a lot easier when detailed changelogs are provided. Firefox do a great job of this with their website The Burning Edge, which gives fortnightly [...]]]></description>
			<content:encoded><![CDATA[<p>I’m a big fan of using nightly and pre-release versions of browsers; not for day-to-day use, but to find out what new features are on their way. Obviously this is made a lot easier when detailed changelogs are provided.</p>
<p>Firefox do a great job of this with their website <a href="http://www.squarefree.com/burningedge/">The Burning Edge</a>, which gives fortnightly (more or less) lists of changes in the latest trunk builds, and <a href="http://my.opera.com/desktopteam/blog/">Opera’s Desktop Team Blog</a> does likewise on a semi-regular basis. The Internet Explorer team have done a good job of documenting all the changes in IE9 with the <a href="http://ie.microsoft.com/testdrive/info/ReleaseNotes/Default.html">Platform Preview Release Notes</a>.</p>
<p>The notable exception seems to be WebKit. I’ve looked around but I can’t find any site which gives an overview of changes in the nightly builds. I could subscribe to the RSS feed of their <a href="http://trac.webkit.org/">Trac</a>, but it would be a nightmare trying to find the interesting features amongst all the technical changes. The <a href="http://webkit.org/blog/">Surfin’ Safari</a> and <a href="http://planet.webkit.org/">Planet WebKit</a> aren’t any help.</p>
<p>So does anyone know how to find this information for WebKit? I can’t believe it doesn’t exist.</p>
<p><strong>Update:</strong> As if by magic, look what I found just a day later: <a href="http://peter.sh/2010/08/last-week-in-webkit-and-chromium/">Last week in.. WebKit and Chromium!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.broken-links.com/2010/08/22/where-do-i-find-out-whats-new-in-webkit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Encoding Video for Android</title>
		<link>http://www.broken-links.com/2010/07/30/encoding-video-for-android/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=encoding-video-for-android</link>
		<comments>http://www.broken-links.com/2010/07/30/encoding-video-for-android/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 00:07:52 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.broken-links.com/?p=900</guid>
		<description><![CDATA[In my previous post, Making HTML5 Video work on Android phones, I said that you have to encode your videos as .m4v in order for them to work in Android. This isn’t actually correct. The suffix can be either .mp4 or .m4v, what matters is the way the video is encoded. Now, there are loads [...]]]></description>
			<content:encoded><![CDATA[<p>In my previous post, <a href="http://www.broken-links.com/2010/07/08/making-html5-video-work-on-android-phones/">Making HTML5 Video work on Android phones</a>, I said that you have to encode your videos as <code>.m4v</code> in order for them to work in Android. This isn’t actually correct. The suffix can be either <code>.mp4</code> or <code>.m4v</code>, what matters is the way the video is encoded.</p>
<p>Now, there are loads of blog and forum posts which give differing advice on presets and parameters, and I’m no expert — so what I’ll do is just show you two quick ways that worked for me (I have a Samsung Galaxy S).</p>
<p><span id="more-900"></span></p>
<p>A couple of things to note: this post refers specifically to video embedded in web pages with the <code>video</code> element, so the other two requirements from my previous blog post still stand; also, the methods shown below should mean your videos play on iOS too, so you don’t have to encode for different platforms.</p>
<p>The first is cross-platform, using <a href="http://handbrake.fr/">Handbrake</a>. What I did with this was to use the <strong>iPhone &amp; iPod Touch</strong> preset, check the <strong>Web Optimized</strong> option, and change the <strong>Average bitrate</strong> option (in the <strong>Quality</strong> section) to <em>~1000kbps</em> (you should then save this as a new preset called Android).</p>
<p>You’ll also need to change the size of the output video in the <strong>Picture Settings</strong> options — I changed mine to 480 wide (keeping the aspect ratio) and they came out really crisp and sharp. You can see the result of that below (if your browser supports it).</p>
<p><video controls height="272" poster="/tests/images/BBB_480_Poster.jpg" src="/tests/media/BBB_480_HB.mp4" width="480"></video></p>
<p>The second method is also cross-platform, and uses <a href="http://videolan.org/"><abbr>VLC</abbr></a> (I’m using version 1.1.1, not sure if older versions work the same). It involves more set-up the first time around, but will be easier with each subsequent conversion. <strong>Update:</strong> I was using VLC for Linux, but the OSX version seems to be quite different.</p>
<p>Go to <strong>Media &gt; Convert/Save</strong>, add the file to be converted, and choose <strong>Convert</strong> from the selection at the bottom. Name your <strong>Destination File</strong> <em>[filename].mp4</em>, and from the <strong>Profile</strong> list choose <em>Video — H.264 + AAC (TS)</em>.</p>
<p>Hit the <strong>Edit</strong> icon next to the list, and go through each tab in turn; in <strong>Encapsulation</strong> choose <em>MP4/MOV</em>; in <strong>Video Codec</strong> un-check the <em>Keep original video track box</em>, choose<em> H-264</em> from the <em>Codec</em> list, empty the <em>Scale</em> field and enter a value in <em>Width</em> (I used 480); in <strong>Audio</strong> un-check the <em>Keep original audio track</em> box and select <em>MPEG4 Audio (AAC)</em> from the <em>Codec</em> list. Now click <strong>Save</strong>, and all of these settings will be remembered so you don’t have to enter them again.</p>
<p>With all that done, hit <strong>Start</strong> to encode your video. You can see the result of the <abbr>VLC</abbr> encoding below. <strong>Update:</strong> This video doesn’t seem to play on iOS.</p>
<p><video controls height="270" poster="/tests/images/BBB_480_Poster.jpg" src="/tests/media/BBB_480_VLC.mp4" width="480"></video></p>
<p>The third method is the simplest, but works on Mac <abbr>OSX</abbr> 10.6 only. Open up your source video in Quicktime, then go to <strong>File &gt; Save As</strong>. Choose <strong>iPhone</strong> from the <strong>Format</strong> selector. You get less control over your output with this — the width is always 480 and the bitrate is calculated automatically — but it works without fuss. The output of this method is shown below.</p>
<p><video controls height="270" poster="/tests/images/BBB_480_Poster.jpg" src="/tests/media/BBB_480_QT.m4v" width="480"></video></p>
<p>A slightly more convoluted method is to use <a href="http://www.doubletwist.com/">DoubleTwist</a>, which performs on-the-fly conversion. Connect your Android device, then transfer your video to it — the optimum parameters will be automatically selected. When complete, copy the file back from the device to your computer. (I haven’t actually tried this myself).</p>
<p>I’ve read that you can use <a href="http://winff.org/">WinFF</a>, although I haven’t been able to make this work so far.</p>
<p>I’ll keep this post updated as I discover different methods, and do feel free to let me know in the comments what works for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.broken-links.com/2010/07/30/encoding-video-for-android/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Making HTML5 Video work on Android phones</title>
		<link>http://www.broken-links.com/2010/07/08/making-html5-video-work-on-android-phones/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=making-html5-video-work-on-android-phones</link>
		<comments>http://www.broken-links.com/2010/07/08/making-html5-video-work-on-android-phones/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 16:26:10 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[webkit]]></category>

		<guid isPermaLink="false">http://www.broken-links.com/?p=890</guid>
		<description><![CDATA[I recently became the owner of an Android phone* and found that, despite it being listed as a feature of the browser, the HTML5 video element didn’t work for almost all of the examples I tried. I’ve just done some experimentation with this and think I’ve found a solution, so this post is offered in [...]]]></description>
			<content:encoded><![CDATA[<p>I recently became the owner of an Android phone* and found that, despite it being listed as a feature of the browser, the HTML5 <code>video</code> element didn’t work for almost all of the examples I tried. I’ve just done some experimentation with this and think I’ve found a solution, so this post is offered in the hope that it helps anyone who may be tearing their hair out over the same problem.</p>
<p><span id="more-890"></span></p>
<p>From what I can tell, there are three requirements for <code>video</code> to work in Android browsers:</p>
<ol>
<li>You must not use the <code>type</code> attribute when calling the video</li>
<li>You must manually call the <code>play()</code> method using JavaScript</li>
<li><del datetime="2010-07-29T13:46:34+00:00">The video must be encoded as <em>.m4v</em>, not <em>.mp4</em></del> <strong>Update:</strong> This is not correct (see below)</li>
</ol>
<p><strong>Update:</strong> This may be a specific encoding issue rather than all <em>.mp4</em>s; some <em>.mp4</em> videos seem to play with no problems, others do not. <strong>Further update:</strong> The video type was a red herring; see my follow-up post, <a href="http://www.broken-links.com/2010/07/30/encoding-video-for-android/">Encoding Video for Android</a>, for more about this.</p>
<p>You can see this working in the demo attached to an older post of mine: <a href="http://broken-links.com/tests/video/">Demo: HTML5 Video Controls With JavaScript</a>. This works, <attr title="as far as I know">AFAIK</abbr>, in Android, iPhone and all video-enabled desktop browsers. The markup I’ve used is:</p>
<pre>&lt;video id="video" autobuffer height="240" width="360"&gt;
&lt;source src="BigBuck.m4v"&gt;
&lt;source src="BigBuck.webm" type="video/webm"&gt;
&lt;source src="BigBuck.theora.ogv" type="video/ogg"&gt;
&lt;/video></pre>
<p>The first <code>source</code> element calls the video in <em>.m4v</em> format, without specifying the <abbr>MIME</abbr> type in the <code>type</code> attribute; I’ve tried both <em>video/mp4</em> and <em>video/x-m4v</em>, and neither works. Omitting the type attribute altogether lets the video play, and seems to have no ill-effect on other browsers which play the <em>.m4v</em> file.</p>
<p>In order to play the video in Android, I also have an event listener in the JavaScript which plays the video when the element is clicked on, somewhat like this:</p>
<pre>var video = document.getElementById('video');
video.addEventListener('click',function(){
  document.play();
},false);</pre>
<p>I tested this on my own phone and an HTC Desire, and it works just fine on both. Hope this is of help to someone.</p>
<p>* It’s a <a href="http://galaxys.samsungmobile.com/">Samsung Galaxy S</a>, and I’m delighted by it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.broken-links.com/2010/07/08/making-html5-video-work-on-android-phones/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Web Directions @media 2010</title>
		<link>http://www.broken-links.com/2010/06/21/web-directions-media-2010/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=web-directions-media-2010</link>
		<comments>http://www.broken-links.com/2010/06/21/web-directions-media-2010/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 13:50:11 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Asides]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[@media]]></category>
		<category><![CDATA[atmedia]]></category>
		<category><![CDATA[conference]]></category>

		<guid isPermaLink="false">http://www.broken-links.com/?p=883</guid>
		<description><![CDATA[Usually when I attend @media (that is, on two previous occasions) I write a follow-up blog post on what I saw there. Well I attended this year, and I’ve written the post, but it’s on the blog of my employer, Preloaded: HTML5, Mobile, and UCD: what we saw at @media.]]></description>
			<content:encoded><![CDATA[<p>Usually when I attend <a href="http://atmedia.webdirections.org/">@media</a> (that is, on two previous occasions) I write a follow-up blog post on what I saw there. Well I attended this year, and I’ve written the post, but it’s on the blog of my employer, Preloaded: <a href="http://preloaded.com/blog/2010/06/14/what-we-saw-atmedia/">HTML5, Mobile, and UCD: what we saw at @media</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.broken-links.com/2010/06/21/web-directions-media-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using SVG in backgrounds with PNG fallback</title>
		<link>http://www.broken-links.com/2010/06/14/using-svg-in-backgrounds-with-png-fallback/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=using-svg-in-backgrounds-with-png-fallback</link>
		<comments>http://www.broken-links.com/2010/06/14/using-svg-in-backgrounds-with-png-fallback/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 13:04:38 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Miscellanea]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[background]]></category>
		<category><![CDATA[png]]></category>
		<category><![CDATA[svg]]></category>
		<category><![CDATA[technique]]></category>

		<guid isPermaLink="false">http://www.broken-links.com/?p=861</guid>
		<description><![CDATA[My last post was about using SVG values for the background-image property, and I pointed out one big problem with the technique: The drawback of this is that it’s not ready for use just yet—browsers that don’t support SVG in background-image will not provide any fallback, even if you supply another background-image value; so in [...]]]></description>
			<content:encoded><![CDATA[<p>My last post was about <a href="http://www.broken-links.com/2010/06/08/using-svg-in-background-image/">using <abbr title="Scalable Vector Graphics">SVG</abbr> values for the <code>background-image</code> property</a>, and I pointed out one big problem with the technique:</p>
<blockquote><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></blockquote>
<p>This was annoying me a little, and I couldn’t find any workarounds that didn’t use JavaScript. However, after a bit of head-scratching I’ve come up with a way to get around it.</p>
<p><span id="more-861"></span></p>
<p>In order to have browsers which don’t support <abbr>SVG</abbr> display a <abbr>PNG</abbr> image instead, you should use this code:</p>
<pre>E {
background-image:  url('image.png');
background-image:  none,url('image.svg'), url('image.png');
background-size: 100% 100%;
}</pre>
<p>Browsers which support <abbr>SVG</abbr> and multiple backgrounds will show the <abbr>SVG</abbr>; browsers which don’t support <abbr>SVG</abbr> will fall back to the <abbr>PNG</abbr> in the <code>background-image</code> stack. As far as I know, all browsers which support <abbr>SVG</abbr> also support multiple backgrounds; any which don’t (i.e. <abbr>IE</abbr>) will fall back to the <abbr>PNG</abbr> in the first <code>background-image</code> declaration.</p>
<p><strong>Update:</strong> Thanks to a comment I have amended this technique. <abbr>IE</abbr> was not falling back to the first <code>background-image</code> as it should have done, but I got around this by adding a <em>none</em> value in the declaration. This invalidates the rule in <abbr>IE</abbr> and forces the fallback to the previous declaration.</p>
<p>You can see a demonstration of it here: <a href="http://www.broken-links.com/tests/svg/svg_hack.html">Background SVG with PNG fallback — demo</a>.</p>
<p>This technique is not without its own caveats, however. First and foremost, the <abbr>SVG</abbr> must not have a transparent background, or else the <abbr>PNG</abbr> in the background layer below it will probably show through. Also, depending on how fast the <abbr>SVG</abbr> file loads, the <abbr>PNG</abbr> file may show up first and then be covered over.</p>
<p>Finally, if you’re using the same background image at different sizes and either your browser doesn’t support <code>background-size</code> or you don’t want automatically resized <abbr>PNG</abbr>s, you’ll have to use the rule for each instance:</p>
<pre>E {
background-image:  url('image-small.png');
background-image:  none,url('image.svg'), url('image-small.png');
background-size: 100% 100%;
}

F {
background-image:  url('image-large.png');
background-image:  none,url('image.svg'), url('image-large.png');
background-size: 100% 100%;
}</pre>
<p>And of course, if you’re creating multiple <abbr>PNG</abbr> images anyway, you may feel there’s not a lot of point in using <abbr>SVG</abbr> images as well. I’ll be the first to admit that this isn’t a completely bulletproof technique, but I offer it in the hope that in certain circumstances it could be useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.broken-links.com/2010/06/14/using-svg-in-backgrounds-with-png-fallback/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<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>My Name In Print</title>
		<link>http://www.broken-links.com/2010/05/26/my-name-in-print/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=my-name-in-print</link>
		<comments>http://www.broken-links.com/2010/05/26/my-name-in-print/#comments</comments>
		<pubDate>Wed, 26 May 2010 13:06:31 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Miscellanea]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[glow]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[magazine]]></category>
		<category><![CDATA[print]]></category>
		<category><![CDATA[selfpromotion]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.broken-links.com/?p=814</guid>
		<description><![CDATA[I hope you’ll forgive a little self-promotion, as I’d just like to play a few quick notes on my own trumpet. The latest issue of Net magazine is now on sale, and features a tutorial article, Create A Dynamic Content Panel, written by me. In the article I explain how to build a dynamic Contact [...]]]></description>
			<content:encoded><![CDATA[<p>I hope you’ll forgive a little self-promotion, as I’d just like to play a few quick notes on my own trumpet. <a href="http://www.netmag.co.uk/zine/latest-issue/issue-203">The latest issue of Net magazine</a> is now on sale, and features a tutorial article, <em>Create A Dynamic Content Panel</em>, written by me.</p>
<p>In the article I explain how to build a dynamic Contact area, as we did on our recent redesign of <a href="http://preloaded.com/">Preloaded.com</a>, using the <a href="http://www.w3.org/TR/webstorage/">Web Storage API</a> and <a href="http://www.bbc.co.uk/glow/">the BBC’s Glow Javascript library</a>.</p>
<p>I’m not sure what the rights situation is with this article, but I hope that at some point in the future I’ll be able to post it here on my blog. But in the meantime, you can buy a copy of Net magazine in the UK at all good newsagents, as the saying goes (I don’t know if it will be in overseas editions also).</p>
<p><img src="/wp-content/uploads/2010/05/tut_js-1.jpg" alt="Printed Tutorial" title="Tutorial Page 1" width="190" height="250" class="aligncenter size-full wp-image-833" /><img src="/wp-content/uploads/2010/05/tut_js-2.jpg" alt="Printed Tutorial" title="Tutorial Page 2" width="190" height="250" class="aligncenter size-full wp-image-834" /><img src="/wp-content/uploads/2010/05/tut_js-3.jpg" alt="Printed Tutorial" title="Tutorial Page 3" width="190" height="250" class="aligncenter size-full wp-image-835" /></p>
<p>On the subject of print, I’m also currently writing a book about CSS3 which should be published later this year. I’ll have more information on that nearer the time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.broken-links.com/2010/05/26/my-name-in-print/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New to Firefox: –moz-calc and :-moz-any</title>
		<link>http://www.broken-links.com/2010/05/17/new-to-firefox-moz-calc-and-moz-any/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=new-to-firefox-moz-calc-and-moz-any</link>
		<comments>http://www.broken-links.com/2010/05/17/new-to-firefox-moz-calc-and-moz-any/#comments</comments>
		<pubDate>Mon, 17 May 2010 13:00:37 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[browsers]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[calculations]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[experimental]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[selectors]]></category>

		<guid isPermaLink="false">http://www.broken-links.com/?p=795</guid>
		<description><![CDATA[The latest nightly releases of what will become Firefox 4 have implemented a couple of experimental new CSS features. The –moz-calc function allows calculations on length values, and the :-moz-any selector permits grouping of simple selectors. If you have a nightly build of Firefox you can see a little demo I’ve put together of them [...]]]></description>
			<content:encoded><![CDATA[<p>The latest nightly releases of what will become Firefox 4 have <a href="http://www.squarefree.com/burningedge/2010/05/12/2010-05-12-trunk-builds/">implemented a couple of experimental new CSS features</a>. The <code>–moz-calc</code> function allows calculations on length values, and the <code>:-moz-any</code> selector permits grouping of simple selectors.</p>
<p>If you have a <a href="http://www.mozilla.org/developer/#builds">nightly build of Firefox</a> you can see a little <a href="http://www.broken-links.com/tests/calc-any/">demo</a> I’ve put together of them in action.</p>
<p><span id="more-795"></span></p>
<p>The first new property is <code>–moz-calc</code>, which is the experimental implementation of CSS3’s <a href="http://www.w3.org/TR/css3-values/#calc"><code>calc</code> function</a>. This allows you to perform simple mathematical functions on length values.</p>
<p>Take a look at the <a href="http://www.broken-links.com/tests/calc-any/">demo</a>, where you’ll see two <code>h2</code> elements; both have the same styles applied to them, but the second also has some extra <code>calc</code> values for some of its properties:</p>
<pre>font-size: -moz-calc(120% * 3);
letter-spacing: -moz-calc(0 + 2px);
text-shadow: rgba(0,0,0,0.33) -moz-calc(4px / 2) -moz-calc(4px / 2);
word-spacing: -moz-calc(0.75em - 0.25em);</pre>
<p>The <code>font-size property</code> has a value of <em>120% * 3</em>, or <em>360%;</em> the <code>letter-spacing</code> property has a value of <em>0 + 2px</em>, or <em>2px</em>; the <code>text-shadow</code> property has x and y offset values of <em>4px / 2</em>, or <em>2px</em>; and the <code>word-spacing</code> property has a value of <em>0.75em — 0.25em</em>, or <em>0.5em</em>.</p>
<p>The values themselves are abitrary and not important; what matters is that we’re doing calculations in CSS!</p>
<p>At the moment the only properties which support <code>–moz-calc</code> values are:<code>–moz-column-rule-width</code>, <code>–moz-column-width</code>, <code>letter-spacing</code>, <code>word-spacing</code>, <code>marker-offset</code>, <code>outline-offset</code>, <code>border-spacing</code>, <code>text-shadow</code> and <code>–moz-box-shadow</code>; but work is underway to add this to all properties which accept length values.</p>
<p><strong>Update:</strong> You can read more about <code>calc()</code> at <a href="http://hacks.mozilla.org/2010/06/css3-calc/">hacks.mozilla.org</a>.</p>
<p>Also implemented is a new selector, <code>:-moz-any</code>. With this you can group other simple selectors, removing the need for repetitive code. Consider, for example, a typical web page which has many types of list, and nested lists:</p>
<pre>
&lt;ul&gt;
  &lt;li&gt;We are all list items now
    &lt;ul&gt;
      &lt;li&gt;We are all list items now&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;ol&gt;
  &lt;li&gt;We are all list items now
    &lt;ul&gt;
      &lt;li&gt;We are all list items now&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;
&lt;menu&gt;
  &lt;li&gt;We are all list items now
    &lt;ul&gt;
      &lt;li&gt;We are all list items now&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/menu&gt;
</pre>
<p>If we wanted to select all of the <code>li</code> children of nested <code>ul</code> elements we would currently have to do this:</p>
<pre>ul ul li, ol ul li, menu ul li { property: value; }</pre>
<p>But with <code>–moz-any</code> we can group the selectors like so:</p>
<pre>:-moz-any(ul,ol,menu) ul li { property: value; }</pre>
<p>In my <a href="http://www.broken-links.com/tests/calc-any/">demo</a> page I’ve provided a couple of examples; the first selects all list types which are direct child elements of the body:</p>
<pre>body > :-moz-any(ol, ul, menu) {
	float: left;
	width: 33%;
}</pre>
<p>And the next selects list items of the lists which are children of those elements:</p>
<pre>:-moz-any(ol, ul, menu) ul li {
	font-weight: bold;
	margin-left: 0;
}</pre>
<p>The <code>:any</code> selector isn’t in any of the CSS3 modules, but it’s pretty useful and definitely a candidate for inclusion. You can read more about it on <a href="http://dbaron.org/log/20100424-any">the blog of David Baron</a>.</p>
<p><strong>Update: </strong>Changed the examples for clarity.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.broken-links.com/2010/05/17/new-to-firefox-moz-calc-and-moz-any/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>An updated studio-style backdrop with CSS3</title>
		<link>http://www.broken-links.com/2010/04/26/an-updated-studio-style-backdrop-with-css3/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=an-updated-studio-style-backdrop-with-css3</link>
		<comments>http://www.broken-links.com/2010/04/26/an-updated-studio-style-backdrop-with-css3/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 18:43:20 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Asides]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css transformations]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[demo]]></category>

		<guid isPermaLink="false">http://www.broken-links.com/?p=784</guid>
		<description><![CDATA[I’ve updated my post, Create a studio-style backdrop with CSS3, as I realised a way to do the reflection without requiring an extra image — using the scale transformation function to flip the image vertically. The demo works in Firefox and WebKit.]]></description>
			<content:encoded><![CDATA[<p>I’ve updated my post, <a href="http://www.broken-links.com/2010/03/22/create-a-studio-style-backdrop-with-css3/">Create a studio-style backdrop with CSS3</a>, as I realised a way to do the reflection without requiring an extra image — using the <code>scale</code> transformation function to flip the image vertically.</p>
<p><a href="http://www.broken-links.com/tests/studio_effect/">The demo works in Firefox and WebKit</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.broken-links.com/2010/04/26/an-updated-studio-style-backdrop-with-css3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
