<?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>Mozilla Hacks - the Web developer blog &#187; CSS</title>
	<atom:link href="http://hacks.mozilla.org/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://hacks.mozilla.org</link>
	<description>hacks.mozilla.org</description>
	<lastBuildDate>Wed, 08 Feb 2012 22:52:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Dev Derby for January &#8211; show us your best orientation!</title>
		<link>http://hacks.mozilla.org/2012/01/dev-derby-for-january-show-us-your-best-orientation/</link>
		<comments>http://hacks.mozilla.org/2012/01/dev-derby-for-january-show-us-your-best-orientation/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 15:23:14 +0000</pubDate>
		<dc:creator>Robert Nyman</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Dev Derby]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=10797</guid>
		<description><![CDATA[As you might know, each month we have a Dev Derby as part of Mozilla Developer Network (MDN), and each of them are focused on a certain technology where people can compete with their submissions. This month, the Dev Derby is about Orientation, and we look forward to some really interesting ideas and demos from [...]]]></description>
			<content:encoded><![CDATA[<p>As you might know, each month we have a <a href="https://developer.mozilla.org/demos/devderby">Dev Derby</a> as part of <a href="https://developer.mozilla.org/">Mozilla Developer Network (MDN)</a>, and each of them are focused on a certain technology where people can compete with their submissions. </p>
<p><span id="more-10797"></span></p>
<p><img src="http://hacks.mozilla.org/wp-content/uploads/2012/01/logo-devderby-e1327073229811.png" alt="" class="dev-derby-logo">This month, the Dev Derby is about Orientation, and we look forward to some really interesting ideas and demos from you people! And if you&#8217;re not already the master of device orientation, you can read up on MDN in the article <a href="https://developer.mozilla.org/en/detecting_device_orientation">Detecting device orientation</a>.</p>
<p><img src="http://hacks.mozilla.org/wp-content/uploads/2012/01/hack-car.png" alt="" class="dev-derby-car"></p>
<h2>Prizes</h2>
<dl class="dev-derby-dl">
<dt>Android mobile device</dt>
<dd>Winner gets an Android mobile device from Motorola or Samsung.</dd>
<dt>Rickshaw laptop bag</dt>
<dd>Runner-up gets a hand-crafted laptop messenger bag from Rickshaw.</dd>
<dt>MDN t-shirt</dt>
<dd>3rd place gets a limited edition MDN t-shirt to show off their geek cred.</dd>
</dl>
<p>And as if that wasn&#8217;t enough, your demo will be showcased in <a href="https://developer.mozilla.org/demos/">Mozilla&#8217;s Demo Studio</a>, and we would like to feature you in an article here on Mozilla Hacks as well! </p>
<p>So, what are you waiting for? :-)</p>
<p><a href="https://developer.mozilla.org/en-US/demos/submit?tags=challenge%3A2012%3Ajanuary">Submit your demo now!</a></p>
<style>
    .dev-derby-logo {float: left; margin: 0 10px 10px 0; vertical-align: middle;}
    .dev-derby-car {display: block; margin: 0 auto;}
    .dev-derby-dl dt {font-weight: bold; font-style: normal;}
    .dev-derby-dl dd {padding-left: 0;}
</style>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2012/01/dev-derby-for-january-show-us-your-best-orientation/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Writing forward-compatible websites</title>
		<link>http://hacks.mozilla.org/2011/12/writing-forward-compatible-websites/</link>
		<comments>http://hacks.mozilla.org/2011/12/writing-forward-compatible-websites/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 17:34:51 +0000</pubDate>
		<dc:creator>Robert Nyman</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Featured Article]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Developers]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=10590</guid>
		<description><![CDATA[As web developers we want to ensure what we build is accessible by as many people as possible, with as many web browsers, operating systems and devices as we can support. It is also hard to know what the future holds, and for that we have put together Writing forward-compatible websites Topics covered We see [...]]]></description>
			<content:encoded><![CDATA[<p>As web developers we want to ensure what we build is accessible by as many people as possible, with as many web browsers, operating systems and devices as we can support. It is also hard to know what the future holds, and for that we have put together <a href="https://developer.mozilla.org/en/Web_development/Writing_forward-compatible_websites">Writing forward-compatible websites </a></p>
<p><span id="more-10590"></span></p>
<h2>Topics covered</h2>
<p>We see this as a living document, and so far we have information on topics like JavaScript, Feature and User Agent sniffing, Testing, Web browser-specific features and Code hygiene. </p>
<h2>Complete contents</h2>
<p>The complete content listing is:</p>
<ul class="mdn-content-listing">
<li>
        <a href="https://developer.mozilla.org/en/Web_development/Writing_forward-compatible_websites#JavaScript">JavaScript</a>
<ul>
<li> <a href="https://developer.mozilla.org/en/Web_development/Writing_forward-compatible_websites#Prefix_all_global_variable_access_in_onfoo_attributes_with_.E2.80.9Cwindow..E2.80.9D">Prefix all global variable access in onfoo attributes with “window.”</a></li>
<li> <a href="https://developer.mozilla.org/en/Web_development/Writing_forward-compatible_websites#Don't_concatenate_scripts_you_don't_control">Don&#8217;t concatenate scripts you don&#8217;t control</a></li>
<li> <a href="https://developer.mozilla.org/en/Web_development/Writing_forward-compatible_websites#Ask_the_authors_of_any_JavaScript_libraries_you_use_to_also_follow_these_guidelines">Ask the authors of any JavaScript libraries you use to also follow these guidelines</a></li>
</ul>
</li>
<li> <a href="https://developer.mozilla.org/en/Web_development/Writing_forward-compatible_websites#Sniffing">Sniffing</a>
<ul>
<li> <a href="https://developer.mozilla.org/en/Web_development/Writing_forward-compatible_websites#Sniff_for_specific_features">Sniff for specific features</a></li>
<li> <a href="https://developer.mozilla.org/en/Web_development/Writing_forward-compatible_websites#Don't_UA-sniff">Don&#8217;t UA-sniff</a>
<ul>
<li> <a href="https://developer.mozilla.org/en/Web_development/Writing_forward-compatible_websites#If_you_have_to_UA-sniff.2C_only_sniff_for_past_browser_versions">If you have to UA-sniff, only sniff for past browser versions</a></li>
</ul>
</li>
<li> <a href="https://developer.mozilla.org/en/Web_development/Writing_forward-compatible_websites#Don't_unnecessarily_create_separate_codepaths_for_different_browsers">Don&#8217;t unnecessarily create separate codepaths for different browsers</a></li>
</ul>
</li>
<li> <a href="https://developer.mozilla.org/en/Web_development/Writing_forward-compatible_websites#Testing">Testing</a>
<ul>
<li> <a href="https://developer.mozilla.org/en/Web_development/Writing_forward-compatible_websites#Test_with_all_major_engines">Test with all major engines</a></li>
</ul>
</li>
<li> <a href="https://developer.mozilla.org/en/Web_development/Writing_forward-compatible_websites#Browser-specific_features_and_prefixes">Browser-specific features and prefixes</a>
<ul>
<li> <a href="https://developer.mozilla.org/en/Web_development/Writing_forward-compatible_websites#Don't_target_hacks_at_current_or_future_versions_of_browsers">Don&#8217;t target hacks at current or future versions of browsers</a></li>
<li> <a href="https://developer.mozilla.org/en/Web_development/Writing_forward-compatible_websites#Avoid_depending_on_cutting-edge_nonstandard_features">Avoid depending on cutting-edge nonstandard features</a></li>
<li> <a href="https://developer.mozilla.org/en/Web_development/Writing_forward-compatible_websites#When_using_cutting-edge_features_(even_standard_ones)_that_are_not_universally_implemented.2C_make_sure_to_test_fallback_paths">When using cutting-edge features (even standard ones) that are not universally implemented, make sure to test fallback paths</a></li>
<li>
                <a href="https://developer.mozilla.org/en/Web_development/Writing_forward-compatible_websites#Don't_use_vendor-prefixed_features_except_to_target_old_buggy_versions">Don&#8217;t use vendor-prefixed features except to target old buggy versions</a></li>
<li> <a href="https://developer.mozilla.org/en/Web_development/Writing_forward-compatible_websites#Don't_use_unprefixed_versions_of_CSS_properties_or_APIs_until_at_least_one_browser_supports_them">Don&#8217;t use unprefixed versions of CSS properties or APIs until at least one browser supports them</a></li>
</ul>
</li>
<li> <a href="https://developer.mozilla.org/en/Web_development/Writing_forward-compatible_websites#Code_hygiene">Code hygiene</a>
<ul>
<li> <a href="https://developer.mozilla.org/en/Web_development/Writing_forward-compatible_websites#Avoid_missing_.3E">Avoid missing &gt;</a></li>
<li> <a href="https://developer.mozilla.org/en/Web_development/Writing_forward-compatible_websites#Don't_leave_experiments_that_didn't_work_in_your_code">Don&#8217;t leave experiments that didn&#8217;t work in your code</a></li>
</ul>
</li>
</ul>
<h2>Contribute!</h2>
<p>Please let us remind you that <a href="https://developer.mozilla.org/">MDN</a> is a community effort, and that you are free to edit the wiki and come up with useful and informative additions. </p>
<p>We look forward to your ideas!</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/12/writing-forward-compatible-websites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mozilla Hacks Weekly, December 15th 2011</title>
		<link>http://hacks.mozilla.org/2011/12/mozilla-hacks-weekly-december-15th-2011/</link>
		<comments>http://hacks.mozilla.org/2011/12/mozilla-hacks-weekly-december-15th-2011/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 11:25:38 +0000</pubDate>
		<dc:creator>Robert Nyman</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Mozilla Hacks Weekly]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=10550</guid>
		<description><![CDATA[Time again for the Mozilla Developer Engagement team to share what what we have been reading lately. Weekly links December 8th 2011 If there is anything you think we should read or know about, don&#8217;t hesitate to post a comment, contact us on Twitter or through any other mean. The picks this week are: Christian [...]]]></description>
			<content:encoded><![CDATA[<p>Time again for the Mozilla Developer Engagement team to share what what we have been reading lately.</p>
<p><span id="more-10550"></span></p>
<h2>Weekly links December 8th 2011</h2>
<p>If there is anything you think we should read or know about, don&#8217;t hesitate to post a comment, contact us on Twitter or through any other mean.<br />
The picks this week are:</p>
<h3>Christian Heilmann</h3>
<div class="team-member">
    <img src="http://hacks.mozilla.org/wp-content/uploads/2011/08/chris-heilmann.jpg" alt=""> After showing off a <a href="http://jsfiddle.net/codepo8/NvTuf/9/">folding cube done in CSS3 transitions and 3D transformations</a>, Cameron Adams upped the ante with his <a href="http://themaninblue.com/experiment/dodecahedron/">Dodecahedron</a>. Can you top that? (needs Webkit/Aurora, in case you wonder). </p>
<p>    If you want to read more tips or discuss the web with Christian, he&#8217;s available on Twitter as <a href="http://twitter.com/codepo8">@codepo8</a>.
</div>
<h3>Havi Hoffman</h3>
<div class="team-member">
    <img src="http://hacks.mozilla.org/wp-content/uploads/2011/08/havi-hoffman.jpg" alt=""> Here’s a <a href="http://blog.thejit.org/2011/12/09/webglcamp/">recap of last Friday’s WebGLCamp #4</a>, which gives a great feel for state-of-the-art WebGL and the vibrant WebGL community of technologists, entrepreneurs, implementers, and experimenters.</p>
<p>    Havi can be found on Twitter as <a href="http://twitter.com/freshelectrons">@freshelectrons</a>
</div>
<h3>Janet Swisher</h3>
<div class="team-member">
    <img src="http://hacks.mozilla.org/wp-content/uploads/2011/08/janet-swisher.jpeg" alt="A picture of Janet Swisher"> <a href="http://www.dmlcompetition.net/Competition/4/badges-stage-2.php">Stage 2 of the Badges for Lifelong Learning</a> competition, sponsored by Mozilla, HASTAC, and the MacArthur Foundation, is now open. Propose a design for a concrete badge system based on Mozilla’s Open Badges infrastructure. </p>
<p>    If you want to read more tips or discuss the web with Janet, she&#8217;s available on Twitter as <a href="http://twitter.com/jmswisher">@jmswisher</a>.
</div>
<h3>Jeff Griffiths</h3>
<div class="team-member">
    <img src="http://hacks.mozilla.org/wp-content/uploads/2011/11/jeff-griffiths.jpg" alt=""> Some sweet <a href="http://madhava.com/egotism/archive/005059.html">UI polish mock-ups of Firefox mobile</a> from Madhava Enros.</p>
<p>    If you want to read more tips or discuss the web with Jeff, he&#8217;s available on Twitter as <a href="http://twitter.com/canuckistani">@canuckistani</a>.
</div>
<h3>Luke Crouch</h3>
<div class="team-member">
    <img src="http://hacks.mozilla.org/wp-content/uploads/2011/12/luke-crouch.png" alt=""> “Native pressures push the Web forward; the Web pressures native Apps” <a href="http://www.hanselman.com/blog/AppsAreTooMuchLike1990sCDROMsAndNotEnoughLikeTheWeb.aspx">Scott Hanselman: Apps are too much like 1990’s CD-ROMs and not enough like the web</a>. </p>
<p>    If you want to read more tips or discuss the web with Luke, he&#8217;s available on Twitter as <a href="http://twitter.com/groovecoder">@groovecoder</a>.
</div>
<h3>Rob Hawkes</h3>
<div class="team-member">
    <img src="http://hacks.mozilla.org/wp-content/uploads/2011/07/rob-hawkes.jpg" alt=""> <a href="http://jashkenas.github.com/docco/">Docco</a> is a tool for creating beautifully designed “literate programming-style” documentation. The formatting of the documentation can be changed through the use of Markdown within your code comments.</p>
<p>    If you want to read more tips or discuss the web with Rob, he&#8217;s available on Twitter as <a href="http://twitter.com/robhawkes">@robhawkes</a>.
</div>
<h3>Robert Nyman</h3>
<div class="team-member">
    <img src="http://hacks.mozilla.org/wp-content/uploads/2011/07/robert-nyman.jpg" alt=""> <a href="http://export.synack.me/">The Exporter</a> &#8211; Free your data on Twitter, Gowalla, Facebook, Google+, LinkedIn and Foursquare.</p>
<p>    If you want to read more tips or discuss the web with Robert, he&#8217;s available on Twitter as <a href="http://twitter.com/robertnyman">@robertnyman</a>.
</div>
<style>
    .team-member { overflow: hidden; margin-bottom: 15px; }
    .team-member img { float: left; margin: 0 20px 10px 0; }
    .team-member ul { margin-left: 0; }
    .team-member li { margin-left: 180px; }
</style>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/12/mozilla-hacks-weekly-december-15th-2011/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Screencast: 3D CSS rollovers and 3D CSS tester</title>
		<link>http://hacks.mozilla.org/2011/12/screencast-3d-css-rollovers-and-3d-css-tester/</link>
		<comments>http://hacks.mozilla.org/2011/12/screencast-3d-css-rollovers-and-3d-css-tester/#comments</comments>
		<pubDate>Thu, 08 Dec 2011 01:06:55 +0000</pubDate>
		<dc:creator>Chris Heilmann</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[transforms]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=10453</guid>
		<description><![CDATA[CSS 3D transforms as supported in the latest Aurora allow us to do some nice effects that in the past were only possible in Flash or with a lot of trickery using skewing and filters. I was asked to show a small demo the other day and thought it would be fun to spice up [...]]]></description>
			<content:encoded><![CDATA[<p>CSS 3D transforms as supported in the latest Aurora allow us to do some nice effects that in the past were only possible in Flash or with a lot of trickery using skewing and filters. I was asked to show a small demo the other day and thought it would be fun to spice up the classic image rollover:</p>
<p><iframe src="http://www.screenr.com/embed/sObs" width="500" height="305" frameborder="0"></iframe></p>
<p>You can <a href="http://thewebrocks.com/demos/cuberollovers/">see this in action</a> using Chrome, Safari or Firefox Aurora/Nightly. Older browsers should just show a normal roll-over (and yes, the first example looks weird due to the logo transparency but it makes the effect much cooler in supporting browsers). </p>
<p>As people asked how this is done I thought it easiest to create <a href="http://thewebrocks.com/demos/3D-css-tester/">a testing tool where you can play with 3D CSS yourself</a>. Here&#8217;s a screencast where I explain how to use it and how the roll-over effects were done.</p>
<p><iframe width="500" height="254" src="http://www.youtube.com/embed/yP5eFRZ_X54?rel=0&amp;hd=1" frameborder="0" allowfullscreen></iframe></p>
<p>I found a few interesting bugs while creating this and will file them now. This is the benefit of playing with new tech. Enjoy!</p>
<p>More reading on this: </p>
<ul>
<li><a href="http://24ways.org/2010/intro-to-css-3d-transforms">An introduction to CSS 3D transforms</a></li>
<li><a href="http://www.webkit.org/blog/386/3d-transforms/">3D transforms at surfin safari</a></li>
<li><a href="http://dev.w3.org/csswg/css3-3d-transforms/">The W3C draft spec</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/12/screencast-3d-css-rollovers-and-3d-css-tester/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Congrats to our October Dev Derby winners!</title>
		<link>http://hacks.mozilla.org/2011/11/congrats-to-our-october-dev-derby-winners/</link>
		<comments>http://hacks.mozilla.org/2011/11/congrats-to-our-october-dev-derby-winners/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 21:51:27 +0000</pubDate>
		<dc:creator>Jay Patel</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Demo Studio]]></category>
		<category><![CDATA[Dev Derby]]></category>
		<category><![CDATA[Featured Article]]></category>
		<category><![CDATA[Media Queries]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=10363</guid>
		<description><![CDATA[Responsive design is more important than ever as people experience the Web on a variety of devices. Web developers can now take advantage of CSS Media Queries to build sites and applications that can be viewed on different screen sizes. So we decided to focus on that for the October Dev Derby. For this challenge, [...]]]></description>
			<content:encoded><![CDATA[<p>Responsive design is more important than ever as people experience the Web on a variety of devices.  Web developers can now take advantage of <a href="https://developer.mozilla.org/en/CSS/media_queries" title="CSS Media Queries docs on MDN">CSS Media Queries</a> to build sites and applications that can be viewed on different screen sizes.  So we decided to focus on that for the <a href="https://developer.mozilla.org/en-US/demos/devderby/2011/october/" title="October Dev Derby - CSS Media Queries">October Dev Derby</a>.</p>
<p><img alt="" src="http://hacks.mozilla.org/wp-content/uploads/2011/07/logo-devderby.png" title="Mozilla Demo Studio presents Dev Derby on MDN" class="aligncenter" width="335" height="96" /></p>
<p>For this challenge, developers submitted <a href="https://developer.mozilla.org/en-US/demos/devderby/2011/october/" title="October Dev Derby - CSS Media Queries">15 demos</a> to show what  you can do with CSS Media Queries.  Check them out so see how they present unique styles and layouts in response to changes in viewing area.</p>
<p>It was a fairly close race, so join us in congratulating the winners circle:<br />
<a href="https://developer.mozilla.org/en-US/demos/devderby/2011/october/" title="October Dev Derby - CSS Media Queries"><img src="http://hacks.mozilla.org/wp-content/uploads/2011/11/octderbywinners-500x204.png" alt="October Dev Derby winners - CSS Media Queries" title="October Dev Derby winners - CSS Media Queries" width="500" height="204" class="aligncenter size-large wp-image-10366" /></a></p>
<p><strong>1st Place:</strong> <a href="https://developer.mozilla.org/en-US/demos/detail/css3-cherry-blossom-media-queries">CSS3 Cherry Blossom &#8211; Media queries</a> by <a href="https://developer.mozilla.org/en-US/profiles/elufo/">elufo</a><br />
<strong>2nd Place:</strong> <a href="https://developer.mozilla.org/en-US/demos/detail/santas-media-queries">Santa&#8217;s Media Queries</a> by <a href="https://developer.mozilla.org/en-US/profiles/tuxie/">tuxie</a><br />
<strong>3rd Place:</strong> <a href="https://developer.mozilla.org/en-US/demos/detail/too-many-fish-is-the-sea">Too many fish is the sea</a> by <a href="https://developer.mozilla.org/en-US/profiles/michal.b/">michal.b</a></p>
<p><strong>Runners-up:</strong><br />
<a href="https://developer.mozilla.org/en-US/demos/detail/responsive-3d-models-for-any-device">Responsive 3D-Models For Any Device</a><br />
<a href="https://developer.mozilla.org/en-US/demos/detail/spriting-with-css-media-queries">Spriting with CSS Media Queries</a></p>
<p>Thanks to everyone that participated in the October Dev Derby!  Only a couple of days left to participate in the <a href="https://developer.mozilla.org/en-US/demos/devderby#upcoming" title="November Dev Derby - Canvas">November Dev Derby</a>, so get your Canvas demos in now.  Otherwise, start experimenting with IndexedDB for December. </p>
<p><strong><em>NOTE: We recently updated our <a href="https://developer.mozilla.org/en-US/demos/devderby/rules" title="Dev Derby rules">Dev Derby rules</a> to allow developers to participate in multiple contests until they win 1st place.</em></strong>  That means if you&#8217;ve submitted awesome demos and come up short in the past, you still have a chance to win that top spot in future Dev Derbies&#8230; so keep those demos coming!</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/11/congrats-to-our-october-dev-derby-winners/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Firefox &#8211; tons of tools for web developers!</title>
		<link>http://hacks.mozilla.org/2011/11/firefox-tons-of-tools-for-web-developers/</link>
		<comments>http://hacks.mozilla.org/2011/11/firefox-tons-of-tools-for-web-developers/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 08:25:17 +0000</pubDate>
		<dc:creator>Robert Nyman</dc:creator>
				<category><![CDATA[Add-ons]]></category>
		<category><![CDATA[Aurora]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Developer Tools]]></category>
		<category><![CDATA[Featured Article]]></category>
		<category><![CDATA[Firebug]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Developers]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=10242</guid>
		<description><![CDATA[One of the goals of Firefox have always been to make the lives of web developers as easy and productive as possible, by providing tools and a very extensible web browser to enable people to create amazing things. The idea here is to list a lot of the tools and options available to you as [...]]]></description>
			<content:encoded><![CDATA[<p>One of the goals of Firefox have always been to make the lives of web developers as easy and productive as possible, by providing tools and a very extensible web browser to enable people to create amazing things. The idea here is to list a lot of the tools and options available to you as web developers using Firefox.</p>
<p><span id="more-10242"></span></p>
<h2>Native developer tools in Firefox</h2>
<p>We are working on building a great set of developer tools for you included in Firefox. They are described much more in detail in <a href="http://hacks.mozilla.org/2011/11/developer-tools-in-firefox-aurora-10/">Developer Tools in Firefox Aurora 10</a> and there are some very interesting implications for what we can accomplish with them!</p>
<p>We are evaluating and experimenting with a number of user interfaces and code approaches to try and find the most optimal ways to work with code in a page. If you install <a href="http://www.mozilla.org/en-US/firefox/channel/">Firefox Aurora</a> you can try them out right now! Let us know what you think.</p>
<p><img src="http://blog.mozilla.com/devtools/files/2011/11/Breadcrumbs.png" alt="A picture of the native Developer Toosl in Firefox Aurora"></p>
<p>Also stay tuned to this blog, since we will post updates on progress and features for the native Developer Tools.</p>
<h2>Firebug</h2>
<p>By far, the most well-known web developer tool in a web browser is the <a href="http://getfirebug.com/">Firebug extension</a>, and without a doubt, for a long time it set the bar for how web developing and debugging should be. Firebug is still a very important tool with lots of powerful features, including a vast number of extensions (see below).</p>
<p>Just something you need to be aware of, though, is with everything that Firebug offers it can be quite heavy when it comes to consuming memory, so use it accordingly.</p>
<h2>Firefox extensions for web developers</h2>
<p>Over the years, a lot of extensions have been developed to help web developers utilize Firefox to the maximum. Some of the most used and well-known are these ones, but please let us know if we have missed any that helps you!</p>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/accessibility-evaluation-toolb/">Accessibility Evaluation Toolbar</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/5809-32.png?modified=1314753183">Support web developers in testing web resources for accessibility features.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/all-in-one-sidebar/">All in One Sidebar</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/1027-64.png?modified=1308857467">AiOS lets you open various windows as sidebar panels, and quickly switch between them. So it put an end to the window chaos! In addition to bookmarks and history it opens dialogues such as downloads, add-ons and more in the sidebar.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/cache-status/">Cache Status</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/media//img/addon-icons/default-64.png">Easy cache status &amp; management from status.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/cachetoggle/">CacheToggle</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/media//img/addon-icons/default-64.png">Disable (and optionally clear) the browser cache with the flick of a switch.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/colorzilla/">Colorzilla</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/271-64.png?modified=1317665348">Advanced Eyedropper, ColorPicker, Gradient Generator and other colorful goodies.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/console²/">Console²</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/1815-64.png?modified=1311219845">Console² (pronounced Console Squared or Console Two) replaces the JavaScript Console with what could be the next generation Error Console. From v0.5 includes the Console Filter extension previously available separately from the Console² website.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/css-reloader/">CSS Reloader</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/media//img/addon-icons/default-64.png">CSS Reloader is an extension that allows you to reload all the CSS of any site without you have to reload the page itself.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/dom-inspector-6622/">DOM Inspector</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/media//img/addon-icons/default-64.png">DOM Inspector is a tool that can be used to inspect and edit the live DOM of any web document or XUL application. The DOM can be navigated using a two-paned window displaying a variety of different views on the document and all nodes within.
</div>
<div class="add-on">
<h3>
        <a href="http://firefogg.org/">Firefogg</a><br />
    </h3>
<p>    <img src="http://firefogg.org/png/firefogg.png">Video and audio encoding for Firefox. With Firefogg you can encode most media files to Ogg and WebM. Firefogg also provides an API to integrate encoding into the upload process.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/fireftp/">FireFTP</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/684-64.png?modified=1315905886">FireFTP is a free, secure, cross-platform FTP/SFTP client for Mozilla Firefox which provides easy and intuitive access to FTP/SFTP servers.
</div>
<div class="add-on">
<h3>
        <a href="http://fireunit.org/">FireUnit</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/media//img/addon-icons/default-64.png">JavaScript Unit Testing Extension
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/foxguide/">FoxGuide</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/235272-64.png?modified=1295335696">Display horizontal and vertical floating guides, exactly the way you use it in photoshop. Helps improving layout, placing elements in proper grids, laying out elements symmetrically and structure a design.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/foxyproxy-standard/">FoxyProxy Standard</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/2464-64.png?modified=1320149104">FoxyProxy is an advanced proxy management tool that completely replaces Firefox&#8217;s limited proxying capabilities. It offers more features than SwitchProxy, ProxyButton, QuickProxy, xyzproxy, ProxyTex, TorButton, etc.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/geolocater/">Geolocater</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/media//img/addon-icons/default-64.png">Geolocate you where you want.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/">GreaseMonkey</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/748-64.png?modified=1321050245">Customize the way a web page displays or behaves, by using small bits of JavaScript.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/html-validator/">HTML Validator</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/249-64.png?modified=1322054526">HTML Validator is a Mozilla extension that adds HTML validation inside Firefox and Mozilla. The number of errors of a HTML page is seen on the form of an icon.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/httpfox/">HttpFox</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/6647-64.png?modified=1314147649">An HTTP analyzer addon for Firefox.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/imacros-for-firefox/">iMacros for Firefox</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/3863-64.png?modified=1318544883">Automate Firefox. Record and replay repetitious work. If you love the Firefox web browser, but are tired of repetitive tasks like visiting the same sites every days, filling out forms, and remembering passwords, then iMacros for Firefox is the solution you’ve been dreaming of!
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/jenkins-build-monitor/">Jenkins Build Monitor</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/7522-64.png?modified=1314882701">Monitor Jenkins (<a href="http://jenkins-ci.org">http://jenkins-ci.org</a>) builds and display the status on Firefox status bar.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/jquery/">jQuery extension</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/14637-64.png?modified=1305548437">jQuery and jQuery UI embedded in browser.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/jsonovich/">JSONovich</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/10122-64.png?modified=1320745806">Pretty-prints JSON content in the browser for easy, unobtrusive viewing.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/jsonview/">JSONView</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/10869-64.png?modified=1319983383">View JSON documents in the browser.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/jsview/">JSView</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/2076-64.png?modified=1317668162">If the website you are viewing contains any external js/css files, an icon will appear that says &#8220;SS&#8221;, &#8220;JS&#8221;, or both. Each individual file can then be viewed by clicking on the filename. The file will be opened in a new window.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/link-widgets/">Link Widgets</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/media//img/addon-icons/default-64.png">Eases navigation within sequences of pages (e.g. Web comics, forums, or technical specifications such as the HTML 4 Recommendation) by providing toolbar buttons for the first, previous, next, and last page.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/live-http-headers/">Live HTTP Headers</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/3829-64.png?modified=1305324425">View HTTP headers of a page and while browsing.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/livereload/">LiveReload</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/276301-64.png?modified=1319675424">LiveReload refreshes a web page when files change.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/measureit/">MeasureIt</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/539-64.png?modified=1314145326">Draw a ruler across any webpage to check the width, height, or alignment of page elements in pixels.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/modify-headers/">Modify Headers</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/media//img/addon-icons/default-64.png">Add, modify and filter the HTTP request headers sent to web servers. This addon is particularly useful for Mobile web development, HTTP testing and privacy.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/noscript/">NoScript</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/722-64.png?modified=1321574645">The best security you can get in a web browser! Allow active content to run only from sites you trust, and protect yourself against XSS and Clickjacking attacks.
</div>
<div class="add-on">
<h3>
        <a href="http://code.google.com/speed/page-speed/download.html">PageSpeed</a><br />
    </h3>
<p>	<img src="https://static-cdn.addons.mozilla.net/media//img/addon-icons/default-64.png">Page Speed is an open-source project started at Google to help developers optimize their web pages by applying web performance best practices.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/phoenix/">Phoenix</a><br />
    </h3>
<p>	<img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/11708-64.png?modified=1309374246"> An editor with real time syntax highlighting which allows edit, run and test CSS, HTML and JavaScript code. Phoenix will tell you how many CSS and JS files are loaded into a page, how big these are, it will let you edit, pack and de-obfuscate them.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/pixelzoomer/">PixelZoomer</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/116725-64.png?modified=1309267310">PixelZoomer takes a screenshot of the current website and provides various tools for pixel analysis. You can zoom into websites (up to 3200%), measure distances and pick colors with an eye dropper.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/pixlr-grabber/">Pixlr Grabber</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/9924-64.png?modified=1295997130">Grabbing screens and pulling images from the web just got a bit easier. With the Pixlr Grabber add-on, you can copy, save, share or even edit your final grabs &#8211; including any image or background &#8211; with just a right-click.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/poster/">Poster</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/media//img/addon-icons/default-64.png">A developer tool for interacting with web services and other web resources that lets you make HTTP requests, set the entity body, and content type. This allows you to interact with web services and inspect the results.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/quickjava/">QuickJava</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/1237-64.png?modified=1306175238">Allows quick enable and disable of Java, Javascript, Flash, Silverlight, Images, Stylesheets and Proxy from the Statusbar and/or Toolbar without having to open any dialogs!
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/rainbow-color-tools/">Rainbow Color Tools</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/14328-64.png?modified=1315255384">Color tools for web development. Color picker and eyedropper + saving colors and trying out colors with drag and drop.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/rext/">Regular Expressions Tester</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/2077-64.png?modified=1320753209">Testing tool for regular expressions with color highlighting (including submatches) and helpers for creating expressions.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/remove-cookies-for-site/">Remove Cookie(s) for Site</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/1595-64.png?modified=1312907482">A very simple extension to remove all the cookies of currently opened site. It adds an option to the Right Click menu of the page, and a Clear Cookies Button to perform this operation. It displays the status of operation in the status bar.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/screenshot-pimp-screengrab-scr/">Screenshot Pimp</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/247573-64.png?modified=1319466784">Capture, grab, save, download, or copy anything you see in your web browser with only one click! Screenshot pimp is by far the most customizable, and user friendly screenshot toolbar available for both Windows and Mac!
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/sqlite-manager/">SQLite Manager</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/5817-64.png?modified=1313440219">Manage any SQLite database on your computer.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/selenium-ide-buttons/">Selenium IDE Buttons</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/46131-64.png?modified=1302711233">Just one simple toolbar button to open Selenium IDE. You need to have installed Selenium IDE: <a href="http://seleniumhq.org/projects/ide/">http://seleniumhq.org/projects/ide/</a>
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/seoquake-seo-extension/">SeoQuake SEO extension</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/3036-64.png?modified=1321843566">Seoquake is a Firefox SEO extension aimed primarily at helping web masters who deal with search engine optimization (SEO), social media optimization (SMO) and internet promotion. Seoquake allows to investigate many important SEO parameters.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/showip/">ShowIP</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/590-64.png?modified=1306952435">Show the IP address(es) of the current page in the status bar. It also allows querying custom information services by IP (right click) and hostname (left click), like whois, netcraft, etc. Additionally you can copy the IP address to the clipboard.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/stylish/">Stylish</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/2108-64.png?modified=1320627544">Restyle the web with Stylish, a user styles manager. Stylish lets you easily install themes and skins for Google, Facebook, YouTube, Orkut, and many, many other sites. You can even customize Firefox and other programs themselves.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/tamper-data/">Tamper Data</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/media//img/addon-icons/default-64.png">Use tamperdata to view and modify HTTP/HTTPS headers and post parameters.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/taw3-with-a-click/">TAW3</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/1158-64.png?modified=1275608204">You can have an idea, with a single click, of how accesible web sites are.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/tilt/">Tilt 3D</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/336188-64.png?modified=1320910624">A WebGL-based 3D visualization of a webpage.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/total-validator/">Total Validator</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/2318-64.png?modified=1321560970">Perform many different validations in one go. This multiple validator works with external, internal, or local web pages using a local copy of the desktop tool obtained from <a href="http://www.totalvalidator.com/downloads/extensiontool.html">http://www.totalvalidator.com/downloads/extensiontool.html</a>.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/tryagain/">TryAgain</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/2462-64.png?modified=1296721813">TryAgain keeps trying to load a webpage when the server cannot be reached.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/user-agent-switcher/">User Agent Switcher</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/59-64.png?modified=1294322111">The User Agent Switcher extension adds a menu and a toolbar button to switch the user agent of a browser.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/wappalyzer/">Wappalyzer</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/10229-64.png?modified=1320449464">Wappalyzer is a browser add-on that uncovers the technologies used on websites.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/web-developer/">Web Developer</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/60-64.png?modified=1294338485">The Web Developer extension adds various web developer tools to a browser.
</div>
<h2>Firebug extensions</h2>
<p>There exists a lot of extensions for Firebug for a number of different use cases, and a number of them are listed here: </p>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/acebug/">Acebug</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/279230-64.png?modified=1319099556">Syntax highlighting for the Firebug command line using Ace. Fuzzy auto completion.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/code-coverage-v2-for-firebug/">Code Coverage v2 for Firebug 0.1</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/media//img/addon-icons/default-64.png">This Firebug extension is used to report the Javascript code coverage.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/css-usage/">CSS Usage</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/10704-64.png?modified=1316552583">Firebug extension to view which CSS rules are actually used.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/firecookie/">Firecookie</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/6683-64.png?modified=1321576925">Firecookie is an extension for Firebug that makes possible to view and manage cookies in your browser.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/firefinder-for-firebug/">Firefinder</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/11905-64.png?modified=1315193414">Finds HTML elements matching chosen CSS selector(s) or XPath expression.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/firephp/">FirePHP</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/6149-64.png?modified=1314741183">FirePHP enables you to log to your Firebug Console using a simple PHP method call.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/firequery/">FireQuery</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/12632-64.png?modified=1309313168">Firebug plugin for jQuery development.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/friendly-bug/">friendly bug</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/264087-64.png?modified=1313439064">Makes firebug friendlier and easier to use
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/inline-code-finder-for-firebug/">Inline Code Finder for Firebug</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/9641-64.png?modified=1315192854">Inline Code Finder is an add-on to Firebug, to be able to find HTML elements with any of these issues: Inline JavaScript events, Inline style, javascript: links.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/firerainbow/">FireRainbow</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/9603-64.png?modified=1309314365">Javascript syntax highlighting for Firebug.
</div>
<div class="add-on">
<h3>
        <a href="http://www.softwareishard.com/blog/netexport/">NetExport</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/media//img/addon-icons/default-64.png">NetExport is a Firebug extension that allows exporting all collected and computed data from the Net panel. The structure of the created file uses HTTP Archive (HAR) format (based on JSON).
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/pixel-perfect/">Pixel Perfect</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/7943-64.png?modified=1320924609">Pixel Perfect is a Firefox/Firebug extension that allows web developers and designers to easily overlay a web composition over top of the developed HTML.
</div>
<div class="add-on">
<h3>
        <a href="https://addons.mozilla.org/en-US/firefox/addon/yslow/">YSlow</a><br />
    </h3>
<p>    <img src="https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/5369-64.png?modified=1319008626">YSlow analyzes web pages and why they&#8217;re slow based on Yahoo!&#8217;s rules for high performance web sites.
</div>
<p>There are even more extensions available for Firebug, available in the <a href="http://getfirebug.com/wiki/index.php/Firebug_Extensions">Firebug Extensions wiki</a>.</p>
<style>
	.add-on {overflow: hidden;}
	.add-on h3 {margin-bottom: 10px;}
	.add-on img {float: left; max-width: 28px; vertical-align: top; margin: 0 10px 35px 0;}
</style>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/11/firefox-tons-of-tools-for-web-developers/feed/</wfw:commentRss>
		<slash:comments>76</slash:comments>
		</item>
		<item>
		<title>HTML5 context menus in Firefox (Screencast and Code)</title>
		<link>http://hacks.mozilla.org/2011/11/html5-context-menus-in-firefox-screencast-and-code/</link>
		<comments>http://hacks.mozilla.org/2011/11/html5-context-menus-in-firefox-screencast-and-code/#comments</comments>
		<pubDate>Thu, 24 Nov 2011 09:28:04 +0000</pubDate>
		<dc:creator>Chris Heilmann</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[Firefox 8]]></category>
		<category><![CDATA[Firefox 9]]></category>
		<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=10264</guid>
		<description><![CDATA[You may not know it, but the HTML5 specifications go beyond what we put in the pages and also define how parts of the browser should become available to developers with HTML, CSS and JavaScript. One of these parts of the specs are context menus, or &#8220;right click menus&#8221;. Using HTML5 and a menu element [...]]]></description>
			<content:encoded><![CDATA[<p>You may not know it, but the HTML5 specifications go beyond what we put in the pages and also define how parts of the browser should become available to developers with HTML, CSS and JavaScript. One of these parts of the specs are <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#context-menus">context menus</a>, or &#8220;right click menus&#8221;. Using HTML5 and a menu element you can add new options to these without having to write a browser add-on. In Firefox 8 (the current one) we have support for those. See the following screencast for a <a href="http://thewebrocks.com/demos/context-menu">context menu demo</a>.</p>
<p><video controls width="100%" preload="none" poster="http://cf.cdn.vid.ly/8e1y1v/poster.jpg"><source src="http://cf.cdn.vid.ly/8e1y1v/mp4.mp4" type="video/mp4"><source src="http://cf.cdn.vid.ly/8e1y1v/webm.webm" type="video/webm"><source src="http://cf.cdn.vid.ly/8e1y1v/ogv.ogv" type="video/ogg"><a target='_blank' href='http://vid.ly/8e1y1v'><img src='http://cf.cdn.vid.ly/8e1y1v/poster.jpg' width="500"></a></video></p>
<p>The image example is pretty simple and was actually written by Paul Rouget as a demo <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=617528">in the original Firefox bug request</a>. The main core is the HTML of it:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;section</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;noninteractive&quot;</span> <span style="color: #000066;">contextmenu</span>=<span style="color: #ff0000;">&quot;imagemenu&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;html5.png&quot;</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">&quot;HTML5&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;menudemo&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;menu</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;context&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;imagemenu&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;menuitem</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;rotate&quot;</span> <span style="color: #000066;">onclick</span>=<span style="color: #ff0000;">&quot;rotate()&quot;</span></span>
<span style="color: #009900;">                <span style="color: #000066;">icon</span>=<span style="color: #ff0000;">&quot;arrow_rotate_clockwise.png&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/menuitem<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;menuitem</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;resize&quot;</span> <span style="color: #000066;">onclick</span>=<span style="color: #ff0000;">&quot;resize()&quot;</span></span>
<span style="color: #009900;">                <span style="color: #000066;">icon</span>=<span style="color: #ff0000;">&quot;image-resize.png&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/menuitem<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;menu</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;share&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;menuitem</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;twitter&quot;</span> <span style="color: #000066;">onclick</span>=<span style="color: #ff0000;">&quot;alert('not yet')&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/menuitem<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;menuitem</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;facebook&quot;</span> <span style="color: #000066;">onclick</span>=<span style="color: #ff0000;">&quot;alert('not yet')&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/menuitem<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/menu<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/menu<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/section<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>As you can see you link the <code>menu</code> element to an element via its ID. The <code>contextmenu</code> attribute then points to this one. Each menu can have several <code>menuitems</code>. Each of those gets a textual label and a possible icon. You can also nest <code>menu</code> elements to create multiple layer menus. Here, we add inline <clode>onclick</clode> handlers to point to different JavaScript functions to call when the menu item gets activated. The resulting context menu looks like this:</p>
<p><img src="http://hacks.mozilla.org/wp-content/uploads/2011/11/contextmenu.png" alt="image with a context menu" title="a context menu" width="484" height="307" /></p>
<p>The functionality is simple, all the <code>rotate()</code> and <code>resize()</code> functions do is add class names to the image using <code>querySelector</code> and <code>classList</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> rotate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  document.<span style="color: #660066;">querySelector</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#menudemo'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">classList</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'rotate'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> resize<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>   
  document.<span style="color: #660066;">querySelector</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#menudemo'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">classList</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'resize'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The real effect is in CSS transforms and transitions. As the image has an ID of <code>menudemo</code> here is what is needed in CSS to rotate and resize:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#menudemo</span> <span style="color: #00AA00;">&#123;</span> 
  -moz-transition<span style="color: #00AA00;">:</span> 0.2s<span style="color: #00AA00;">;</span> 
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#menudemo</span><span style="color: #6666ff;">.rotate</span> <span style="color: #00AA00;">&#123;</span> 
  -moz-transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>90deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> 
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#menudemo</span><span style="color: #6666ff;">.resize</span> <span style="color: #00AA00;">&#123;</span> 
  -moz-transform<span style="color: #00AA00;">:</span> scale<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0.7</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> 
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#menudemo</span><span style="color: #6666ff;">.resize</span><span style="color: #6666ff;">.rotate</span> <span style="color: #00AA00;">&#123;</span> 
  -moz-transform<span style="color: #00AA00;">:</span> scale<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0.7</span><span style="color: #00AA00;">&#41;</span> rotate<span style="color: #00AA00;">&#40;</span>90deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> 
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Notice that in a real product we should of course add the other browser prefixes and go prefix-less but as the functionality now only works in Firefox, this is enough for this demo.</p>
<h2>Detecting support and visual hinting</h2>
<p>Now, as this is extending the normal user offerings in the browser we need to make it obvious that there is a right-click menu available. In CSS3, there is a <code>context-menu</code> cursor available to us. When context menus are available, this should be shown:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.contextmenu</span> <span style="color: #cc00cc;">#menudemo</span><span style="color: #00AA00;">,</span> <span style="color: #6666ff;">.contextmenu</span> <span style="color: #6666ff;">.demo</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span> context-menu<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>We test the browser for support by checking for contextmenu on the body element and for <code>HTMLMenuItemElement</code> in the window (this has been added as a pull request to <a href="https://github.com/Modernizr/Modernizr">Modernizr</a>, too).</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'contextMenu'</span> <span style="color: #000066; font-weight: bold;">in</span> document.<span style="color: #660066;">body</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #3366CC;">'HTMLMenuItemElement'</span> <span style="color: #000066; font-weight: bold;">in</span> window<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  document.<span style="color: #660066;">documentElement</span>.<span style="color: #660066;">classList</span>.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'contextmenu'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Wouldn&#8217;t <code>HTMLMenuItemElement</code> be enough? Yes, but a real context menu should only offer functionality when it is sensible, and that is where <code>contextMenu</code> comes in.</p>
<h2>Turning menuitems on and off depending on functionality</h2>
<p>As a slightly more complex example, let&#8217;s add a &#8220;count words&#8221; functionality to the document. For this, we generate a counter element that will become a tooltip when the words were counted:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> counter <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'span'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
counter.<span style="color: #660066;">id</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'counter'</span><span style="color: #339933;">;</span>
counter.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'hide'</span><span style="color: #339933;">;</span>
document.<span style="color: #660066;">body</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>counter<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
counter.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>ev<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'hide'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This one is hidden by default and becomes visible when the <code>hide</code> class is removed. To make it smooth, we use a transition:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#counter</span><span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span><span style="color: #cc66cc;">0.7</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">.5em</span> <span style="color: #933;">1em</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
  border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
  -moz-transition<span style="color: #00AA00;">:</span> opacity 0.4s<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#counter</span>.<span style="color: #993333;">hide</span><span style="color: #00AA00;">&#123;</span>
  opacity<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>We start with two sections with context menus:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;section</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;noninteractive&quot;</span> <span style="color: #000066;">contextmenu</span>=<span style="color: #ff0000;">&quot;countmenu&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;menu</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;context&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;countmenu&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;menuitem</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;wordcount&quot;</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;count words&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/menuitem<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/menu<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/section<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;section</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;interactive&quot;</span> <span style="color: #000066;">contextmenu</span>=<span style="color: #ff0000;">&quot;countmenuinteractive&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;menu</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;context&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;countmenuinteractive&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;menuitem</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;wordcount&quot;</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;count words&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/menuitem<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/menu<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/section<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>We then loop through all the <code>menuitems</code> with the class <code>wordcount</code> and apply the functionality.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> wordcountmenus <span style="color: #339933;">=</span> document.<span style="color: #660066;">querySelectorAll</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.wordcount'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    i <span style="color: #339933;">=</span> wordcountmenus.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">--</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  wordcountmenus<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>ev<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">// add functionality </span>
  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>We need to find out what has been selected in the page. We do this by using <code>getSelection()</code> and splitting its string version at whitespace. We then show the counter by removing the <code>hide</code> class name.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> wordcountmenus <span style="color: #339933;">=</span> document.<span style="color: #660066;">querySelectorAll</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.wordcount'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    i <span style="color: #339933;">=</span> wordcountmenus.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">--</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  wordcountmenus<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>ev<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> text <span style="color: #339933;">=</span> document.<span style="color: #660066;">getSelection</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        count <span style="color: #339933;">=</span> text.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/\s/</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
    counter.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> count <span style="color: #339933;">+</span> <span style="color: #3366CC;">' words'</span><span style="color: #339933;">;</span>
    counter.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>You can see this in action in the second <a href="http://thewebrocks.com/demos/context-menu">context menu demo</a>. Now, the issue with this (as explained in the screencast) is that it always counts the words, regardless of the user having selected some text. What we want is the menu only to be active when there is text selected.</p>
<p><img src="http://hacks.mozilla.org/wp-content/uploads/2011/11/activeinactive.png" alt="context menu item available or not available depending on selection" title="interactive menu item" style="width:100%" /> </p>
<p>So in order to make our menu only become available when it makes sense we check if there is a selection in the document. Every context menu fires an event called <code>contextmenu</code> when it opens. So all we need to do is to subscribe to this event. </p>
<p>When something is selected in the document <code>document.getSelection().isCollapsed</code> is true. Otherwise it is false, so all we need to do is to enable or disable the menu item accordingly:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">document.<span style="color: #660066;">querySelector</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#interactive'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span>
  <span style="color: #3366CC;">'contextmenu'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>ev<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">querySelector</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.wordcount'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">disabled</span> <span style="color: #339933;">=</span>
    document.<span style="color: #660066;">getSelection</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">isCollapsed</span><span style="color: #339933;">;</span>  
  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
<span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The last thing to solve is the position of the mouse to position the counter element. As the menu selection event doesn&#8217;t give us the mouse position we need to add a <code>contextmenu</code> handler to the whole document that positions the counter invisibly behind the menu when it is opened:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">document.<span style="color: #660066;">body</span>.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span>
  <span style="color: #3366CC;">'contextmenu'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>ev<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    counter.<span style="color: #660066;">style</span>.<span style="color: #660066;">left</span> <span style="color: #339933;">=</span> ev.<span style="color: #660066;">pageX</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'px'</span><span style="color: #339933;">;</span>
    counter.<span style="color: #660066;">style</span>.<span style="color: #660066;">top</span> <span style="color: #339933;">=</span> ev.<span style="color: #660066;">pageY</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'px'</span><span style="color: #339933;">;</span>
    counter.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'hide'</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> 
<span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>Further reading and resources</h2>
<ul>
<li><a href="http://thewebrocks.com/demos/context-menu">The full code demo</a></li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=617528">The Firefox bug request with lots of discussion</a></li>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#context-menus">Context Menus on the WHATWG</a></li>
<li><a href="https://plus.google.com/115133653231679625609/posts/CJMyExJTbug">A longer discussion on Google+ about context menus</a></li>
<li><a href="http://medialize.github.com/jQuery-contextMenu/demo/html5-polyfill-firefox8.html">A jQuery Polyfill for contextmenu</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/11/html5-context-menus-in-firefox-screencast-and-code/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
<enclosure url="http://cf.cdn.vid.ly/8e1y1v/mp4.mp4" length="9242123" type="video/mp4" />
<enclosure url="http://cf.cdn.vid.ly/8e1y1v/webm.webm" length="10110466" type="video/webm" />
<enclosure url="http://cf.cdn.vid.ly/8e1y1v/ogv.ogv" length="9682321" type="video/ogg" />
		</item>
		<item>
		<title>Screencast: CSS 3D rollover with fallback for older browsers</title>
		<link>http://hacks.mozilla.org/2011/11/screencast-css-3d-rollover-with-fallback-for-older-browsers/</link>
		<comments>http://hacks.mozilla.org/2011/11/screencast-css-3d-rollover-with-fallback-for-older-browsers/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 09:06:10 +0000</pubDate>
		<dc:creator>Chris Heilmann</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[Screencast]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[a11y]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[effect]]></category>
		<category><![CDATA[rollover]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=10194</guid>
		<description><![CDATA[Here&#8217;s a quick screencast how to create a 3D image rollover and still give a useful interface to browsers that do not support 3D transforms. If you want to see the effect in Firefox get the latest Aurora or Nightly. Check the following video to see what it looks like (first with a browser without [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick screencast how to create a 3D image rollover and still give a useful interface to browsers that do not support 3D transforms. If you want to see the effect in Firefox get the latest Aurora or Nightly. Check the following video to see what it looks like (first with a browser without CSS 3D transport, then with a newer one):</p>
<p><video controls><source src="http://thewebrocks.com/demos/3D-photo-rollover/3dkitty.mp4" type="video/mp4"><source src="http://thewebrocks.com/demos/3D-photo-rollover/3dkitty.webm" type="video/webm"><a href="http://thewebrocks.com/demos/3D-photo-rollover.mp4">Download video, seems your browser doesn&#8217;t support <span class="caps">HTML5</span> video</a></video></p>
<p>The screencast is on YouTube:</p>
<p><iframe width="560" height="315" src="http://www.youtube.com/embed/c3wHB6mOMBs" frameborder="0" allowfullscreen></iframe></p>
<p>The main procedure to achieve the effect is simple. First we need a semantically valuable way to show these images, in our case a HTML list with figures and figcaptions. Notice that images still need an alternative text as the figcaption can apply to several images:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ul<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;li</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;image3d&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;figure<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;mittens.jpg&quot;</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">&quot;Mittens the cat&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;figcaption<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;strong<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Mittens<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/strong<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> loves to play with yarn and stuff.
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/figcaption<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/figure<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/li<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #808080; font-style: italic;">&lt;!-- repeated --&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ul<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>We then position the caption absolutely inside the list item, give the list item dimensions and an overflow of hidden and move the caption outside of the visible space. When the user hovers over the list item (or focuses it with a keyboard) we move the caption to the right place and lower the opacity of the image.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.positioned</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">300px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.positioned</span> figcaption <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> rgba<span style="color: #00AA00;">&#40;</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0.7</span> <span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>
  border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">65px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">230px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.positioned</span> img <span style="color: #00AA00;">&#123;</span>
  opacity<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0.4</span> <span style="color: #00AA00;">;</span>    
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.positioned</span> figcaption strong <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">lime</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">22px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.positioned</span> figcaption p <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">white</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.interactive</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.interactive</span> img <span style="color: #00AA00;">&#123;</span>
  opacity<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.interactive</span> figcaption <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">300px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>  
<span style="color: #6666ff;">.interactive</span><span style="color: #3333ff;">:hover </span>img<span style="color: #00AA00;">,</span> <span style="color: #6666ff;">.interactive</span><span style="color: #3333ff;">:focus </span>img <span style="color: #00AA00;">&#123;</span>
  opacity<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0.4</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.interactive</span><span style="color: #3333ff;">:hover </span>figcaption<span style="color: #00AA00;">,</span> <span style="color: #6666ff;">.interactive</span><span style="color: #3333ff;">:focus </span>figcaption <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">75px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>We make the effect smooth by adding transitions. Notice that it makes sense to list all the browser prefixes and set a prefix-less fallback. That way we don&#8217;t need to re-write code when a new browser supports them.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.smooth</span> img <span style="color: #00AA00;">&#123;</span>
  -webkit-transition<span style="color: #00AA00;">:</span> all 1s<span style="color: #00AA00;">;</span>
  -moz-transition<span style="color: #00AA00;">:</span>    all 1s<span style="color: #00AA00;">;</span>
  -o-transition<span style="color: #00AA00;">:</span>      all 1s<span style="color: #00AA00;">;</span>
  -ms-transition<span style="color: #00AA00;">:</span>     all 1s<span style="color: #00AA00;">;</span>
  transition<span style="color: #00AA00;">:</span>         all 1s<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.smooth</span> figcaption <span style="color: #00AA00;">&#123;</span>
  -webkit-transition<span style="color: #00AA00;">:</span> all 1s<span style="color: #00AA00;">;</span>
  -moz-transition<span style="color: #00AA00;">:</span>    all 1s<span style="color: #00AA00;">;</span>
  -ms-transition<span style="color: #00AA00;">:</span>     all 1s<span style="color: #00AA00;">;</span>
  -o-transition<span style="color: #00AA00;">:</span>      all 1s<span style="color: #00AA00;">;</span>
  transition<span style="color: #00AA00;">:</span>         all 1s<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>In order to rotate the kitty in 3D space, we need to give the list item a perspective and rotate the image and shift it in 3D space with translate3D to avoid clipping:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.threed</span> <span style="color: #00AA00;">&#123;</span>
  -webkit-perspective<span style="color: #00AA00;">:</span> <span style="color: #933;">800px</span><span style="color: #00AA00;">;</span>
  -moz-perspective<span style="color: #00AA00;">:</span>    <span style="color: #933;">800px</span><span style="color: #00AA00;">;</span>
  -ms-perspective<span style="color: #00AA00;">:</span>     <span style="color: #933;">800px</span><span style="color: #00AA00;">;</span>
  -o-perspective<span style="color: #00AA00;">:</span>      <span style="color: #933;">800px</span><span style="color: #00AA00;">;</span>
  perspective<span style="color: #00AA00;">:</span>         <span style="color: #933;">800px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.threed</span><span style="color: #3333ff;">:hover </span>img<span style="color: #00AA00;">,</span> <span style="color: #6666ff;">.threed</span><span style="color: #3333ff;">:focus </span>img <span style="color: #00AA00;">&#123;</span>
  -webkit-transform<span style="color: #00AA00;">:</span> rotateY<span style="color: #00AA00;">&#40;</span> 50deg <span style="color: #00AA00;">&#41;</span> rotateX<span style="color: #00AA00;">&#40;</span> 10deg <span style="color: #00AA00;">&#41;</span>
                     translate3d<span style="color: #00AA00;">&#40;</span> <span style="color: #933;">80px</span><span style="color: #00AA00;">,</span> <span style="color: #933;">-20px</span><span style="color: #00AA00;">,</span> <span style="color: #933;">-100px</span> <span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
  -moz-transform<span style="color: #00AA00;">:</span>    rotateY<span style="color: #00AA00;">&#40;</span> 50deg <span style="color: #00AA00;">&#41;</span> rotateX<span style="color: #00AA00;">&#40;</span> 10deg <span style="color: #00AA00;">&#41;</span>
                     translate3d<span style="color: #00AA00;">&#40;</span> <span style="color: #933;">80px</span><span style="color: #00AA00;">,</span> <span style="color: #933;">-20px</span><span style="color: #00AA00;">,</span> <span style="color: #933;">-100px</span> <span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
  -o-transform<span style="color: #00AA00;">:</span>      rotateY<span style="color: #00AA00;">&#40;</span> 50deg <span style="color: #00AA00;">&#41;</span> rotateX<span style="color: #00AA00;">&#40;</span> 10deg <span style="color: #00AA00;">&#41;</span>
                     translate3d<span style="color: #00AA00;">&#40;</span> <span style="color: #933;">80px</span><span style="color: #00AA00;">,</span> <span style="color: #933;">-20px</span><span style="color: #00AA00;">,</span> <span style="color: #933;">-100px</span> <span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
  -ms-transform<span style="color: #00AA00;">:</span>     rotateY<span style="color: #00AA00;">&#40;</span> 50deg <span style="color: #00AA00;">&#41;</span> rotateX<span style="color: #00AA00;">&#40;</span> 10deg <span style="color: #00AA00;">&#41;</span>
                     translate3d<span style="color: #00AA00;">&#40;</span> <span style="color: #933;">80px</span><span style="color: #00AA00;">,</span> <span style="color: #933;">-20px</span><span style="color: #00AA00;">,</span> <span style="color: #933;">-100px</span> <span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
  transform<span style="color: #00AA00;">:</span>         rotateY<span style="color: #00AA00;">&#40;</span> 50deg <span style="color: #00AA00;">&#41;</span> rotateX<span style="color: #00AA00;">&#40;</span> 10deg <span style="color: #00AA00;">&#41;</span>
                     translate3d<span style="color: #00AA00;">&#40;</span> <span style="color: #933;">80px</span><span style="color: #00AA00;">,</span> <span style="color: #933;">-20px</span><span style="color: #00AA00;">,</span> <span style="color: #933;">-100px</span> <span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>That&#8217;s it. By adding all the browser prefixes, falling back to a simple rollover and by making sure you do the effect on hover and on focus you support all the browsers and bring the cool to the newest ones. </p>
<p>More reading and resources:</p>
<ul>
<li><a href="http://thewebrocks.com/demos/3D-photo-rollover/">Standalone example</a></li>
<li><a href="http://thewebrocks.com/demos/3D-photo-rollover/steps.html">Step-by-step example</a></li>
<li><a href="https://github.com/codepo8/3D-photo-rollover">GitHub source</a></li>
<li><a href="http://christianheilmann.com/2011/11/14/fun-with-3d-transforms-and-rollovers-kittens-in-space/">Detailed blog post</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/11/screencast-css-3d-rollover-with-fallback-for-older-browsers/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
<enclosure url="http://thewebrocks.com/demos/3D-photo-rollover/3dkitty.mp4" length="491259" type="video/mp4" />
<enclosure url="http://thewebrocks.com/demos/3D-photo-rollover/3dkitty.webm" length="404464" type="video/webm" />
<enclosure url="http://thewebrocks.com/demos/3D-photo-rollover.mp4" length="0" type="video/mp4" />
		</item>
		<item>
		<title>Mozilla Hacks Weekly, November 3rd 2011</title>
		<link>http://hacks.mozilla.org/2011/11/mozilla-hacks-weekly-november-3rd-2011/</link>
		<comments>http://hacks.mozilla.org/2011/11/mozilla-hacks-weekly-november-3rd-2011/#comments</comments>
		<pubDate>Thu, 03 Nov 2011 12:12:16 +0000</pubDate>
		<dc:creator>Robert Nyman</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[IndexedDB]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Mozilla Hacks Weekly]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=10071</guid>
		<description><![CDATA[Thursday again, and we in the Mozilla&#8217;s Developer Engagement Team has our weekly reading tips for you. Weekly links November 3rd 2011 If there is anything you think we should read or know about, don&#8217;t hesitate to post a comment, contact us on Twitter or through any other mean. The picks this week are: Christian [...]]]></description>
			<content:encoded><![CDATA[<p>Thursday again, and we in the Mozilla&#8217;s Developer Engagement Team has our weekly reading tips for you.</p>
<p><span id="more-10071"></span></p>
<h2>Weekly links November 3rd 2011</h2>
<p>If there is anything you think we should read or know about, don&#8217;t hesitate to post a comment, contact us on Twitter or through any other mean.<br />
The picks this week are:</p>
<h3>Christian Heilmann</h3>
<div class="team-member">
<img src="http://hacks.mozilla.org/wp-content/uploads/2011/08/chris-heilmann.jpg" alt="A picture of Christian Heilmann"> <a href="http://leaverou.github.com/animatable/">Animatable</a> (not to be mixed up with the tool powering <a href0"http://animatable.com/demos/madmanimation/">Madmanimation</a>) is  collection of CSS animations for different attributes. See all the possibilities.</p>
<p>    If you want to read more tips or discuss the web with Christian, he&#8217;s available on Twitter as <a href="http://twitter.com/codepo8">@codepo8</a>.
</div>
<h3>Havi Hoffman</h3>
<div class="team-member">
<img src="http://hacks.mozilla.org/wp-content/uploads/2011/08/havi-hoffman.jpg" alt="A picture of Havi Hoffman"> Whether you’re building an app or naming a project, two very geeky takes on what’s in a name. <a href="http://messymatters.com/pgnames.html">One from Paul Graham</a> and one called <a href="http://messymatters.com/2011/10/31/nominology/">Nominology</a>, that scores on “greppability” among other parameters. </p>
<p>    If you want to read more tips or discuss the web with Havi, she&#8217;s available on Twitter as <a href="http://twitter.com/freshelectrons">@freshelectrons</a>
</div>
<h3>Jeff Griffiths</h3>
<div class="team-member">
<img src="http://hacks.mozilla.org/wp-content/uploads/2011/11/jeff-griffiths.jpg" alt="A picture of Jeff Griffiths"> <a href="http://everytimezone.com/">Every Time Zone</a> is a really nice visualization of timezones and current time.</p>
<p>    If you want to read more tips or discuss the web with Jeff, he&#8217;s available on Twitter as <a href="http://twitter.com/canuckistani">@canuckistani</a>.
</div>
<h3>Joe Stagner</h3>
<div class="team-member">
<img src="http://hacks.mozilla.org/wp-content/uploads/2011/09/joe-stagner-cartoon.gif" alt="A picture of Joe Stagner"> IndexedDB is a powerful model for local data storage in Web Apps &#8211; <a href="http://www.w3.org/TR/IndexedDB/">read the spec</a> here and <a href="http://html5labs.interoperabilitybridges.com/IndexedDBTest/CodeSnippets/samples.html">see demos</a>.</p>
<p>    If you want to read more tips or discuss the web with Joe, he&#8217;s available on Twitter as <a href="http://twitter.com/MisfitGeek">@MisfitGeek</a>.
</div>
<h3>Rob Hawkes</h3>
<div class="team-member">
<img src="http://hacks.mozilla.org/wp-content/uploads/2011/07/rob-hawkes.jpg" alt="A picture of Rob Hawkes"> In <a href="http://vocamus.net/dave/?p=1354">Implementing Mouse Lock</a> David Humphrey talks about how he’s going to implement the <a href="http://dvcs.w3.org/hg/webevents/raw-file/default/mouse-lock.html">Mouse Lock API</a>. What’s most interesting about this is that he’s going to get his students at Seneca to <a href="http://zenit.senecac.on.ca/wiki/index.php/Implementing_the_Mouse_Lock_API_in_Firefox">help implement it</a>.</p>
<p>    If you want to read more tips or discuss the web with Rob, he&#8217;s available on Twitter as <a href="http://twitter.com/robhawkes">@robhawkes</a>.
</div>
<h3>Robert Nyman</h3>
<div class="team-member">
<img src="http://hacks.mozilla.org/wp-content/uploads/2011/07/robert-nyman.jpg" alt="A picture of Robert Nyman"> <a href="https://github.com/mbebenita/Broadway">Broadway.js</a> &#8211; It’s a H.264 video implementation compiled to JavaScript, 30fps. Take a look at the <a href="http://yfrog.com/nmng0z">JS/H.264 demo video</a>.</p>
<p>    If you want to read more tips or discuss the web with Robert, he&#8217;s available on Twitter as <a href="http://twitter.com/robertnyman">@robertnyman</a>.
</div>
<style>
    .team-member { overflow: hidden; margin-bottom: 15px; }
    .team-member img { float: left; margin: 0 20px 10px 0; }
    .team-member ul { margin-left: 0; }
    .team-member li { margin-left: 180px; }
</style>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/11/mozilla-hacks-weekly-november-3rd-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS 3D transformations in Firefox Nightly</title>
		<link>http://hacks.mozilla.org/2011/10/css-3d-transformations-in-firefox-nightly/</link>
		<comments>http://hacks.mozilla.org/2011/10/css-3d-transformations-in-firefox-nightly/#comments</comments>
		<pubDate>Wed, 26 Oct 2011 20:18:42 +0000</pubDate>
		<dc:creator>Chris Heilmann</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[Feature]]></category>
		<category><![CDATA[Featured Demo]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[Web Developers]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=10017</guid>
		<description><![CDATA[When the first 3D transformations in CSS got support on Webkit browsers people got incredibly excited about them. Now that they have matured we also support 3D CSS in Firefox. To see it for yourself, check out one of the latest nightly builds. You can see them in action in this demo of a rotating [...]]]></description>
			<content:encoded><![CDATA[<p>When the first 3D transformations in CSS got support on Webkit browsers people got incredibly excited about them. Now <a href="http://dev.w3.org/csswg/css3-3d-transforms/">that they have matured</a> we also support 3D CSS in Firefox. To see it for yourself, check out <a href="http://nightly.mozilla.org">one of the latest nightly builds</a>. </p>
<p>You can see them in action in <a href="http://thewebrocks.com/demos/html5-3d-css">this demo of a rotating HTML5 logo</a> and the screencast below:</p>
<p><video controls preload="none" style="width:100%;height:300px;" poster="http://cf.cdn.vid.ly/5l3j6a/poster.jpg"><source src="http://cf.cdn.vid.ly/5l3j6a/mp4.mp4" type="video/mp4"><source src="http://cf.cdn.vid.ly/5l3j6a/webm.webm" type="video/webm"><source src="http://cf.cdn.vid.ly/5l3j6a/ogv.ogv" type="video/ogg"><a target='_blank' href='http://vid.ly/5l3j6a'><img   src='http://cf.cdn.vid.ly/5l3j6a/poster.jpg' width="500"></a></video></p>
<p>This means now that we need your support in trying out CSS 3D examples in Firefox and add other extensions than <code>-webkit-</code> to your CSS 3D products and demos. To show that this is possible, we took the well-known <a href="http://www.webkit.org/blog-files/3d-transforms/poster-circle.html">webkit-only &#8220;poster circle&#8221; demo</a> and made it work with Firefox nightly by adding the -moz- (and of course the other prefixes and one set of instructions without browser prefixes). Here is a slight excerpt:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">-webkit-transform-style<span style="color: #00AA00;">:</span> preserve-3d<span style="color: #00AA00;">;</span>
-moz-transform-style<span style="color: #00AA00;">:</span> preserve-3d<span style="color: #00AA00;">;</span>
-o-transform-style<span style="color: #00AA00;">:</span> preserve-3d<span style="color: #00AA00;">;</span>
-ms-transform-style<span style="color: #00AA00;">:</span> preserve-3d<span style="color: #00AA00;">;</span>
transform-style<span style="color: #00AA00;">:</span> preserve-3d<span style="color: #00AA00;">;</span></pre></div></div>

<p>You can see this in action in the screencast below alongside Chrome and you <a href="http://thewebrocks.com/demos/postercircle/">try the demo out yourself</a>. The slight jerkiness is actually my MacBook Air impersonating a starting jet every time I use ScreenFlow and not the browser.</p>
<p><video controls preload="none" style="width:100%;height:300px;" poster="http://cf.cdn.vid.ly/4m8d9f/poster.jpg"><source src="http://cf.cdn.vid.ly/4m8d9f/mp4.mp4" type="video/mp4"><source src="http://cf.cdn.vid.ly/4m8d9f/webm.webm" type="video/webm"><source src="http://cf.cdn.vid.ly/4m8d9f/ogv.ogv" type="video/ogg"><a target='_blank' href='http://vid.ly/4m8d9f'><img   src='http://cf.cdn.vid.ly/4m8d9f/poster.jpg' width="500"></a></video></p>
<p>To celebrate the release and to show how CSS 3D can be applied as subtle effect, have a <a href="http://thewebrocks.com/demos/browsermemory/">game of pairs using your favourite browsers (and a cat)</a> : </p>
<p><a href="http://thewebrocks.com/demos/browsermemory/"><img src="http://farm7.static.flickr.com/6112/6283741113_b3604d4ee5_o.jpg" alt="browser pairs"></a></p>
<p>Oleg Romashin also spent some time to <a href="http://romaxa.bolshe.net/css3d/">convert a few CSS 3D demos to work with Mozilla</a> and you can <a href="http://m8y.org/tmp/cubiq.org/dropbox/3dcity/index2.html">check the 3D city</a> for more &#8220;wow&#8221;.</p>
<p>If you are new to CSS 3D transformations <a href="http://24ways.org/2010/intro-to-css-3d-transforms">here&#8217;s a good beginner course</a> and <a href="http://www.westciv.com/tools/3Dtransforms/index.html">a tool to create them</a>. </p>
<p>The rotating HTML5 logo demo also shows how you can check if the currently used browser supports 3D transforms. Instead of repeating the animation frames for all the prefixes we test in JavaScript and create the CSS on the fly:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> checksupport<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> props <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'perspectiveProperty'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'WebkitPerspective'</span><span style="color: #339933;">,</span>
               <span style="color: #3366CC;">'MozPerspective'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'OPerspective'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'msPerspective'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
      i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>
      support <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>props<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>props<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #000066; font-weight: bold;">in</span> form.<span style="color: #660066;">style</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      support <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
      pfx <span style="color: #339933;">=</span> props<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Perspective'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      pfx <span style="color: #339933;">=</span> pfx.<span style="color: #660066;">toLowerCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    i<span style="color: #339933;">++;</span>
  <span style="color: #009900;">&#125;</span> 
  <span style="color: #000066; font-weight: bold;">return</span> support<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>checksupport<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> s <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
  styles <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'style'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  s <span style="color: #339933;">+=</span> <span style="color: #3366CC;">'#stage{-'</span><span style="color: #339933;">+</span> pfx <span style="color: #339933;">+</span><span style="color: #3366CC;">'-perspective: 300px;}'</span><span style="color: #339933;">+</span>
       <span style="color: #3366CC;">'#logo{-'</span><span style="color: #339933;">+</span> pfx <span style="color: #339933;">+</span><span style="color: #3366CC;">'-transform-style: preserve-3d;position:relative;}'</span><span style="color: #339933;">+</span>  
       <span style="color: #3366CC;">'#logo.spin{-'</span><span style="color: #339933;">+</span> pfx <span style="color: #339933;">+</span><span style="color: #3366CC;">'-animation: spin 3s infinite linear;}'</span><span style="color: #339933;">+</span>
       <span style="color: #3366CC;">'@-'</span><span style="color: #339933;">+</span> pfx <span style="color: #339933;">+</span><span style="color: #3366CC;">'-keyframes spin {'</span><span style="color: #339933;">+</span>  
       <span style="color: #3366CC;">'0% {'</span><span style="color: #339933;">+</span> 
       <span style="color: #3366CC;">'-'</span><span style="color: #339933;">+</span> pfx <span style="color: #339933;">+</span><span style="color: #3366CC;">'-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);'</span><span style="color: #339933;">+</span>   
       <span style="color: #3366CC;">'}'</span><span style="color: #339933;">+</span>
       <span style="color: #3366CC;">'100% {'</span><span style="color: #339933;">+</span>   
       <span style="color: #3366CC;">'-'</span><span style="color: #339933;">+</span> pfx <span style="color: #339933;">+</span><span style="color: #3366CC;">'-transform: rotateX(0deg) rotateY(360deg)'</span><span style="color: #339933;">+</span>
       <span style="color: #3366CC;">' rotateZ(360deg);'</span><span style="color: #339933;">+</span> 
       <span style="color: #3366CC;">'}}'</span><span style="color: #339933;">;</span>
  styles.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> s<span style="color: #339933;">;</span>
  document.<span style="color: #660066;">querySelector</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'head'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>styles<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>For more information on creating your own pages that use 3D transformations, take a look at the <a href="http://dev.w3.org/csswg/css3-3d-transforms/">draft specification</a></p>
<p>As always, If you find any bugs, please report them at <a href="https://bugzilla.mozilla.org">bugzilla.mozilla.org</a>!</p>
<p>So please reward our hard work bringing the third dimension to Firefox&#8217;s CSS engine by supporting and testing. Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/10/css-3d-transformations-in-firefox-nightly/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
<enclosure url="http://cf.cdn.vid.ly/5l3j6a/mp4.mp4" length="6843288" type="video/mp4" />
<enclosure url="http://cf.cdn.vid.ly/5l3j6a/webm.webm" length="6684672" type="video/webm" />
<enclosure url="http://cf.cdn.vid.ly/5l3j6a/ogv.ogv" length="6626659" type="video/ogg" />
<enclosure url="http://cf.cdn.vid.ly/4m8d9f/mp4.mp4" length="6138097" type="video/mp4" />
<enclosure url="http://cf.cdn.vid.ly/4m8d9f/webm.webm" length="6887958" type="video/webm" />
<enclosure url="http://cf.cdn.vid.ly/4m8d9f/ogv.ogv" length="13626193" type="video/ogg" />
		</item>
		<item>
		<title>Introducing Aurora 9</title>
		<link>http://hacks.mozilla.org/2011/09/introducing-aurora-9/</link>
		<comments>http://hacks.mozilla.org/2011/09/introducing-aurora-9/#comments</comments>
		<pubDate>Fri, 30 Sep 2011 22:22:45 +0000</pubDate>
		<dc:creator>Robert Nyman</dc:creator>
				<category><![CDATA[Aurora]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[Feature]]></category>
		<category><![CDATA[Featured Article]]></category>
		<category><![CDATA[Firefox 9]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[XMLHttpRequest]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=9688</guid>
		<description><![CDATA[We have just released Aurora 9 (download and test Aurora 9), which is planned to be the upcoming Firefox 9. In it, we have a number of new things that we hope will get you excited! JavaScript Type Inference We&#8217;ve improved JavaScript performance once again with type inference. We&#8217;ve made significant improvements on both the [...]]]></description>
			<content:encoded><![CDATA[<p>We have just released Aurora 9 (<a href="http://www.mozilla.org/en-US/firefox/channel/">download and test Aurora 9</a>), which is planned to be the upcoming Firefox 9. In it, we have a number of new things that we hope will get you excited!</p>
<p><span id="more-9688"></span></p>
<h2>JavaScript Type Inference</h2>
<p>We&#8217;ve improved JavaScript performance once again with type inference. We&#8217;ve made significant improvements on both the V8 and Kraken benchmarks, and you should see real-world improvements to JavaScript performance as well.</p>
<h2>JavaScript Interface for Do Not Track</h2>
<p>Firefox 4 introduced <a href="https://developer.mozilla.org/en/The_Do_Not_Track_Field_Guide/Introduction/How_Do_Not_Track_works">Do Not Track</a>, and now there is a way to detect a users&#8217;prefence through JavaScript as well:</p>
<p><iframe style="width: 100%; height: 100px;" src="http://jsfiddle.net/robnyman/cFqXk/1/embedded/" width="320" height="240"></iframe></p>
<h2>mouseenter and mouseleave events</h2>
<p>For some time now, <a href="http://www.quirksmode.org/dom/events/mouseover.html">web developers have been struggling</a> with handling <code>mouseover</code> and <code>mouseout</code> events on elements, since when child elements have gained focus, the event has bubbled up and triggered <code>mouseout</code> on the parent element &#8211; something you would in most cases not like to happen.</p>
<p>Therefore, we are now happy to introduce support for <code>mouseenter</code> and <code>mouseleave</code> events:</p>
<p><iframe style="width: 100%; height: 300px;" src="http://jsfiddle.net/robnyman/ZVTa2/12/embedded/" width="320" height="240"></iframe></p>
<h2>Camera UI for Mobile</h2>
<p>You can now use an input element to trigger a native app to take pictures. Please try the <a href="http://jsbin.com/iwerow/27/">Camera UI for Mobile demo</a>.</p>
<h2>Support for chunked XMLHttpRequest</h2>
<p>When doing XMLHttpRequest requests with large data sets, you can now <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=687087">get partial data</a> as it arrives instead of waiting for it all to show up. You can use this to build more responsive and more efficient web sites.</p>
<h2>Other changes</h2>
<p>We&#8217;ve also got support for a bunch of other changes as well.  These will be added to the <a href="https://developer.mozilla.org/en/Firefox_9_for_developers">Firefox 9 for Developers page over the next few weeks.</a></p>
<div class="changelog">
<h4>HTML</h4>
<ul>
<li>We now support <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=654352">document.caretPositionFromPoint</a>
<li>We now support <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=683852">Node.contains(node)</a>
<li>We now <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=685139">return true for node.contains(node)</a>, as other browsers do.  (The spec says we should return false but the spec is probably wrong given the behaviour of all browsers.)
<li>We now support <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=685798">Node.parentElement</a>
<li>We no longer <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=685518">taint the canvas data when drawing images where @crossorigin is set on them</a>
<li>We now only <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=682554">fire onreadystatechange on the document element</a>
<li>There is now <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=605365">UI for HTML5 Forms Validation in Fennec</a>
<li>We now fire <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=185236">load and error events on stylesheet link elements that are loaded dynamically</a>
<li>We now support <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=543789">DOM3 composition events</a>
</ul>
</div>
<div class="changelog">
<h4>Graphics</h4>
<ul>
<li>We now support <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=600556">Vista-style ICO files</a></li>
<li>We now <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=573583">decode images only when drawing them</a>, instead of ahead of time</li>
</ul>
</div>
<div class="changelog">
<h4>Layout</h4>
<ul>
<li>We now support the <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=446569">CSS3 columns shorthand where column-count and column-width can be combined</a>
<li>We now support <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=677582">CSS3 text-overflow: &lt;left&gt; &lt;right&gt;</a>
<li>We now support the font-stretch property (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=3512">bug number 3512, filed in 1999!</a>)
<li>You can now use <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=688405">65534 rowspans instead of 8190</a>, to match IE.
</ul>
</div>
<div class="changelog">
<h4>Video</h4>
<ul>
<li>We now support <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=648595">temporal media URIs for HTML5 video</a>.</li>
</ul>
</div>
<div class="changelog">
<h4>Network</h4>
<ul>
<li>We&#8217;ve changed the way we handle <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=665706">semicolons during URL parsing</a></li>
<li>We no longer pop up a <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=423506">download dialog bog when a server returns no data</a> and instead show a corrupted content error, to match other browsers.</li>
<li>We&#8217;ve made some <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=686312">minor</a> <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=687243">protocol</a> fixes to WebSockets</li>
<li>If you include an <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=272541">empty disposition type it&#8217;s treated as an &#8220;attachment&#8221;</a></li>
<li>We don&#8217;t <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=255119">show redirect content after denying automatic redirect to javascript: URL</a></li>
</ul>
</div>
<div class="changelog">
<h4>Tools</h4>
<ul>
<li>We now <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=612658">cache data for the window.console API</a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/09/introducing-aurora-9/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>HTML5: Time for some slicker apps &#8211; a talk at Kings of Code</title>
		<link>http://hacks.mozilla.org/2011/09/html5-time-for-some-slicker-apps-a-talk-at-kings-of-code/</link>
		<comments>http://hacks.mozilla.org/2011/09/html5-time-for-some-slicker-apps-a-talk-at-kings-of-code/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 11:34:56 +0000</pubDate>
		<dc:creator>Chris Heilmann</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[kingsofcode]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=9555</guid>
		<description><![CDATA[The Kings of code conference in Amsterdam attracted a few hundred backend developers. Part hackday, part conference, Kings of Code spans over a few days and brings together developers from various backgrounds. The ambitious goal of the Mozilla keynote was to cover the relevant parts of HTML5 and CSS3 for this audience in 25 minutes. [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://kingsofcode.com/">Kings of code</a> conference in Amsterdam attracted a few hundred backend developers. Part hackday, part conference, Kings of Code spans over a few days and brings together developers from various backgrounds. The ambitious goal of the Mozilla keynote was to cover the relevant parts of HTML5 and CSS3 for this audience in 25 minutes.</p>
<p>The <a href="http://icant.co.uk/talks/koc2011/">presentation slides are available here</a> and embedded below (use cursor keys to navigate back and forth and hit &#8216;n&#8217; to show and hide the notes):</p>
<p><iframe src="http://icant.co.uk/talks/koc2011/#1" style="width:100%;height:350px;"></iframe></p>
<p>The <a href="http://www.archive.org/details/Html5-TimeForSomeSlickerApps">audio recording of the talk</a> (raw, unedited) is available on archive.org. </p>
<p><audio style="display:block;margin:1em;" controls><source type="audio/mp3" src="http://www.archive.org/download/Html5-TimeForSomeSlickerApps/Html5-TimeForSomeSlickerApps_html5-TimeForSomeSlickerApps.mp3"></source><source type="audio/ogg" src="http://www.archive.org/download/Html5-TimeForSomeSlickerApps/Html5-TimeForSomeSlickerApps_html5-TimeForSomeSlickerApps.ogg"></source></audio></p>
<p>Overall the reaction was good, and we hope we managed to bust some myths and look forward to see what people do with the inspiration.</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/09/html5-time-for-some-slicker-apps-a-talk-at-kings-of-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://www.archive.org/download/Html5-TimeForSomeSlickerApps/Html5-TimeForSomeSlickerApps_html5-TimeForSomeSlickerApps.mp3" length="0" type="audio/mpeg" />
<enclosure url="http://www.archive.org/download/Html5-TimeForSomeSlickerApps/Html5-TimeForSomeSlickerApps_html5-TimeForSomeSlickerApps.ogg" length="0" type="audio/ogg" />
		</item>
		<item>
		<title>Taking steps() with CSS animations</title>
		<link>http://hacks.mozilla.org/2011/09/taking-steps-with-css-animations/</link>
		<comments>http://hacks.mozilla.org/2011/09/taking-steps-with-css-animations/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 20:57:03 +0000</pubDate>
		<dc:creator>Chris Heilmann</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[sprites]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=9522</guid>
		<description><![CDATA[CSS animations are hot and a lot of experimentation is going on. A cool new feature of animations is the steps() option which allows you to cut an animation into steps instead of a transition from one state to another in one go. While this seems counterproductive on first glance there is a lot you [...]]]></description>
			<content:encoded><![CDATA[<p>CSS animations are hot and a lot of experimentation is going on. A cool new feature of animations is the <a href="http://dev.w3.org/csswg/css3-animations/#animation-timing-function">steps()</a> option which allows you to cut an animation into steps instead of a transition from one state to another in one go. While this seems counterproductive on first glance there is a lot you can do with it.</p>
<p>Inspired by the <a href="http://gidsy.com/handbooks/making-the-perfect-listing/">making the perfect listing</a> web site <a href="http://twitter.com/leaverou">Lea Verou</a> created a <a href="http://leaverou.me/2011/09/pure-css3-typing-animation-with-steps/">Pure CSS3 typing animation</a>.</p>
<p><iframe style="width: 100%; height: 160px" src="http://jsfiddle.net/leaverou/y8kNx/embedded/result%2Ccss%2Chtml"></iframe></p>
<p>Which then inspired <a href="http://twitter.com/simurai">@simurai</a> to use the steps() feature to <a href="http://jsfiddle.net/simurai/CGmCe/">create a sprite animation</a>.</p>
<p><iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/simurai/CGmCe/embedded/result%2Ccss%2Chtml"></iframe></p>
<p>Especially the latter is very interesting as it allows for a scripted animation without JavaScript &#8211; remember when you had to re-animate GIFs in Photoshop and re-optimise them every time a client wanted them faster or slower?</p>
<p>For now  the steps only divide the full length of the animation up. If you want different timings for different steps you still will need to create keyframes for each. Right now the steps feature works in Firefox and Webkit. Let&#8217;s hope others will follow, too.</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/09/taking-steps-with-css-animations/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Video and slides from Mozillas CSS3 &amp; HTML5 talk at the Frontend Conference in Zurich</title>
		<link>http://hacks.mozilla.org/2011/09/video-and-slides-from-mozillas-css3-html5-talk-at-the-frontend-conference-in-zurich/</link>
		<comments>http://hacks.mozilla.org/2011/09/video-and-slides-from-mozillas-css3-html5-talk-at-the-frontend-conference-in-zurich/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 12:22:00 +0000</pubDate>
		<dc:creator>Robert Nyman</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=9517</guid>
		<description><![CDATA[I&#8217;m currently attending the Frontend Conference in Zurich, Switzerland and this morning I gave a presentation about mobile possibilities offered through CSS3 and HTML5. Setting a great example, the video of my talk was livestreamed and available directly after as a clip on the web: Note: The audio is unfortunately not working as supposed in [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently attending the <a href="http://frontendconf.ch/">Frontend Conference in Zurich, Switzerland</a> and this morning I gave a presentation about mobile possibilities offered through CSS3 and HTML5.</p>
<p><span id="more-9517"></span></p>
<p>Setting a great example, <a href="http://www.ustream.tv/recorded/17155424">the video of my talk</a> was livestreamed and available directly after as a clip on the web:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="296" id="utv528956" name="utv_n_5587"><param name="flashvars" value="loc=%2F&amp;autoplay=false&amp;vid=17155424&amp;locale=en_US&amp;hasticket=false&amp;v3=1" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.ustream.tv/flash/viewer.swf" /><embed flashvars="loc=%2F&amp;autoplay=false&amp;vid=17155424&amp;locale=en_US&amp;hasticket=false&amp;v3=1" width="480" height="296" allowfullscreen="true" allowscriptaccess="always" id="utv528956" name="utv_n_5587" src="http://www.ustream.tv/flash/viewer.swf" type="application/x-shockwave-flash" /></object></p>
<p><i>Note: The audio is unfortunately not working as supposed in a couple of places.</i></p>
<p>To complement that, here are the slides:</p>
<p><iframe style="border:none;width:550px;height:458px;" src="http://icant.co.uk/slidesharehtml/embed.php?url=http://www.slideshare.net/robnyman/html5-and-css3-exploring-mobile-possibilities-frontend-conference-zrich&amp;width=500"></iframe></p>
<p><a href="http://www.slideshare.net/robnyman/html5-and-css3-exploring-mobile-possibilities-frontend-conference-zrich">Download the slides on SlideShare</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/09/video-and-slides-from-mozillas-css3-html5-talk-at-the-frontend-conference-in-zurich/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Detecting and generating CSS animations in JavaScript</title>
		<link>http://hacks.mozilla.org/2011/09/detecting-and-generating-css-animations-in-javascript/</link>
		<comments>http://hacks.mozilla.org/2011/09/detecting-and-generating-css-animations-in-javascript/#comments</comments>
		<pubDate>Tue, 06 Sep 2011 06:29:27 +0000</pubDate>
		<dc:creator>Chris Heilmann</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[animations]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[detecting]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=9454</guid>
		<description><![CDATA[When writing of the hypnotic spiral demo the issue appeared that I wanted to use CSS animation when possible but have a fallback to rotate an element. As I didn&#8217;t want to rely on CSS animation I also considered it pointless to write it by hand but instead create it with JavaScript when the browser [...]]]></description>
			<content:encoded><![CDATA[<p>When writing of the <a href="https://developer.mozilla.org/en-US/demos/detail/hypnotic-spiral">hypnotic spiral</a> demo the issue appeared that I wanted to use CSS animation when possible but have a fallback to rotate an element. As I didn&#8217;t want to rely on CSS animation I also considered it pointless to write it by hand but instead create it with JavaScript when the browser supports it. Here&#8217;s how that is done. </p>
<p>Testing for the support of animations means testing if the style attribute is supported:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> animation <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span>
    animationstring <span style="color: #339933;">=</span> <span style="color: #3366CC;">'animation'</span><span style="color: #339933;">,</span>
    keyframeprefix <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">,</span>
    domPrefixes <span style="color: #339933;">=</span> <span style="color: #3366CC;">'Webkit Moz O ms Khtml'</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">' '</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    pfx  <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> elm.<span style="color: #660066;">style</span>.<span style="color: #660066;">animationName</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> animation <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>    
&nbsp;
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> animation <span style="color: #339933;">===</span> <span style="color: #003366; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> domPrefixes.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> elm.<span style="color: #660066;">style</span><span style="color: #009900;">&#91;</span> domPrefixes<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'AnimationName'</span> <span style="color: #009900;">&#93;</span> <span style="color: #339933;">!==</span> undefined <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      pfx <span style="color: #339933;">=</span> domPrefixes<span style="color: #009900;">&#91;</span> i <span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
      animationstring <span style="color: #339933;">=</span> pfx <span style="color: #339933;">+</span> <span style="color: #3366CC;">'Animation'</span><span style="color: #339933;">;</span>
      keyframeprefix <span style="color: #339933;">=</span> <span style="color: #3366CC;">'-'</span> <span style="color: #339933;">+</span> pfx.<span style="color: #660066;">toLowerCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'-'</span><span style="color: #339933;">;</span>
      animation <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>[Update - the earlier code did not check if the browser supports animation without a prefix - this one does]</p>
<p>This checks if the browser supports animation without any prefixes. If it does, the animation string will be &#8216;animation&#8217; and there is no need for any keyframe prefixes. If it doesn&#8217;t then we go through all the browser prefixes (to date :)) and check if there is a property on the style collection called browser prefix + <code>AnimationName</code>. If there is, the loop exits and we define the right animation string and keyframe prefix and set animation to true. On Firefox this will result in <code>MozAnimation</code>  and <code>-moz-</code> and on Chrome in <code>WebkitAnimation</code> and <code>-webkit-</code> so on. This we can then use to create a new CSS animation in JavaScript. If none of the prefix checks return a supported style property we animate in an alternative fashion.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> animation <span style="color: #339933;">===</span> <span style="color: #003366; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #006600; font-style: italic;">// animate in JavaScript fallback</span>
&nbsp;
<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
  elm.<span style="color: #660066;">style</span><span style="color: #009900;">&#91;</span> animationstring <span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'rotate 1s linear infinite'</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #003366; font-weight: bold;">var</span> keyframes <span style="color: #339933;">=</span> <span style="color: #3366CC;">'@'</span> <span style="color: #339933;">+</span> keyframeprefix <span style="color: #339933;">+</span> <span style="color: #3366CC;">'keyframes rotate { '</span><span style="color: #339933;">+</span>
                    <span style="color: #3366CC;">'from {'</span> <span style="color: #339933;">+</span> keyframeprefix <span style="color: #339933;">+</span> <span style="color: #3366CC;">'transform:rotate( 0deg ) }'</span><span style="color: #339933;">+</span>
                    <span style="color: #3366CC;">'to {'</span> <span style="color: #339933;">+</span> keyframeprefix <span style="color: #339933;">+</span> <span style="color: #3366CC;">'transform:rotate( 360deg ) }'</span><span style="color: #339933;">+</span>
                  <span style="color: #3366CC;">'}'</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> document.<span style="color: #660066;">styleSheets</span> <span style="color: #339933;">&amp;&amp;</span> document.<span style="color: #660066;">styleSheets</span>.<span style="color: #660066;">length</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
      document.<span style="color: #660066;">styleSheets</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">insertRule</span><span style="color: #009900;">&#40;</span> keyframes<span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #003366; font-weight: bold;">var</span> s <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'style'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    s.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> keyframes<span style="color: #339933;">;</span>
    document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'head'</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span> <span style="color: #CC0000;">0</span> <span style="color: #009900;">&#93;</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span> s <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>With the animation string defined we can set a (shortcut notation) animation on our element. Now, adding the keyframes is trickier. As they are not part of the original Animation but disconnected from it in the CSS syntax (to give them more flexibility and allow re-use) we can&#8217;t set them in JavaScript. Instead we need to write them out as a CSS string. </p>
<p>If there is already a style sheet applied to the document we add this keyframe definition string to that one, if there isn&#8217;t a style sheet available we create a new style block with our keyframe and add it to the document. </p>
<p>You can see the detection in action and a fallback JavaScript solution <a href="http://jsfiddle.net/codepo8/ATS2S/8/embedded/result/">on JSFiddle</a>:</p>
<p><iframe style="width: 100%; height: 400px" src="http://jsfiddle.net/codepo8/ATS2S/8/embedded/result,js,css,html"></iframe></p>
<p>Quite simple, but also a bit more complex than I originally thought. You can also dynamically detect and change current animations as <a href="http://waynepan.com/2008/08/08/iphone-css-animations-thoughts-and-issues/">this post by Wayne Pan</a> and <a href="http://www.joelambert.co.uk/testcases/keyframes.html">this demo by Joe Lambert</a> explains but this also seems quite verbose.</p>
<p>I&#8217;d love to have a <code>CSSAnimations</code> collection for example where you could store different animations in JSON or as a string and have their name as the key. Right now, creating a new rule dynamically and adding it either to the document or append it to the ruleset seems to be the only cross-browser way. Thoughts?</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/09/detecting-and-generating-css-animations-in-javascript/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Dynabyte event and presentations on HTML5 and CSS3</title>
		<link>http://hacks.mozilla.org/2011/09/dynabyte-event-and-presentations-on-html5-and-css3/</link>
		<comments>http://hacks.mozilla.org/2011/09/dynabyte-event-and-presentations-on-html5-and-css3/#comments</comments>
		<pubDate>Mon, 05 Sep 2011 13:05:22 +0000</pubDate>
		<dc:creator>Robert Nyman</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Web Developers]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=9452</guid>
		<description><![CDATA[Last week I spoke at the Dynabyte meetup in Stockholm and I wanted to share the slides and what I was talking about. My presentations I gave two presentations during the evening: HTML5 &#8211; The 2012 of the Web The idea of my first presentation was to give an overview of HTML5 features and cover [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I spoke at the <a href="http://lanyrd.com/2011/dynabyte-html5-the-2012-of-the-web/">Dynabyte meetup in Stockholm</a> and I wanted to share the slides and what I was talking about.</p>
<p><span id="more-9452"></span></p>
<h2>My presentations</h2>
<p>I gave two presentations during the evening:</p>
<h3>HTML5 &#8211; The 2012 of the Web</h3>
<p>The idea of my first presentation was to give an overview of HTML5 features and cover both possibilities and pitfalls they bring us:</p>
<p><iframe style="border:none;width:560px;height:466px;" src="http://icant.co.uk/slidesharehtml/embed.php?url=http://www.slideshare.net/robnyman/html5-the-2012-of-the-web&amp;width=510¤t=1"></iframe></p>
<p><a href="http://www.slideshare.net/robnyman/html5-the-2012-of-the-web">HTML5 &#8211; The 2012 of the Web slides, on SlideShare</a></p>
<p>I went through what is encompassed in the term HTML5 &#8211; which I broadly believe are semantic improvements and new APIs. I spoke about new elements, how the doctype choice affects rendering and how you can easily specify the charset of the document. After that I covered new HTML5 form types, elements and attributes. I moved on to what I believe are some of the more important APIs and then talking about video and canvas and WebGL.</p>
<p>The talk was concluded by going through some of the most common questions and worries around HTML5 and to inspire people to try it out, and let specification writers and web browser vendors know what&#8217;s working well, and what is not.</p>
<h3>HTML5 and CSS3 – exploring mobile possibilities </h3>
<p>The second presentation went more into HTML5 features that are extra useful for mobile devices &#8211; such as offline applications &#8211; and link protocols for calls and text messages and tools for developing on mobile devices. I also covered a number of CSS3 options we have:</p>
<p><iframe style="border:none;width:560px;height:466px;" src="http://icant.co.uk/slidesharehtml/embed.php?url=http://www.slideshare.net/robnyman/html5-and-css3-exploring-mobile-possibilities-dynabyte-event&amp;width=510¤t=1"></iframe></p>
<p><a href="http://www.slideshare.net/robnyman/html5-and-css3-exploring-mobile-possibilities-dynabyte-event">HTML5 and CSS3 – exploring mobile possibilities slides, on SlideShare</a></p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/09/dynabyte-event-and-presentations-on-html5-and-css3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rendering 3D with CSS and JavaScript with dom3d (guest post)</title>
		<link>http://hacks.mozilla.org/2011/08/rendering-3d-with-css-and-javascript-with-dom3d-guest-post/</link>
		<comments>http://hacks.mozilla.org/2011/08/rendering-3d-with-css-and-javascript-with-dom3d-guest-post/#comments</comments>
		<pubDate>Mon, 08 Aug 2011 07:38:22 +0000</pubDate>
		<dc:creator>Chris Heilmann</dc:creator>
				<category><![CDATA[Animations]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[css3d]]></category>
		<category><![CDATA[hack]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=9071</guid>
		<description><![CDATA[Today we have a guest post by James Long (@jlongster). James is the tech lead for mozilla.com on the Web Development team. James is passionate about interactive graphics on the open web. Today he explains how you can create 3D objects using CSS without having 3D transforms support. Take it away, James. Recently I was [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://hacks.mozilla.org/wp-content/uploads/2011/08/jameslong.png" alt="James Long"width="204" height="206" style="float:left;padding:5px;" /> Today we have a guest post by James Long (<a href="http://twitter.com/jlongster">@jlongster</a>).</p>
<p>James is the tech lead for mozilla.com on the Web Development team. James is passionate about interactive graphics on the open web. </p>
<p>Today he explains how you can create 3D objects using CSS without having 3D transforms support. Take it away, James.</p>
<hr />
<p style="clear:both;margin-top:3em">Recently I was tinkering with CSS3 and I discovered that it  enabled me to do primitive 3D rendering, which I found  fascinating! This led to the creation  of <a href="https://github.com/jlongster/dom3d">dom3d</a>, a  JavaScript library that uses CSS to render basic 3D objects.</p>
<p>Now the question is: why? Aren&#8217;t canvas, WebGL, and even SVG  better technologies to work with for this? Possibly. However,  CSS is becoming a powerful language for describing complex  effects and shapes, and we should experiment.</p>
<p>Keep that in mind, because CSS definitely  isn&#8217;t <em>intended</em> to do this, but it&#8217;s worth trying to see  where we should take CSS in the future.</p>
<h2>Advantages</h2>
<p>Although this is more of an experiment, it has a few real world benefits:</p>
<p>All rendering libraries available for the web (canvas, WebGL,  SVG) require a canvas, which is a constrained box on the page  with a specific width and height. It is not possible to render  anything outside this box. The canvas also captures all DOM  events (like clicks), even completely transparent  sections. Theoretically, this could make it difficult to do effects that  overlay large parts of the page or are somehow deeply integrated  to the content.</p>
<p>Using CSS, we aren&#8217;t constrained to a box, and the effect can overlay large portions of the page without covering any the the  links or other content requiring interaction.</p>
<p>Other advantages include no need to initialize canvas 2D or  WebGL, and a simplistic API making it easy to pick up even if  you don&#8217;t know much about 3D. It might be easier for kids to  start playing around with this before they jump into WebGL or  something else. Also, because it&#8217;s just a dump of DOM elements  you can embed it anywhere (without  animation).</p>
<p>So keep in mind that this <em>is</em> a hack, but with the above  advantages. This might be good for certain effects: <a href="http://jlongster.com/s/dom3d/cursor.html">3D cursor</a>, nav  transitions, and others.</p>
<h2>How it works</h2>
<p>Three-D objects are just a bunch of triangles put together, so let&#8217;s  start with one simple triangle. If we get that working, it&#8217;s a  simple step forward to render multiple triangles to form a 3D  object.</p>
<p>Rendering a 3d triangle on a 2D screen involves something called  &#8220;projection&#8221;. This is the act of taking a 3D point  and <em>projecting</em> it onto a 2D screen. Plug in a 3D  triangle to a simple math equation, and you get a 2D triangle  representing how the 3D one would look on the screen.</p>
<p>The math is remarkably simple but may seem weird if you aren&#8217;t familiar with linear algebra. You can   <a href="https://github.com/jlongster/dom3d/blob/e892597fc020fe18a766/renderer.js#L6">take a look at the renderer code</a>.</p>
<p>Now comes the fun part: can you render any 2D triangle simply with <a href="https://developer.mozilla.org/En/transform">CSS3 transforms</a>? Turns out you can! It just takes some fiddling  to figure out which transforms to generate. CSS3 transforms are  composed of translate, scale, rotate, and skew values, and we  need a few equations to compute these values for a specific 2D  triangle.</p>
<p>First, let&#8217;s take a simple DOM element and turn it into a  triangle. We can do this with the <code>linear-gradient</code>  background image (another way  is <a href="http://mrcoles.com/blog/callout-box-css-border-triangles-cross-browser/">border triangles</a>).</p>
<p><iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/jlongster/cHhQ3/4/embedded/"></iframe></p>
<p>Now let&#8217;s draw the following blue triangle with the points [20,  20], [50, 120], and [120, 30]. A vital step is to set a few  initial reference points which set everything in the same  space. Our equations will assume these coordinate spaces. This  is how the points A, B, C and the side AB are related.</p>
<p><img src="http://hacks.mozilla.org/wp-content/uploads/2011/08/tri-compare.png" alt="Triangle comparison"/></p>
<p>If we take a closer look at this, we can derive the transform  values. First, get an idea of which angles and values we need  and then use geometry to form the equations (in  pseudo-code). The red box represents the DOM element, the form  AB represents the side formed by points A and B, and rotation  occurs clockwise.</p>
<p><img src="http://hacks.mozilla.org/wp-content/uploads/2011/08/tri-disect.png" alt="dissecting triangles" style="float:right"/>
<pre>
rotation = atan2(AB.x, AB.y)
AC' = rotate(AC, -rotation)
width = AC'.x
height = length(AB)
skew = atan2(AC'.y, AC'.x)
translate = A</pre>
<p>Awesome! Let&#8217;s try it out. Here is a live DOM element being  transformed by applying each of our equations:</p>
<p><iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/jlongster/2eU3Q/3/embedded/"></iframe></p>
<p>The resulting triangle matches our target triangle! Here is the  final CSS:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">93px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">104px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> -moz-linear-gradient<span style="color: #00AA00;">&#40;</span>-0.727211rad<span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#0000FF</span> <span style="color: #933;">50%</span><span style="color: #00AA00;">,</span> <span style="color: #993333;">transparent</span> <span style="color: #933;">0pt</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
-moz-transform<span style="color: #00AA00;">:</span> translate<span style="color: #00AA00;">&#40;</span><span style="color: #933;">20px</span><span style="color: #00AA00;">,</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">&#41;</span> rotate<span style="color: #00AA00;">&#40;</span>-0.291457rad<span style="color: #00AA00;">&#41;</span> skewY<span style="color: #00AA00;">&#40;</span>0.391125rad<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
-moz-transform-origin<span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span></pre></div></div>

<p><em>Note</em>: The <code>tranform-origin: top left</code> line is  important. Normally transforms happen relative to the center of  the element, but our equations assume the top left.</p>
<p><em>Note</em>: dom3d also generates code with the <code>-webkit</code>  and <code>-o</code> prefixes for WebKit and Opera support.</p>
<p>You can view the <a href="https://github.com/jlongster/dom3d/blob/master/renderer_css.js#L79">    implementation of these  equations</a>. It turns out that these equations work for any triangle, as long  as the points given are in counter-clockwise order, which is  standard in the graphics world.</p>
<h3>Taking it all the way</h3>
<p>Since we can project a 3D triangle into 2D space and render it  with CSS, all we have to do now is apply that to several 3D  triangles to form a 3D object!</p>
<p>  We need some 3D data at this point. I used Blender to export a  teapot into the simple OBJ file format and  <a href="https://github.com/jlongster/dom3d/blob/master/mesh/dump-vertices.scm">wrote a script</a> to dump the  <a href="https://github.com/jlongster/dom3d/blob/master/teapot.js">data  as JavaScript</a>. Rendering all those triangles with this technique  produces the following:</p>
<p><iframe id="teapot" style="width: 100%; height: 300px" src="http://jsfiddle.net/jlongster/BmyQD/9/embedded/"></iframe></p>
<p>Teapot! However, we can do much better. A big part of the 3D  effect is <em>shading</em>. If we calculate normals, a vector  representing where the triangle is facing, and specify a light  direction, we can take the dot product of the normal and light  for each triangle to get  <a href="http://en.wikipedia.org/wiki/Shading#Flat_vs_smooth_shading">flat shading</a>. View   <a href="https://github.com/jlongster/dom3d/blob/master/renderer.js#L69">the code for flat shading</a>.</p>
<p><iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/jlongster/avzaJ/2/embedded/"></iframe></p>
<p>There are many tweaks that take this even further. For example,  the above objects have z-indexing enabled. Without this, a  triangle that is supposed to be behind another may actually  appear on top because it was rendered  later. The dom3d uses a  <a href="https://github.com/jlongster/dom3d/blob/e892597fc020fe18a766/heap.js">heap</a> to render the triangles from  <a href="https://github.com/jlongster/dom3d/blob/e892597fc020fe18a766/dom3d.js#L61">back to front</a>.</p>
<p>Real-time animation can be achieved with a setTimeout or requestAnimationFrame function that continually renders the object. The dom3d supports the scale,  translate, yaw, and pitch transformations, but there&#8217;s nothing  stopping you from modifying the object data however you like  between renderings. See some examples over at  the <a href="http://jlongster.com/s/dom3d/">dom3d website</a>.</p>
<p>Here is the code which renders  the <a href="http://jlongster.com/s/dom3d/example3.html">teapot  animation</a> with dom3d:</p>
<p><iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/jlongster/24fK3/2/embedded/"></iframe>
<p>  It&#8217;s more appropriate for webpages to update an animation in  response to user interaction instead of constantly rendering and  hogging the CPU. See  the <a href="http://jlongster.com/s/dom3d/example.html">pole  example</a> on the dom3d site for an example.</p>
<h2>Improvements and last thoughts</h2>
<p>The most interesting possibility with this is to include actual  page elements as part of 3D objects. A navigation item could pop  out and swirl around in 3d space, and the nav item is seamlessly  transformed along with it.</p>
<p>That&#8217;s where this hack starts to show its faults, though. Unfortunately this is a little too hacky to provide an  appropriate web experience. Because it tricks DIVs into fake  triangles, it removes the possibility of integrating any page  elements with it. With the coming  of <a href="http://www.w3.org/TR/css3-3d-transforms/">3D CSS  transforms</a> though, we can start building true 3D objects  made up of any kind of page elements. The only restriction with  3D transforms is that the 3D objects need to built with  rectangles instead of triangles.</p>
<p>Other people have already experimented with 3D transforms, like  <a href="http://cubiq.org/building-a-pure-css-3d-city">building  a pure CSS 3D city</a>. There&#8217;s another cool library,  <a href="http://minimal.be/lab/Sprite3D/">Sprite3D</a>, which  provides a JavaScript API for building basic 3d objects from  page elements.</p>
<p>The most glaring problem with dom3d is the seams in the object, which appear in all browsers. Apparently there are a few bugs in  rendering engines when stressing their CSS3 transforms and using  linear-gradients!</p>
<p>The dom3d library provides an API to work with all of this, but is hasn&#8217;t  been documented very well yet. Feel free to browse the README  and <a href="http://github.com/jlongster/dom3d">code on github</a>. These APIs could be improved as well. It also  provides an SVG rendering backend,  <a href="https://github.com/jlongster/dom3d/blob/master/renderer_raphael.js">seen  here</a>, but I don&#8217;t this is the right direction to take. We  should focus on building basic 3D objects with page elements.</p>
<p>  This was a fun experiment and I&#8217;m excited by how fast and  capable browsers are becoming. The web is an exciting platform  and getting richer and more powerful every year!</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/08/rendering-3d-with-css-and-javascript-with-dom3d-guest-post/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Congratulations to our June Dev Derby winners!</title>
		<link>http://hacks.mozilla.org/2011/07/congratulations-to-our-june-dev-derby-winners/</link>
		<comments>http://hacks.mozilla.org/2011/07/congratulations-to-our-june-dev-derby-winners/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 22:41:24 +0000</pubDate>
		<dc:creator>Jay Patel</dc:creator>
				<category><![CDATA[Challenge]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Demo Studio]]></category>
		<category><![CDATA[Dev Derby]]></category>
		<category><![CDATA[Featured Article]]></category>
		<category><![CDATA[Web Developers]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=8786</guid>
		<description><![CDATA[We kicked off our series of monthly developer challenges in June to see what Web developers could do with CSS3 Animations. Our first ever Dev Derby was a huge success with almost 30 entries and a variety of demos that brought action to the Web without JavaScript. The results have been awesome! Early fan favorites [...]]]></description>
			<content:encoded><![CDATA[<p>We kicked off our <a href="http://hacks.mozilla.org/2011/06/dev-derby-a-monthly-competition-of-demos-using-open-technologies/">series of monthly developer challenges</a> in June to see what Web developers could do with CSS3 Animations.  Our <a href="https://developer.mozilla.org/en-US/demos/devderby/2011/june/">first ever Dev Derby</a> was a huge success with almost 30 entries and a variety of demos that brought action to the Web without JavaScript.  The results have been awesome!</p>
<p><a href="https://developer.mozilla.org/en-US/demos/devderby/2011/june/" rel="June Dev Derby"><img BORDER=0 src="http://hacks.mozilla.org/wp-content/uploads/2011/07/logo-devderby.png" alt="" title="logo-devderby" width="335" height="96" class="aligncenter size-full wp-image-8841" /></a></p>
<p>Early fan favorites included <a href="https://developer.mozilla.org/en-US/demos/detail/rofox-css3-animation-by-anthony-calzadilla">Rofox CSS3</a> and <a href="https://developer.mozilla.org/en-US/demos/detail/css-nyan-cat">CSS Nyan Cat</a>, which remain among the most viewed on <a href="https://developer.mozilla.org/en-US/demos/">Demo Studio</a>.</p>
<p>While all the demos were amazing, we had a tough task in narrowing down the submissions to 5 finalists based on our judging criteria. After careful review and feedback, the following demos surfaced as candidates for our final round of voting:</p>
<p><a href="https://developer.mozilla.org/en-US/demos/detail/animated-menu-icons">Animated menu icons</a><br />
<a href="https://developer.mozilla.org/en-US/demos/detail/auto-run-photo-album">Auto-run photo album</a><br />
<a href="https://developer.mozilla.org/en-US/demos/detail/battlefield-css3">BATTLEFIELD CSS3</a><br />
<a href="https://developer.mozilla.org/en-US/demos/detail/css-tricks">CSS Tricks</a><br />
<a href="https://developer.mozilla.org/en-US/demos/detail/plan-b-retro-demo">Plan B &#8211; Retro Demo</a></p>
<p>With those 5 demos left in the running, we brought in our expert judges and a few members of the Mozilla team to vote on the finalists. Judges rated each demo on a scale of 1 &#8211; 5 across the following dimensions:</p>
<ul>
<li><strong>Technology</strong> – Does the demo showcase the power of open Web technologies?</li>
<li><strong>Originality</strong> – How innovative and unique is the demo?</li>
<li><strong>Aesthetics</strong> – How good is the visual design and interaction experience?</li>
<li><strong>Practicality</strong> – How useful is this demo in enhancing the Web today?</li>
</ul>
<p>It was a close race and we&#8217;re excited to announce that the winners of the June Dev Derby are:</p>
<p><a href="https://developer.mozilla.org/en-US/demos/devderby/2011/june/" rel="July Dev Derby"><img src="http://hacks.mozilla.org/wp-content/uploads/2011/07/junederbywinners-500x162.png" alt="" title="junederbywinners" width="500" height="162" class="aligncenter size-large wp-image-8838" /></a></p>
<p><strong>1st Place:</strong> <a href="https://developer.mozilla.org/en-US/demos/detail/css-tricks">CSS Tricks</a> by Mircea Piturca.<br />
<strong>2nd Place:</strong> <a href="https://developer.mozilla.org/en-US/demos/detail/animated-menu-icons">Animated menu icons</a> by Koen Hendrix.<br />
<strong>3rd Place:</strong> <a href="https://developer.mozilla.org/en-US/demos/detail/plan-b-retro-demo">Plan B &#8211; Retro Demo</a> by matt64.</p>
<p><strong>Runners-up:</strong><br />
<a href="https://developer.mozilla.org/en-US/demos/detail/auto-run-photo-album">Auto-run photo album</a><br />
<a href="https://developer.mozilla.org/en-US/demos/detail/battlefield-css3">BATTLEFIELD CSS3</a></p>
<p>Thanks to everyone that submitted their awesome demos for the June Dev Derby.  Up next we have <a href="https://developer.mozilla.org/En/Using_audio_and_video_in_Firefox">HTML5 video</a> for July, <a href="https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history">History API</a> for August and <a href="https://developer.mozilla.org/en/Using_geolocation">Geolocation</a> for September.  We look forward to seeing even more great submissions for <a href="https://developer.mozilla.org/en-US/demos/devderby">July and beyond</a>!   Hack on.</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/07/congratulations-to-our-june-dev-derby-winners/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HTML5 and CSS3: Exploring Mobile Possibilities &#8211; presentation at London Ajax Mobile Event</title>
		<link>http://hacks.mozilla.org/2011/07/html5-and-css3-exploring-mobile-possibilities-presentation-at-london-ajax-mobile-event/</link>
		<comments>http://hacks.mozilla.org/2011/07/html5-and-css3-exploring-mobile-possibilities-presentation-at-london-ajax-mobile-event/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 13:36:56 +0000</pubDate>
		<dc:creator>Robert Nyman</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Geolocation]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=8727</guid>
		<description><![CDATA[In the beginning of July, I was attending and giving a presentation at the London Ajax Mobile Event about possibilities offered by HTML5 and CSS3 when it comes to developing mobile web sites and applications. Short introduction of me Being my first post here at Mozilla Hacks, I thought I&#8217;d start by briefly introducing myself [...]]]></description>
			<content:encoded><![CDATA[<p>In the beginning of July, I was attending and giving a presentation at the <a href="http://lanyrd.com/2011/londonajaxmobile/">London Ajax Mobile Event</a> about possibilities offered by HTML5 and <a href="https://developer.mozilla.org/en/CSS">CSS3</a> when it comes to developing mobile web sites and applications. </p>
<h3>Short introduction of me</h3>
<p>Being my first post here at Mozilla Hacks, I thought I&#8217;d start by briefly introducing myself first: My name is Robert Nyman and I&#8217;ve recently joined Mozilla as a Technical Evangelist, talking about HTML5, the Open Web and how we can help web developers. I&#8217;ve been working since 1999 with Front End development for the web, and I regularly blog at <a href="http://robertnyman.com">http://robertnyman.com</a>, tweet as <a href="http://twitter.com/#!/robertnyman">@robertnyman</a> and love to travel and meet people!</p>
<h3>The London Ajax Mobile Event</h3>
<p>The conference took place at the Vodafone headquarters in London, arranged by Sitepen CEO and Dojo co-founder Dylan Schiemann. It was packed to the brim with speakers, from early morning raging on into the night. Various talks were given on a number of topics &#8211; from mobile apps and implementations to a more experimenting approach and future visions.</p>
<h3>My presentation</h3>
<p>You can see the slides from my HTML5 and CSS3: Exploring Mobile Possibilities below or <a href="http://www.slideshare.net/robnyman/html5-and-css3-exploring-mobile-possibilities-london-ajax-mobile-event">download the slides at SlideShare</a></p>
<p><iframe style="border:none;width:510px;height:425px;" src="http://icant.co.uk/slidesharehtml/embed.php?url=http://www.slideshare.net/robnyman/html5-and-css3-exploring-mobile-possibilities-london-ajax-mobile-event&amp;width=460&amp;current=1"></iframe></p>
<p>The aim of my talk was to give both an introduction and reiterate on some of the important options we have when developing web sites, especially when it comes to the mobile world. With the CSS3 field I covered <a href="https://developer.mozilla.org/en/CSS/media_queries">CSS Media Queries</a> and <a href="https://developer.mozilla.org/en/CSS/box-flex">Flex Box</a> and the options they give us in creating more flexible layouts and presentation alternatives. I also spoke about <a href="https://developer.mozilla.org/en/CSS/CSS_transitions">CSS Transitions</a> and <a href="https://developer.mozilla.org/en/CSS/CSS_animations">Animations</a> and how they can assist in an easy manner to get nice effects, that are also hardware-accelerated on certain devices.</p>
<p>When it comes to the HTML5 part, I&#8217;m excited by all the new <a href="https://developer.mozilla.org/en/HTML/HTML5/Forms_in_HTML5">HTML5 form elements</a> and how they can improve both user experience and the input of data. As support grows for this in web browsers, I believe it will make things a lot easier for both developers and end users.</p>
<p>I briefly touched on link protocols, such as tel: and sms:, to trigger mobile-specific actions when activating a link, and then various useful APIs such as <a href="https://developer.mozilla.org/en/dom/storage">Web Storage</a>, <a href="https://developer.mozilla.org/en/offline_resources_in_firefox">Offline Applications</a>, <a href="https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history">History API</a> and <a href="https://developer.mozilla.org/en/Using_geolocation">Geolocation</a> (not all necessary official HTML5 APIs, but usually used in conjunction with them).</p>
<p>I ended the talk with touching on tool such as Steve Souders&#8217; <a href="http://stevesouders.com/mobileperf/mobileperfbkm.php">Mobile Perf bookmarklet</a> and <a href="http://pmuellr.github.com/weinre/">weinre</a>, for remote debugging on mobile devices.</p>
<h3>You and mobile</h3>
<p>What I am interested in is if you are developing for a multitude of mobile and other devices, what you believe are the biggest obstacles as well as the most promising options. Any thoughts, please let me know!</p>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/07/html5-and-css3-exploring-mobile-possibilities-presentation-at-london-ajax-mobile-event/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Aurora 7 is here</title>
		<link>http://hacks.mozilla.org/2011/07/aurora7/</link>
		<comments>http://hacks.mozilla.org/2011/07/aurora7/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 19:32:18 +0000</pubDate>
		<dc:creator>louisremi</dc:creator>
				<category><![CDATA[Aurora]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://hacks.mozilla.org/?p=8618</guid>
		<description><![CDATA[Keeping up the pace with our new development cycle, today we release Aurora 7. Enjoy its new features and performance improvements: CSS &#8220;text-overflow: ellipsis&#8220;, Navigation Timing API, reduced memory usage, a faster javascript parser, and the first steps of Azure, our new graphics API. text-overflow: ellipsis; It is now possible to get Firefox to display [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_7968" class="wp-caption alignright" style="width: 85px"><a href="http://firefox.com/channel"><img class="size-full wp-image-7968" title="Download Aurora" src="http://hacks.mozilla.org/wp-content/uploads/2011/04/75px-Aurora210.png" alt="Aurora Logo" width="75" height="75" /></a><p class="wp-caption-text">Download Aurora</p></div>
<p><em>Keeping up the pace with our new development cycle, today we release <a href="http://firefox.com/channel">Aurora 7</a>. Enjoy its new features and performance improvements: CSS &#8220;<strong>text-overflow: ellipsis</strong>&#8220;, <strong>Navigation Timing</strong> API, <strong>reduced memory usage</strong>, a <strong>faster javascript parser</strong>, and the <strong>first steps of Azure</strong>, our new graphics API.</em></p>
<h3>text-overflow: ellipsis;</h3>
<p>It is now possible to get Firefox to display &#8220;<strong>…</strong>&#8221; to give a visual clue that a text is longer than the element containing it.<br />
<script type="text/javascript" src="https://gist.github.com/1063258.js?file=ellipsis.css"></script></p>
<p style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-style: italic; background: #fdfee7; border: 1px solid #dedede;">At last, with <em style="font-style: normal;">text-overflow</em> implemented in Aurora 7 it&#8217;s now possible to create a cross-browser ellipsis!</p>
<h3>Navigation Timing</h3>
<p>Performance is a key parameter of the user experience on the Web. To help Web developers monitor efficiently the performance of their Web pages, Aurora 7 implements the <a href="http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html">Navigation Timing</a> specification: using the <code>window.performance.timing</code> object, developers will be able to know the time when different navigation steps (such as <code>navigationStart</code>, <code>connectStart</code>/<code>End</code>, <code>responseStart</code>/<code>End</code>, <code>domLoading</code>/<code>Complete</code>) happened and deduce how long one step or a sequence of steps took to complete.</p>
<h3>Reduced Memory Usage</h3>
<p>Our continuous efforts to monitor and reduce memory consumption in Firefox will substantially pay off with Aurora 7:</p>
<ul>
<li>The memory &#8220;zone&#8221; where javascript objects reside gets fragmented as objects are created and deleted. To reduce the negative impact of this fragmentation, long-lived objects created by the browser&#8217;s own UI have been separated from the objects created by Web pages. The browser can now free memory more efficiently when a tab is closed or after a <a href="http://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29">garbage collection</a>.</li>
<li>Speaking of garbage collection, as we successfully reduced the cost of this operation, we are able to execute it more often. Not only is memory freed more rapidly, but this also leads to shorter <em>GC pauses</em>(the period where javascript execution stops to let the garbage collector do his job, which is sometime noticeable during heavy animations).</li>
<li>All those improvements are reflected in the about:memory page, which is now able to tell how much memory a particular Web page or the browser&#8217;s own UI, is using.</li>
</ul>
<p>More frequent updates and detailed explanations of the <em>memshrink</em> effort are posted on <a href="http://blog.mozilla.com/nnethercote/">Nicholas Nethercote&#8217;s blog.</a></p>
<h3>Faster Javascript Parsing</h3>
<p>A javascript <strong>parser</strong> is the part of the browser that reads the javascript before it gets executed by the javascript <strong>engine</strong>. With modern Web applications such as Gmail or Facebook sending close to 1Mb of javascript, being able to still read all of that code instantly matters in the quest of responsive user experience.<br />
Thanks to <a href="http://blog.mozilla.com/nnethercote/2011/07/01/faster-javascript-parsing/">Nicholas&#8217;s work</a>, our parser is now almost twice as fast as it used to. This adds up well with our constant work to improve the <a href="http://arewefastyet.com">execution speed</a> of our javascript engine.</p>
<h3>First Steps of Azure</h3>
<p>After the <strong>layout engine</strong> (Gecko) has computed the visual appearance (position, dimension, colors, …) of all elements in the window, the browser <em>asks</em> the Operating System to actually draw them on the screen. The browser needs an abstraction layer to be able to <em>talk</em> to the different graphics libraries of the different OSes, but this layer has to be as thin and as adaptable as possible to deliver the promises of hardware acceleration.<br />
<em>Azure</em> is the name of the new and better <strong>graphics API</strong>/abstraction layer that is going to gradually replace Cairo in hardware accelerated environments. In Aurora 7, it is already able to interact with Windows 7&#8242;s Direct2D API to render the content of a &lt;canvas&gt; element (in a 2D context). You can read a detailed explanation of <a href="http://blog.mozilla.com/joe/2011/04/26/introducing-the-azure-project/">the Azure project and its next steps</a> on Joe Drew&#8217;s blog.</p>
<h3>Other Improvements</h3>
<div class="changelog">
<h4>HTML</h4>
<ul>
<li>The <code><a href="https://developer.mozilla.org/en/DOM/HTMLHeadElement" rel="custom nofollow">HTMLHeadElement</a></code> <code>profile</code> property has been removed, this property has been deprecated since Gecko 2.0. (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=664544" rel="external"> bug 664544</a> )</li>
<li>The <code><a href="https://developer.mozilla.org/en/DOM/HTMLImageElement" rel="custom nofollow">HTMLImageElement</a></code> <code>x</code> and <code>y</code> properties have been removed. (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=587021" rel="external"> bug 587021</a> )</li>
<li>The <code><a href="https://developer.mozilla.org/en/DOM/HTMLSelectElement" rel="custom nofollow">HTMLSelectElement</a></code> <code>add()</code> method <code>before</code> parameter is now optional. (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=182279" rel="external"> bug 182279</a> )</li>
</ul>
</div>
<div class="changelog">
<h4>Canvas</h4>
<ul>
<li>Specifying invalid values when calling <code>setTransform()</code>, <code>bezierCurveTo()</code>, or <code>arcTo()</code> no longer throws an exception; these calls are now correctly silently ignored.</li>
<li>Calling <code>strokeRect</code> with a zero width and height now correctly does nothing. (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=663190" rel="external"> bug 663190</a> )</li>
<li>Calling <code>drawImage</code> with a zero width or height <code><a href="https://developer.mozilla.org/en/HTML/Element/canvas" rel="custom nofollow">&lt;canvas&gt;</a></code> now throws <code>INVALID_STATE_ERR</code>. (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=663194" rel="external"> bug 663194</a> )</li>
<li><code>toDataURL()</code> method now accepts a second argument to control JPEG quality (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=564388" rel="external"> bug 564388</a> )</li>
</ul>
</div>
<div class="changelog">
<h3>CSS</h3>
<ul>
<li><code><a href="https://developer.mozilla.org/en/CSS/text-overflow" rel="custom nofollow">text-overflow</a></code> is now supported.</li>
<li>The <code><a href="https://developer.mozilla.org/en/CSS/orient" rel="custom nofollow">-moz-orient</a></code> property has been fixed so that <code><a href="https://developer.mozilla.org/en/HTML/Element/progress" rel="custom nofollow">&lt;progress&gt;</a></code> elements that are vertically oriented have appropriate default dimensions.</li>
</ul>
</div>
<div class="changelog">
<h3>MathML</h3>
<ul>
<li>XLink href has been restored and the MathML3 <code>href</code> attribute is now supported. Developers are encouraged to move to the latter syntax.</li>
<li>Support for the <code>voffset</code> attribute on <code><a href="https://developer.mozilla.org/en/MathML/Element/mpadded" rel="custom nofollow">&lt;mpadded&gt;</a></code> elements has been added and behavior of <code>lspace</code> attribute has been fixed.</li>
<li>The top-level <code><a href="https://developer.mozilla.org/en/MathML/Element/math" rel="custom nofollow">&lt;math&gt;</a></code> element accepts any attributes of the <code><a href="https://developer.mozilla.org/en/MathML/Element/mstyle" rel="custom nofollow">&lt;mstyle&gt;</a></code> element.</li>
<li>The <code>medium</code> line thickness of fraction bars in <code><a href="https://developer.mozilla.org/en/MathML/Element/mfrac" rel="custom nofollow">&lt;mfrac&gt;</a></code> elements has been corrected to match the default thickness.</li>
<li><a href="https://developer.mozilla.org/en/MathML/Attributes/Values#Constants_%28namedspaces%29" rel="internal">Names for negative spaces</a> are now supported.</li>
</ul>
</div>
<div class="changelog">
<h3>DOM</h3>
<ul>
<li>The <code><a href="https://developer.mozilla.org/en/DOM/File" rel="custom nofollow">File</a></code> interface&#8217;s non-standard methods <code>getAsBinary()</code>, <code>getAsDataURL()</code>, and <code>getAsText()</code> have been removed as well as the non-standard properties <code>fileName</code> and <code>fileSize</code>.</li>
<li>The <code><a href="https://developer.mozilla.org/en/DOM/FileReader" rel="custom nofollow">FileReader</a></code> <code>readAsArrayBuffer()</code> method is now implemented. (see <a title="Unable to access bug's page. Try reloading this page to see bug's status and summary in this tooltip." href="https://bugzilla.mozilla.org/show_bug.cgi?id=632255" rel="external"> bug 632255</a> )</li>
<li><code><a href="https://developer.mozilla.org/en/DOM/document.createEntityReference" rel="custom nofollow">document.createEntityReference</a></code> has been removed. It was never properly implemented and is not implemented in most other browsers. (see <a title="Unable to access bug's page. Try reloading this page to see bug's status and summary in this tooltip." href="https://bugzilla.mozilla.org/show_bug.cgi?id=611983" rel="external"> bug 611983</a> )</li>
<li><code>document.normalizeDocument</code> has been removed. Use <code><a href="https://developer.mozilla.org/en/DOM/Node.normalize" rel="custom nofollow">Node.normalize</a></code> instead. (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=641190" rel="external"> bug 641190</a> )</li>
<li><code><a href="https://developer.mozilla.org/en/DOM/DOMTokenList.item" rel="external">DOMTokenList.item</a></code> now returns <code>undefined</code> if the <code>index</code> is out of bounds, previously it returned <code>null</code>. (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=529328" rel="external"> bug 529328</a> )</li>
<li><code>Node.getFeature</code> has been removed. (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=659053" rel="external"> bug 659053</a> )</li>
</ul>
</div>
<div class="changelog">
<h3>JavaScript</h3>
<ul>
<li>The <code><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/arity" rel="internal">Function.arity()</a></code> function has been removed; use <code><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/length" rel="internal">Function.length</a></code> instead.</li>
<li>The JSON parser has been re-written for improved speed and compliance. This includes a fix for <a title="Unable to access bug's page. Try reloading this page to see bug's status and summary in this tooltip." href="https://bugzilla.mozilla.org/show_bug.cgi?id=572279" rel="external"> bug 572279</a> .</li>
</ul>
</div>
<div class="changelog">
<h3>Net</h3>
<ul>
<li><code>WebSockets</code> are now available on Firefox Mobile. (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=537787" rel="external"> bug 537787</a> )</li>
</ul>
</div>
<div class="changelog">
<h3>console API</h3>
<ul>
<li>Implement <code>console.<a href="http://getfirebug.com/wiki/index.php/Console_API#console.dir.28object.29">dir()</a></code>, <code>console.<a href="http://getfirebug.com/wiki/index.php/Console_API#console.time.28name.29">time()</a></code>, <code>console.<a href="http://getfirebug.com/wiki/index.php/Console_API#console.timeEnd.28name.29">timeEnd()</a></code>, <code>console.<a href="http://getfirebug.com/wiki/index.php/Console_API#console.group.28object.5B.2C_object.2C_....5D.29">group()</a></code> and <code>console.<a href="http://getfirebug.com/wiki/index.php/Console_API#console.groupEnd.28.29">groupEnd()</a></code> methods.</li>
<li>Message logged with console.log before the WebConsole is opened are now stored and displayed once the WebConsole is opened.</li>
</ul>
<p>(see the <a href="https://wiki.mozilla.org/DevTools/Features/WebConsole7">Web Console</a> page in the Wiki)</p>
</div>
<div class="changelog">
<h3>Web Timing</h3>
<ul>
<li>Initial implementation of the <a href="dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html">Navigation Timing</a> specification (see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=570341">570341</a>).</li>
</ul>
</div>
<style>
h4 {margin-bottom: 10px}
.changelog:nth-of-type(odd) { background-color: #F2F2F2; }
.changelog:nth-of-type(even) { background-color: #FEF8E7; }
.changelog {    border: 1px solid rgb(217, 217, 217);    padding: 4px; } .changelog:not(:last-of-type) { border-bottom: none; }
#content-main .wp-caption-text { font-size: .7em;}
.gist { font-size: .8em; }
.gist-meta { font-size: .6em !important; }
.gist-file { margin: 0 !important; }
.code {font-size: .8em; background: #F8F8FF; border: 1px solid #DEDEDE; }
</style>
]]></content:encoded>
			<wfw:commentRss>http://hacks.mozilla.org/2011/07/aurora7/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
	</channel>
</rss>

