<?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/"
	>

<channel>
	<title>Mozilla Webdev</title>
	<atom:link href="http://blog.mozilla.com/webdev/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mozilla.com/webdev</link>
	<description>Mozilla Web Development Blog</description>
	<pubDate>Fri, 03 Jul 2009 03:44:41 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Improving Accessibility Through ARIA</title>
		<link>http://blog.mozilla.com/webdev/2009/07/02/improving-accessibility-through-aria/</link>
		<comments>http://blog.mozilla.com/webdev/2009/07/02/improving-accessibility-through-aria/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 03:43:41 +0000</pubDate>
		<dc:creator>rdoherty</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/webdev/?p=496</guid>
		<description><![CDATA[Accessibility is a pretty hairy issue in web development. When attempting to determine if your site is accessible, there are so many standards and recommendations to follow. 508, WCAG, WCAG 2.0, WAI Priority 1, 2 &#038; 3. 
Well, now there is a new standard from the W3C called WAI-ARIA (Web Accessibility Initiative - Accessible Rich [...]]]></description>
			<content:encoded><![CDATA[<p>Accessibility is a pretty hairy issue in web development. When attempting to determine if your site is accessible, there are so many standards and recommendations to follow. 508, WCAG, WCAG 2.0, WAI Priority 1, 2 &#038; 3. </p>
<p>Well, now there is a new standard from the W3C called <a href="http://www.w3.org/TR/wai-aria/">WAI-ARIA</a> (Web Accessibility Initiative - Accessible Rich Internet Applications)</p>
<p>The simplest definition of ARIA is adding UI semantics via HTML element attributes. Simply, you add things like &#8216;<code>&lt;div role="nav"&gt;</code>&#8216; or &#8216;<code>&lt;form role="search"&gt;</code>&#8216; to specific HTML elements to give screen readers a better understanding of your content.</p>
<p>The ARIA spec is huge (160 pages), so I won&#8217;t go over every part of it in detail. The four areas I will focus on are landmarks, required, invalid and live regions.</p>
<h3>ARIA Landmarks</h3>
<p>Today, when a blind user encounters a website, navigation between elements of the page can be difficult because there is no established method of marking areas of the page as navigation, content, footer, etc. Luckily with ARIA, we can.</p>
<p>Here&#8217;s some example markup of a typical webpage:</p>
<p><pre>
&lt;div id="header"&gt;
    &lt;h1&gt;My Awesome Website&lt;/h1&gt;
    &lt;form&gt; &lt;/form&gt;
&lt;/div&gt;
&lt;div id="content"&gt;
    &lt;ul id="nav"&gt;&lt;/ul&gt;
    My website rocks!
&lt;/div&gt;
&lt;div id="footer"&gt;&lt;/div&gt;
</pre>
</p>
<p>And here&#8217;s what it looks like with ARIA Landmarks:</p>
<p><pre>
&lt;div id="header" role="banner"&gt;
    &lt;h1&gt;My Awesome Website&lt;/h1&gt;
    &lt;form role="search"&gt; &lt;/form&gt;
&lt;/div&gt;
&lt;div id="content" role="main"&gt;
    &lt;ul id="nav" role="navigation"&gt;&lt;/ul&gt;
    My website rocks!
&lt;/div&gt;
&lt;div id="footer"&gt;&lt;/div&gt;
</pre>
</p>
<p>What I&#8217;ve done is add ARIA roles to certain parts of the page (header, nav, search form, primary content). Because the roles are a defined spec, screen readers can parse the page for roles and allow a user to jump to each part without having to navigate through all the content. </p>
<h3>ARIA Required &#038; Invalid</h3>
<p>Another part of the ARIA spec is the attribute &#8216;aria-required&#8217; and &#8216;aria-invalid&#8217;. These attributes are for communicating to screen readers that a particular form field is required and/or invalid without requiring the user to look for asterisks or other text near the field. The screen reader would alert the user to this information. Here&#8217;s an example:</p>
<p><pre>
&lt;form id="searchform" role="search"&gt;
      &lt;p class="error"&gt;You did not enter a search term&lt;/p&gt;
      &lt;input name="query" value="" aria-required="true" aria-invalid="true" /&gt;
&lt;/form&gt;
 </pre>
<p>The above code has the &#8216;aria-required&#8217; and &#8216;aria-invalid&#8217; attributes set to true. When a screen reader encounters this code, it will read aloud &#8216;required&#8217; and &#8216;invalid&#8217;. This is a <strong>lot</strong> simpler for a user than attempting to find error messages and/or asterisks in the page.</p>
<h3>ARIA Live</h3>
<p>A particularly difficult area of accessibility is dealing with AJAX. How can you communicate to a screen reader that content is loading or has changed? Thankfully, with ARAI Live Regions, it is quite simple. Here&#8217;s an example:</p>
<pre>
    &lt;div id="sidecontent" aria-live="polite"&gt; AJAX content goes here... &lt;div&gt;
</pre>
<p>Adding the &#8216;aria-live&#8217; attribute to an element alerts a screen reader that content will change in this region and to read it aloud when it does. The aria-live attribute has &#8216;politeness&#8217; levels, which allow you to specify how polite the updates should be. The four levels are </p>
<ul>
<li><strong>off</strong> - updates are not communicated</li>
<li><strong>polite</strong> - notify of changes only when the user is not doing anything</li>
<li><strong>assertive</strong> - announce as soon as possible, but not interrupting the user</li>
<li><strong>rude</strong> - which will be read aloud immediately</li>
</ul>
<p>The various levels of politeness allow for different situations where users would need to be notified immediately of important information or for content that is not as important.</p>
<h3>Summary</h3>
<p>This is just a quick overview of ARIA and its uses, but I&#8217;m really excited about the possibilities it creates. We can communicate the intent of our content much more explicitly. There&#8217;s also a lot of other aspects to ARIA including widgets (slider, checkbox), application structure (alerts, log, progressbar) and document structure (article, grid, definition) that are exciting.</p>
<h3>Further Reading</h3>
<ul>
<li><a href="http://dev.opera.com/articles/view/introduction-to-wai-aria/">Longer ARIA overview</a></li>
<li><a href="http://www.w3.org/TR/wai-aria/">ARIA Spec</a></li>
<li><a href="http://yuiblog.com/blog/2008/12/30/configuring-screen-readers/">Setting up a screen reader</a></li>
<li><a href="http://video.yahoo.com/watch/4073211/10996186">Accessible widgets with ARIA</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/webdev/2009/07/02/improving-accessibility-through-aria/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Use Sprites Wisely</title>
		<link>http://blog.mozilla.com/webdev/2009/06/22/use-sprites-wisely/</link>
		<comments>http://blog.mozilla.com/webdev/2009/06/22/use-sprites-wisely/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 21:10:24 +0000</pubDate>
		<dc:creator>morgamic</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[css]]></category>

		<category><![CDATA[performance]]></category>

		<category><![CDATA[sprites]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/webdev/?p=493</guid>
		<description><![CDATA[Vlad has good points about proper use of CSS sprites in his recent post on the subject as well as his comments on Ryan&#8217;s post.
In short, even the simplest sprite images can eat up massive amounts of system memory &#8212; 50MB to even 100MB per page or more.  Perceived speed for your site is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.vlad1.com/">Vlad</a> has good points about proper use of <a href="http://www.stevesouders.com/spriteme/">CSS sprites</a> in <a href="http://blog.vlad1.com/2009/06/22/to-sprite-or-not-to-sprite/">his recent post on the subject</a> as well as <a href="http://blog.mozilla.com/webdev/2009/03/27/css-spriting-tips/?lolzor#comment-193484">his comments on Ryan&#8217;s post</a>.</p>
<p>In short, even the simplest sprite images can eat up massive amounts of system memory &#8212; 50MB to even 100MB per page or more.  Perceived speed for your site is important but you should always be concerned about how sprites and other hacks can affect user experience.</p>
<p>More info:</p>
<ul>
<li><a href="http://blog.mozilla.com/rob-sayre/2009/06/22/sprites/">Rob Sayre - Sprites</a></li>
<li><a href="http://blog.vlad1.com/2009/06/22/to-sprite-or-not-to-sprite/">Vladimir Vukićević - To Sprite Or Not To Sprite</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/webdev/2009/06/22/use-sprites-wisely/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Announcing Mozilla Service Week</title>
		<link>http://blog.mozilla.com/webdev/2009/06/15/announcing-mozilla-service-week/</link>
		<comments>http://blog.mozilla.com/webdev/2009/06/15/announcing-mozilla-service-week/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 23:37:48 +0000</pubDate>
		<dc:creator>ozten</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/webdev/?p=459</guid>
		<description><![CDATA[We are excited to announce the release of Mozilla Service Week. It is a new website for our community that aims to:

Promote technology related volunteering between Mozillians and their local communities
Promote idealist.org and other existing websites that make it easier to connect and change your world
Inspire your participation during Sept 14-21 through pledges and stories


Start [...]]]></description>
			<content:encoded><![CDATA[<p>We are excited to announce the release of <a href="http://mozillaservice.org">Mozilla Service Week</a>. It is a new website for our community that aims to:</p>
<ul>
<li>Promote technology related volunteering between Mozillians and their local communities</li>
<li>Promote <a href="http://www.idealist.org/if/mozservice09/en/AdvancedSearch/VolunteerOpportunity/default">idealist.org</a> and other existing websites that make it easier to connect and change your world</li>
<li>Inspire your participation during Sept 14-21 through pledges and stories</li>
</ul>
<p><img src="http://blog.mozilla.com/webdev/files/2009/06/mozservice-screen-sm21.jpg" width="500" height="316" alt="Screenshot of Mozilla Service Week" /></p>
<h2>Start today</h2>
<p><a href="http://mozillaservice.org">Check it out</a> and pledge some hours. You can <a href="http://mozillaservice.org/tell_us/your_pledge/en_US">refine your pledge</a> over time. Be sure to tag your various items with <code>mozservice09</code>.</p>
<p>Mozillians have many “hi-tech” skills that they may not realize are valuable outside of our community. You don&#8217;t have to be a Firefox code contributor to do tech volunteering. You can help configuring routers, helping people setup a Wordpress blog, or teach a workshop on using social networks to promote causes. Anything from writing copy, doing data entry, or simply helping groups organize their information can make for a valuable service contribution.</p>
<p>There is a real spirit of service growing and it’s fun to chip in and Be The Difference. Cynicism is out and Participation is in!</p>
<h2>Help Us Build</h2>
<p>We’re launching early (and releasing often) to get this site into the community for early feedback. Most importantly we hope to <strong>prime the pump</strong> for volunteering opportunities. We are launching in English, but have built out <abbr title="Internationalization">i18n</abbr> support and coordinated with the L10n-drivers team.  Post Firefox 3.5, where our localizers are pouring their energy right now, we are excited to <a href="http://mozillaservice.org/tell_us/build_mozservice09/en_US">launch many locale specific versions of Mozilla Service Week</a>. Our first non-english site will probably be mitmachwoche.de (German). Many other localizers have shown excitement for mozservice09 and localizing the site.</p>
<h2>Of, for, and by the Web</h2>
<p>We’ve partnered with <a href="http://idealist.org">Idealist.org</a> for the English site to make it easy to find ways to help or to register your needs.  With the mozservice09 site, we have taken a very <strong>de-centralized</strong> strategy, hoping to take advantage of the <strong>strengths of the web</strong> itself. Outside of Idealist.org&#8217;s framework, if you want to organize a project through your blog or website for a type of service that we haven’t begun to imagine, that’s great! Mozilla Service Week introduces no heavy-weight process or centralized control.</p>
<p>Just be sure to pledge, <a href="http://mozillaservice.org/tell_us/your_stories/en_US">Tell Your Story</a> and <a href="http://mozillaservice.org/promote/mozservice09/en_US">spread the word</a>. We will feature many of these stories to inspire others to get involved.</p>
<h2>Show us the code!</h2>
<p>From a technology perspective, one interesting aspect of the site is that when you write a story, you can provide an image or video from another website. Examples include your blog, Flickr, Youtube or Vimeo. The entire website is of course open sourced and <a href="http://svn.mozilla.org/projects/mozillaservice.org/trunk/">available now</a>, but this JavaScript widget/PHP backend is available as a <a href="http://github.com/ozten/Magic-Mini-DCMS/tree/master">stand-alone library</a>. I’m looking forward to your contributions to make it smarter about finding photos and videos from your favorite websites. An example would be support for <a href="http://openvideo.dailymotion.com/us">dailymotion.com</a> which will be added to the site shortly.</p>
<h2>Credits:</h2>
<p>It’s been a wild and fun ride building the site with the core team:</p>
<ul>
<li>Mary Colvig (Marketing)</li>
<li>Jane Finette (Marketing)</li>
<li>Stephen Donner  (WebDev QA)</li>
<li>Krupa Raj (WebDev QA)</li>
<li>Jeremy Orem (IT)</li>
<li>Peter Deitz (Social Actions)</li>
<li>Austin King aka ozten (WebDev).</li>
</ul>
<p>Many People have been involved with the project so far (and I hope I don’t forget any shout-outs): In roughly chronological order, Michael Morgan provided guidance and support. Axel Hecht, Pascal Chevrel provided <abbr title="Localization">l10n</abbr> guidance with code review from Ryan Doherty and Fredrick Wenzel. Throughout the project Mark Surman and David Boswell from the Mozilla Foundation have helped us shape the vision. John Slater and The Royal Order of Design (Aaron Shimer, Tim Hogan, and Stephanie Bankhead) helped design the site and Craig Cook did an amazing job with the HTML and CSS.  Ladonna Willems pitched in on the copy. Again on the L10n front Seth Bindernagel and Wil Clouser gave input. Stas Malolepszy contributed code for rewriting our <code>gettext</code> strings. Les Orchard wrote the Activity Feeder module. Alex Buchanan and Reed Loden prepared the promotional Badges. Our new intern Raymond Agbeame did a great job testing the site. and Jeff Balogh filed some good bugs. The rest of the webdev team also gave input and support. Additionally thanks to our partners idealist.org (Juan Cruz Mones Cazon, Ami Dar), betterplace.org (Tim Benke, Matthias Pries), and of course, the <a href="http://www.socialactions.com/">SocialActions</a> team.</p>
<p>As we add more locales and partners, I look forward to volunteering with you, watching the hours pledged ticker go up, and reading your stories.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/webdev/2009/06/15/announcing-mozilla-service-week/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Socorro Moves to New Hardware</title>
		<link>http://blog.mozilla.com/webdev/2009/05/15/socorro-moves-to-new-hardware/</link>
		<comments>http://blog.mozilla.com/webdev/2009/05/15/socorro-moves-to-new-hardware/#comments</comments>
		<pubDate>Fri, 15 May 2009 20:49:58 +0000</pubDate>
		<dc:creator>K Lars Lohn</dc:creator>
		
		<category><![CDATA[Socorro]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/webdev/?p=414</guid>
		<description><![CDATA[What has two quad core 3GHz 64bit CPUs, sixteen gigs of RAM and makes the Socorro users happy?  That would be the new hardware that the Socorro system moved to during a six hour operation on Thursday night.  The new hardware was recommended by the folks from the aptly named PostgreSQL Experts, Inc [...]]]></description>
			<content:encoded><![CDATA[<p>What has two quad core 3GHz 64bit CPUs, sixteen gigs of RAM and makes the Socorro users happy?  That would be the new hardware that the Socorro system moved to during a six hour operation on Thursday night.  The new hardware was recommended by the folks from the aptly named <a href="http://pgexperts.com">PostgreSQL Experts, Inc</a> after an intense week of consultation and analysis in March earlier this year.  After auditing our existing system of hardware and software, it was apparent that we were woefully underpowered for what we were trying to do.  While simply tuning PostgreSQL helped in the interim, a more powerful platform was clearly in order.</p>
<p>Before we deployed the new hardware, we had to take several steps to tame our voracious use of disk space.  In the previous week, we removed the archived dumps from the database.  They were rarely ever accessed but took up the lion&#8217;s share of our disk space.  By migrating them to file system storage, we made a three hundred gig database migration onto new hardware into a migration of only sixty gig.  </p>
<p>While there may be a need for tuning over the next week, Socorro users should have a much accelerated experience using the Socorro Web site.</p>
<p>Many thanks to <em>aravind</em> for shepherding this project through IT, <em>chizu</em> in IT for his ﻿db cloning/replication scripting/tweaking and <em>jberkus</em> from PostgreSQL Experts for his superior navigation skills and a steady hand at the PostgreSQL tiller.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/webdev/2009/05/15/socorro-moves-to-new-hardware/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How Download Day Succeeded</title>
		<link>http://blog.mozilla.com/webdev/2009/05/06/how-download-day-succeeded/</link>
		<comments>http://blog.mozilla.com/webdev/2009/05/06/how-download-day-succeeded/#comments</comments>
		<pubDate>Thu, 07 May 2009 05:08:22 +0000</pubDate>
		<dc:creator>morgamic</dc:creator>
		
		<category><![CDATA[Download Day]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/webdev/?p=400</guid>
		<description><![CDATA[The Download Day campaign won a People&#8217;s Voice Webby Award for online campaigns and a SoFIE award for Most Effective Online Brand Experience.  As Mary said, NoBox came up with a great design, and the project was a great success.
From where I sat, it was a pretty amazing view.  There were many people [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.spreadfirefox.com/en-US/worldrecord/">Download Day</a> campaign <a href="http://www.webbyawards.com/webbys/current.php?media_id=98&#038;season=12#adv_online_camp">won a People&#8217;s Voice Webby Award</a> for online campaigns and a <a href="http://www.sofieawards.com/winners">SoFIE award</a> for Most Effective Online Brand Experience.  As <a href="http://chickswhoclick.wordpress.com/2009/05/05/the-people-have-spoken-download-day-gets-a-webby/">Mary said</a>, <a href="http://www.nobox.com/">NoBox</a> came up with a great design, and the project was a great success.</p>
<p>From where I sat, it was a pretty amazing view.  There were many people involved from start to finish who helped make the project a success and I felt this would be a great opportunity to give you an idea of what makes up a project like this at Mozilla.</p>
<p><img src="http://people.mozilla.org/~morgamic/downloadday.png" alt="Simple diagram of contributors"/></p>
<ul>
<li>Initiation and Design &#8212; Mary and Nobox worked hard to come up with an awesome idea, concept and design.  They continued to provide insight and direction throught the entire process.</li>
<li>Development and Implementation &#8212; Ryan Doherty (Webdev) and Jeremy Orem (IT) worked hard to deliver the system to support streaming download counts as well as the programming necessary to make the project happen &#8212; database design, PHP, map overlays with accessible alternatives, HTML, JavaScript and CSS.  Jacob Potter and Brian Krausz (both Webdevs) helped with stats and mailing lists.</li>
<li>Localization &#8212; Our international community helped us localize our web application by providing translations.</li>
<li>Testing and Deployment &#8212; Stephen Donner (QA) verified and tested all working parts of the site.  Legal helped us make sure we were handling information responsibly.  Our IT group helped us deploy the application onto our web infrastructure.</li>
</ul>
<p>As I read Mary&#8217;s post, I thought of how this project was a great example of teamwork between multiple moving parts within the Mozilla ecosystem.  Not just within a growing company with many different groups, but between different community contributors &#8212; from translators to pledges to downloaders.</p>
<p>I am amazed at the level of participation, passion and effort that goes into our projects.  We are all proud of these awards.  They are a testament to the cooperation and teamwork that happens in the Mozilla community every day.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/webdev/2009/05/06/how-download-day-succeeded/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Geolocation in the Browser</title>
		<link>http://blog.mozilla.com/webdev/2009/05/01/geolocation-in-the-browser/</link>
		<comments>http://blog.mozilla.com/webdev/2009/05/01/geolocation-in-the-browser/#comments</comments>
		<pubDate>Fri, 01 May 2009 20:55:59 +0000</pubDate>
		<dc:creator>Jeff Balogh</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/webdev/?p=367</guid>
		<description><![CDATA[Firefox 3.5 makes it super simple to discover the location of a user on your website  You can read more about it from Doug Turner or the official Mozilla page, but today I want to look at how to use the new API.
The following image is a screenshot of geolocation plus Google maps.  If [...]]]></description>
			<content:encoded><![CDATA[<p>Firefox 3.5 makes it super simple to discover the location of a user on your website  You can read more about it from <a href="http://dougt.wordpress.com/2009/04/30/geolocation-in-firefox-35-and-fennec/">Doug Turner</a> or the <a href="http://www.mozilla.com/firefox/geolocation/">official Mozilla page</a>, but today I want to look at <a href="https://developer.mozilla.org/En/Using_geolocation">how to use</a> the new <abbr title="Awesome Programming Interface">API</abbr>.</p>
<p>The following image is a screenshot of geolocation plus Google maps.  If you&#8217;re running Firefox 3.5, we&#8217;ll replace that with a real map showing your current position.</p>
<p><div id="attachment_385" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.mozilla.com/webdev/files/2009/05/do-you-know-where-your-browsers-are.jpg"><img src="http://blog.mozilla.com/webdev/files/2009/05/do-you-know-where-your-browsers-are-300x191.jpg" alt="Geolocation services finding me at the Mozilla office." title="geolocation screenshot" width="300" height="191" class="size-medium wp-image-385" /></a><p class="wp-caption-text">Geolocation finding me at the Mozilla office.</p></div><br />
<script type="text/javascript" src="http://maps.google.com/maps?file=api&#038;v=2&#038;sensor=true&#038;key=ABQIAAAAdKqUl5P5ngUsPujIZwvdLxSceV2u1YX1A4SJMX68dXj2a2_D8BSebGgC9lpsF2DiYm8ICbuEBsBiJw"></script><br />
<!-- Sorry about this nastiness, see http://people.mozilla.com/~jbalogh/geo.html for a readable example --><br />
<script type="text/javascript"> function geo() { if (navigator.geolocation){ if (location.pathname.indexOf('geolocation-in-the-browser') != -1) { navigator.geolocation.getCurrentPosition(mapper); } } } function mapper(position) { if (GBrowserIsCompatible()) { var map = document.getElementById('attachment_385'); map.style.height = '300px'; map.style.width = '450px'; var gmap = new GMap2(map); var point = new GLatLng(position.coords.latitude, position.coords.longitude); gmap.setCenter(point, 15); gmap.addOverlay(new GMarker(point)); gmap.setUIToDefault(); } } document.addEventListener('DOMContentLoaded', geo, false); </script></p>
<p>First, we should check that the browser supports the <a href="http://dev.w3.org/geo/api/spec-source.html">Geolocation API</a>:</p>
<pre><code>if (!navigator.geolocation) { alert('Get a better browser'); }</code></pre>
<p>Now that we&#8217;ve cleared out the riff-raff we can dive in to the new feature:</p>
<p><a href="https://developer.mozilla.org/En/Using_geolocation#section_2">
<pre><code>navigator.geolocation.getCurrentPosition()</code></pre>
<p></a></p>
<p>I love the simplicity of this API; that&#8217;s all you need to know to get the user&#8217;s position!  To do something useful, we&#8217;ll need a function to handle a successful positioning call:</p>
<pre><code>navigator.geolocation.getCurrentPosition(function(position) {
    alert(position.coords.latitude + ", " + position.coords.longitude);
});</code></pre>
<p>Since it takes a few seconds to gather location data and send it up to the geolocation services, we must use an asynchronous callback instead of a return value.</p>
<p>The <a href="https://developer.mozilla.org/En/Using_geolocation#section_4">Position object</a> has two fields: <code>timestamp</code> and <code>coords</code>.  <a href="https://developer.mozilla.org/En/NsIDOMGeoPositionCoords"><code>position.coords</code></a> holds all the position and velocity information, with the two most interesting (on my stationary desktop) being <code>latitude</code> and <code>longitude</code>.  The motion information will be a lot more fun on mobile devices, especially in conjunction with <a href="https://developer.mozilla.org/En/Using_geolocation#section_3">navigator.geolocation.watchPosition</a>.</p>
<p>This blog goes over the most basic usage of the geolocation API, but I have a slightly more involved example available at <a href="http://people.mozilla.com/~jbalogh/geo.html">http://people.mozilla.com/~jbalogh/geo.html</a>.  If you <a href="http://gist.github.com/105157">view the source</a> you can check out <code>geolocation</code>, <code>-moz-border-radius</code>, and <code>-moz-box-shadow</code> in action.</p>
<p>NOTE: due to a <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=490740">bug</a> in the current Firefox 3.5b4, the geolocation services may fail on repeated calls.  The bug has been fixed, but we&#8217;re stuck with it in the current release.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/webdev/2009/05/01/geolocation-in-the-browser/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Socorro Dumps Wave Good-bye to the Relational Database</title>
		<link>http://blog.mozilla.com/webdev/2009/04/20/socorro-dumps-wave-good-bye-to-the-relational-database/</link>
		<comments>http://blog.mozilla.com/webdev/2009/04/20/socorro-dumps-wave-good-bye-to-the-relational-database/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 23:54:02 +0000</pubDate>
		<dc:creator>K Lars Lohn</dc:creator>
		
		<category><![CDATA[Socorro]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/webdev/?p=365</guid>
		<description><![CDATA[Let&#8217;s say we&#8217;ve got some twenty-five million chunks of data ranging in size from one K to several meg.  Let&#8217;s also say that we only rarely ever need to access this data, but when we do, we need it fast.  Would your first choice be to save this data in a relational database?
That&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say we&#8217;ve got some twenty-five million chunks of data ranging in size from one K to several meg.  Let&#8217;s also say that we only rarely ever need to access this data, but when we do, we need it fast.  Would your first choice be to save this data in a relational database?</p>
<p>That&#8217;s the situation that we&#8217;ve got in Socorro right now.  Each time we catch a crash coming in from the field, we process it and save a &#8220;cooked&#8221; version of the dump in the database.  We also save some details about the crash in other tables so that we can generate some aggregate statistics. </p>
<p>It&#8217;s that cooked dump that&#8217;s causing some concern.  The only time that we ever access that data is when someone requests that specific crash using the Socorro UI.  Considering that these cooked crashes take up nearly three quarters of the storage needs of our database, there&#8217;s not a lot of value there for the effort.  They inflate the hardware requirements for our database, make backups take too long and complicate any future database replication plans that we might consider.</p>
<p>We&#8217;re about to migrate our instance of Socorro to new shiny 64bit hardware.  Moving these great drifts of cooked dumps would take hours and necessitate potentially more than a day of down time for  production.  We don&#8217;t want that.</p>
<p>It&#8217;s time for a great migration.  All those dumps are going to leave the database.  We&#8217;re spooling them out into a file system storage scheme.  At the same time, we&#8217;re reformatting them into JSON.  In the next version of Socorro, when a user requests their dump by UUID, it will be served by Apache directly from a file system as a compressed JSON file.  The client will decompress it and through javascript magic give the same display that we&#8217;ve got now.</p>
<p>There&#8217;s some future benefits to moving this data into a file system format.  Think about all of this data sitting there in a Hadoop friendly format waiting for a future data mining project.  We&#8217;ve nothing specific planned, but we&#8217;ve got the first step done.</p>
<p>We&#8217;re hoping to get the data migration done within the week.  New versions of the processing programs will have to be deployed as well as the changes to the Web application.  Once that&#8217;s done, we can proceed to the deployment of our fancy new hardware.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/webdev/2009/04/20/socorro-dumps-wave-good-bye-to-the-relational-database/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Browser Support</title>
		<link>http://blog.mozilla.com/webdev/2009/04/01/browser-support/</link>
		<comments>http://blog.mozilla.com/webdev/2009/04/01/browser-support/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 21:59:35 +0000</pubDate>
		<dc:creator>rdoherty</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/webdev/?p=353</guid>
		<description><![CDATA[
For the past couple of days I&#8217;ve been pondering our browser support chart that the Mozilla webdev team wrote up about a year ago. Since then, the browser ecosphere has changed considerably. Chrome burst onto the scene with no warning, IE8 was released and Safari 4 is up-and-coming. 
One of the toughest parts of being [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Usage_share_of_web_browsers"><img src="http://blog.mozilla.com/webdev/files/2009/04/browser-marketshare.gif" alt="Browser marketshare February 2009" width="400" height="372" class="alignnone size-full wp-image-361" /></a></p>
<p>For the past couple of days I&#8217;ve been pondering our <a href="https://wiki.mozilla.org/WebDev:FrontendCodeStandards#External_Tools">browser support chart</a> that the Mozilla webdev team wrote up about a year ago. Since then, the browser ecosphere has changed considerably. Chrome burst onto the scene with no warning, IE8 was released and Safari 4 is up-and-coming. </p>
<p>One of the toughest parts of being a web developer is deciding what browser to support and how much to support each one. Should it be a binary decision, either support 100% or not? Support some browsers 100% and offer limited support for others? If you decide to gracefully degrade, how much and what features/functionality are considered essential?</p>
<p>And how do you decide which browsers to support? Do you choose via market share, cost/benefit, current/previous release, your website&#8217;s audience? </p>
<p>This is an especially tough decision when part of Mozilla&#8217;s mission is to  promote openness, innovation and opportunity on the Internet. Not supporting a browser simply because a small percentage of users are using it and it&#8217;s difficult to code for goes against this mission. Websites and their content should be easily accessible for all platforms, browsers and devices. </p>
<p>It&#8217;s a constant battle when there is a distinct need to release early and release often, yet support as many browsers as possible. The added work of supporting more than the most recent browsers is not insignificant.</p>
<p>In the spirit of openness, I want to hear what the community has to say. What are your thoughts for browser support? What will promote Mozilla&#8217;s mission but also allow us to develop quickly?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/webdev/2009/04/01/browser-support/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CSS Spriting Tips</title>
		<link>http://blog.mozilla.com/webdev/2009/03/27/css-spriting-tips/</link>
		<comments>http://blog.mozilla.com/webdev/2009/03/27/css-spriting-tips/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 22:36:32 +0000</pubDate>
		<dc:creator>rdoherty</dc:creator>
		
		<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/webdev/?p=325</guid>
		<description><![CDATA[One of the most effective ways of speeding up a website&#8217;s render time is to reduce the number of HTTP requests required to fetch content. An effective method to achieve this is via CSS sprites, which is combining multiple images into one large image and using CSS to only display parts of it.
Here&#8217;s an example [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most effective ways of speeding up a website&#8217;s render time is to reduce the number of HTTP requests required to fetch content. An effective method to achieve this is via CSS sprites, which is combining multiple images into one large image and using CSS to only display parts of it.</p>
<p>Here&#8217;s an example sprite:</p>
<p><a href="http://blog.mozilla.com/webdev/files/2009/03/main-sprites1.png"><img src="http://blog.mozilla.com/webdev/files/2009/03/main-sprites1.png" alt="Sprite Example" title="Sprite Example" width="450" height="548" class="alignnone size-full wp-image-335" /></a></p>
<p>The purpose of this post is not to show how it makes a site faster, but cover some best practices when creating a CSS sprite.</p>
<h3>Don&#8217;t wait until you are done slicing to begin spriting. </h3>
<p>The problem with waiting until you&#8217;ve built the site is all your CSS and images have already been created. You will have to go back and re-write your CSS. You&#8217;ll also spend a ton of time in Photoshop attempting to fit 20-30 graphics into a sprite at once, which is extremely painful and tedious. It&#8217;s much easier to build the sprite step by step.</p>
<h3>Arrange images opposite of how they will be displayed</h3>
<p>This tip is a little confusing and I didn&#8217;t learn this until I was halfway through creating a large sprite. If an image is supposed to appear on the left of an element: </p>
<p><a href="http://blog.mozilla.com/webdev/files/2009/03/picture-2.png"><img src="http://blog.mozilla.com/webdev/files/2009/03/picture-2.png" alt="Sprite positioning example" title="Sprite positioning example" width="203" height="28" class="alignnone size-full wp-image-338" /></a></p>
<p>Put that image to the right of the sprite (see sprite image from above). This way when you move the background image via CSS, there is no possible way any other image will display next to it. A common problem when creating CSS sprites is positioning images so they don&#8217;t appear as part of a background for the wrong element.</p>
<h3>Avoid &#8216;bottom&#8217; or &#8216;right&#8217; in CSS when positioning</h3>
<p>When positioning a CSS sprite behind an element, it&#8217;s very easy to use background-position: bottom -300px; or background-position: right -200px;. This will work initially, but the problem with it is once you expand your sprite in width or height, your positioning will be wrong as the images are no longer at the bottom or right of the sprite. Using explicit positioning in pixels avoids this issue.</p>
<h3>Give each image plenty of space</h3>
<p>As you can see from the example sprite, many tiny images are given lots of space. Why not just cram them all together to make the sprite smaller? Because the elements they are used on will most likely have variable content and need that extra padding so other images don&#8217;t show up.</p>
<p>Here&#8217;s an example:<br />
<a href="http://blog.mozilla.com/webdev/files/2009/03/picture-3.png"><img src="http://blog.mozilla.com/webdev/files/2009/03/picture-3.png" alt="Variable content example" title="Variable content example" width="302" height="189" class="alignnone size-full wp-image-342" /></a></p>
<p>Each list item has a graphical number as a background image. If you look at the sprite shown above, you can see how the images were staggered so that if the content increased, no other images would show up. </p>
<h3>Don&#8217;t worry about sprite pixel size</h3>
<p>Chances are if your site is decently designed, you will have a lot of images to put in your sprite. And you&#8217;ll need a pretty large sprite to space the images out appropriately. And that&#8217;s <strong>fine</strong>. Empty space in a sprite does not take up much of a file&#8217;s size.  The <a href="https://addons.mozilla.org/img/sprite.png?20081210">sprite used for addons.mozilla.org</a> is 1,000&#215;2,000 pixels and is only <strong>16.7kb!</strong></p>
<p>Got other tips? Leave a comment!</p>
<h3>More Resources</h3>
<ul>
<li><a href="http://css-tricks.com/css-sprites-what-they-are-why-theyre-cool-and-how-to-use-them/">CSS Sprites Tutorial</a></li>
<li><a href="http://spritegen.website-performance.org/">CSS Sprite Generator</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/webdev/2009/03/27/css-spriting-tips/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Crash Reporter Homepage Reskin</title>
		<link>http://blog.mozilla.com/webdev/2009/03/02/crash-reporter-homepage-reskin/</link>
		<comments>http://blog.mozilla.com/webdev/2009/03/02/crash-reporter-homepage-reskin/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 20:02:50 +0000</pubDate>
		<dc:creator>ozten</dc:creator>
		
		<category><![CDATA[Socorro]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/webdev/?p=309</guid>
		<description><![CDATA[The crash reporter has been given a new look, and the homepage has a new Dashboard.

Our UX Engineer Neil Lee has applied some simplifications to the query form. This redesign was focused on the homepage and global navigation.
Another new feature is that MTBF and Top Crashers By Signature can be exported in CSV format. In [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://crash-stats.mozilla.com/">crash reporter</a> has been given a new look, and the homepage has a new <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=465660">Dashboard</a>.</p>
<p><img src="http://blog.mozilla.com/webdev/files/2009/03/crash_reporter_homepage.png" alt="Screenshot of Crash Reporter homepage" width="500" height="269" /></p>
<p>Our UX Engineer Neil Lee has applied some simplifications to the query form. This redesign was focused on the homepage and global navigation.</p>
<p>Another new feature is that MTBF and Top Crashers By Signature can be <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=478305">exported in CSV format</a>. In the future, as we want to slice and dice different reports, it should be trivial to add this feature to other reports.</p>
<p>In addition I&#8217;ve fixed a handful of issues:</p>
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=428110">428110</a> - Quick and dirty changes to speed up crash analysis</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=478043">478043</a> - Make &#8216;is exactly&#8217; the default choice</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=479256">479256</a> - Clarify labels to be Date Processed</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=470524">470524</a> - Crash signatures not indented</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=479460">479460</a> - Bad Unicode in User Comments</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=479447">479447</a> - report/list with no results has JS error</li>
</ul>
<p>We would love your feedback. Check out some <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=480617">recently filed bugs</a> or send us some feedback and <a href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Webtools&amp;component=Socorro">file a new Socorro bug.</a></p>
<p>We&#8217;ve had some known issues around MTBF and Top Crashes by Signature in the last month and are working on fixing these issues. The upside is that <a href="http://crash-stats.mozilla.com/mtbf/of/SeaMonkey/development">SeaMonkey is now in MTBF</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/webdev/2009/03/02/crash-reporter-homepage-reskin/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
