Archive for July, 2010

Open Web Camp II at Stanford (July 17, 2010)

Saturday, July 17th, 2010

Open Web Camp II at Stanford today was a blast! Lots of information. Plenty I’m already familiar with, but also lots I learned.

I woke up late, only to see people tweeting about the conference (doh!), so I missed seeing Molly Holzschlag. But I arrived just in time to see…

Estelle Weyl: “CSS3 Implementable Features”

Estelle WeylEstelle Weyl (@estellevw)

Estelle’s talk was about what features of CSS3 are available to use right now. She covered all the usual: border radius, text shadow, box shadow, tilted images, etc. And she showed off Paul Irish’s css3please.com, which greatly helps implement these cross-browser, with even the filter hacks required to pull it off in IE! (no word about the performance hit of these IE hacks, which I’m sure I’ve read about somewhere…)

One of the cool new things I learned was that you can use CSS shorthands to declare border-radius (rounded corner) values. So instead of this mess (courtesy of border-radius.com):

-webkit-border-top-left-radius: 1px;
-webkit-border-top-right-radius: 2px;
-webkit-border-bottom-right-radius: 3px;
-webkit-border-bottom-left-radius: 4px;
-moz-border-radius-topleft: 1px;
-moz-border-radius-topright: 2px;
-moz-border-radius-bottomright: 3px;
-moz-border-radius-bottomleft: 4px;
border-top-left-radius: 1px;
border-top-right-radius: 2px;
border-bottom-right-radius: 3px;
border-bottom-left-radius: 4px;

All you need to do is this, which is equivalent to the above (disclaimer: I’m not sure about the compatibility of this shorthand!):

-moz-border-radius: 10px 20px 30px 40px;
-webkit-border-radius: 10px 20px 30px 40px;
border-radius: 10px 20px 30px 40px;

Or if you get bored of doing a perfectly rounded border radius, you can also do elliptical border radius (again, I’m unsure about the compatibility!):

-moz-border-radius: 20px / 10px;
-webkit-border-radius: 20px / 10px;
border-radius: 20px / 10px;

Matt Henry: “Going Mobile”

Matt HenryMatt Henry (@greenideas)

I’ve worked closely with Matt at Yahoo! Mobile for the past year, so not much was new for me. It seemed that the audience really dug the talk though (lots of questions were asked!).

Essentially, Matt explained that you have to make at least two different versions of your website: one for feature phones and one for smartphones like the iPhone, and with the help of something like WURFL, detect the phone and direct the user to the appropriate site.

Matt also emphasized that feature phone browsers are terrible, much worse than IE6.

As part of a response to someone’s question, Matt talked about the idea of feature detection on smart phones, essentially saying that by the time you’ve sent the JavaScript feature detection to the device, it’s already too late, and in some cases might end up crashing the browser (for feature phones that have an extremely small page weight such as 9KB). So for now it looks like user agent sniffing on the server-side is the way to go.

And there was a brief shoutout for Yahoo! Blueprint, which renders a website across thousands of phones.

Victor Tsaran and Todd Kloots: “Accessibility 101″

Victor Tsaran (left) and Todd Kloots (right)Victor Tsaran (@vick08) and Todd Kloots (@todd)

Before joining Twitter, Todd Kloots spent some time with Victor Tsaran at Yahoo! on accessibility.

In this talk they went over common misunderstandings and showed that even today, big companies such as Digg.com are still not investing in making their site accessible.

This was a pretty high level overview of basic accessibility, including an introduction to screen readers and ARIA attributes.

Here’s some of the stuff covered:
-making forms accessible with fieldset and legend elements and linking captions to their inputs.
-adding alt tags to images even if blank (so the screen reader doesn’t announce the entire URL)
-the title tag doesn’t make things more accessible, whereas the alt tag does
-screen readers obey display: none and visibility: hidden and that to hide something from normal users you have to position it offscreen (with negative left or text-indent).
-how to make basic tables accessible by taking advantage of table summary and caption, as well as putting tables headings into the <thead> element.

I’m still trying to absorb it, but Todd also mentioned that a simple anchor tag for a button didn’t semantically make sense, and that it was more semantic to have a span wrapped around a <button>. I guess I either don’t understand fully or I just disagree, since a <button> appears within a form and sometimes it just may be a cleaner solution to use a simple anchor tag. I guess I will need to look into this more.

Joseph R. Lewis: “Refactoring for Mobile”

Joseph R. LewisJoseph R. Lewis (@sanbeiji)

This talk was basically a live demo of implementing CSS media queries in a WordPress installation to make an iPhone-friendly version of the site. There was a good use of the viewport tag, media queries, @font-face, text-shadow, box-shadow, border-radius, etc.

One surprising thing I learned was that apparently Mobile Safari recognizes border-radius without the webkit prefix? I’m going to follow up on this.

Dirk Ginader: “5 layers of web accessibility”

Dirk GinaderDirk Ginader (@ginader)

Dirk is another Yahoo! (we’re everywhere!) whose presentation was also about accessibility.

As web developers, we’re already familiar with three layers of the web:

-HTML, responsible for content
-CSS, responsible for presentation
-JavaScript, responsible for interaction

Dirk introduced another two levels:

-CSS for JavaScript: special styling for when the full-featured JavaScript is available (this can be used by having JS add a “js” class to the document, and therefore writing CSS rules with “.js” in the front)
-WAI-ARIA: special HTML attributes to help define roles, landmarks, allow the developer to give instructions directly through the screen reader, etc.

Also a few more points:
-use the JavaScript focus() method for events (alerts that are injected at the top of the document and are otherwise ignored by the screen reader, windows that open and close, etc.)
-:hover CSS pseudoclass is for the mouse only.. be sure to also use the :focus pseudoclass! (my note: this is also important on mobile, for touch devices!)

Summary

Overall a great day. The food was pricey but good, and the whole event was free, so I can’t complain! Nice event, I just wish I could’ve seen the other talks in the other tracks!

Friday links: mobile performance studies, the upcoming device element, and more (July 15)

Friday, July 16th, 2010

Mobile

Flickr for iPhone 1.2 released
Firefox Home For iPhone Approved, Lets You Sync Bookmarks, Open Tabs And More
Opera Mobile 10.1 for S60: W3C gelocation, border-radius & 2D transforms on S60 platform
Mobile Browser Cache Limits, Revisited by Ryan Grove
Mobile cache file sizes (and other performance tests on mobile devices) by Steve Souders
Out Of Nowhere, The iPad Has A Real Competitor: the Android-based Pandigital Novel
Ex-Apple Javascript Guru: HTML5 and Native Apps Can Live Together

HTML

[whatwg] The vision behind the <device> element and the ConnectionPeer interface: Hixie (Ian Hickson) explains the future of video conferencing, real-time games, and peer-to-peer file transfer from the browser
The id attribute just got more classy in HTML5: probably not very useful, but good to know. Summary: in HTML 4.01 you could use almost any crazy characters for class names (♥, ⌘, ⌥, etc.), and now with HTML5 you can do the same for ids.
<mark>: how do you use it semantically?

Events

FREE MobileMonday Night in the Park – Mobile Life and Demos (San Francisco)
$ DevNation San Francisco (August 14, 2010): $50 if you get the early bird discount!
$$$$$ Design For Mobile 2010: “Design For Mobile is the first and only North American mobile user experience conference. The focus is on strategy and tactics for user research, product definition, interaction and other design, and usability testing.” ($1,700 early bird discount)

JavaScript

JavaScript Programming Patterns: Klaus Komenda gives a concise explanation of the various coding patterns created over the years. Not a new post, but it’s so good that it’s worth mentioning.
DailyJS: A JavaScript Blog
Caveats of the JS Module Pattern
VIDEO: yayQuery Podcast Episode 19: HTML5, Sencha, John Resig, etc.
How ECMAScript 5 still does not allow to subclass an array

CSS

How media queries allow you to optimize SVG icons for several sizes
High DPI Web Sites: Dave Hyatt explains circa 2006 another way of targeting high-DPI devices (before media queries were around)
CSS3 PIE: “PIE makes Internet Explorer 6-8 capable of rendering several of the most useful CSS3 decoration features.”

Books

Introducing HTML5 (Voices That Matter) (Bruce Lawson, Remy Sharp)

Etc

VIDEO: Paul Rouget on Mixing the web! (Mozilla Summit 2010): mixing HTML5, CSS3, WebGL, websockets… etc
VIDEO: The Big Web Show Episode 12: Web Conferences: Andy McMillan and Eric Meyer
Caching Improvements in Internet Explorer 9
Web App Masters: Designing for Interesting Moments: notes from Bill Scott’s presentation Designing for Interesting Moments
CouchDB 1.0 released

(thanks to Chris Heilmann’s Tech Thursday for some of the links)

A Visit From Flickr!

Friday, July 16th, 2010

One of the best perks of working at Yahoo! is getting to attend first-class talks, especially when the talk is by one of your favorite groups. In this case, Flickr!

Flickr schwag: lens cleaner, phone cleaner, or iPhone 4 reception-enabler?Flickr schwag: lens cleaner, phone cleaner, or iPhone 4 reception-enabler?

…and it helps if one of the speakers was once a member of your team (Markus was in Yahoo! Mobile until recently).

Markus Spiering of FlickrMarkus Spiering of Flickr

I probably can’t chat too much about the future improvements they talked about, but I’ll just say there are some exciting plans for Flickr in the coming months! As you may already know, Flickr recently launched its new photo page. Markus went over some of the key new layout improvements, including the new prominence of geolocation and camera model information, which was previously buried deep in the exif info. He and Chris Martin also explained some of the improved photo navigation. Also, for anyone interested to know, the entire site was redone using YUI 3.

Chris briefly went over the public Flickr API they provide.

What’s really exciting is the amount of phones Flickr is being integrated into. It really says something when the top camera model for Flickr is the iPhone. More generally, just think of all the possibilities with packaging Flickr into lots of other phones out there (not everyone has an iPhone, after all!).

Markus was also proud to exclaim that not only was the native Flickr app featured in the recent WWDC keynote, but it was also featured in iPhone commercials around the world (“There’s an app for that…”). Coincidentally, later that day Apple approved the latest version of the Flickr app, which now supports uploading in the background!

Chris Martin of FlickrChris Martin of Flickr

Keep your eyes peeled on Flickr! Cool improvements heading to a screen near you…

Thursday links (July 8)

Thursday, July 8th, 2010

Mobile

YouTube Mobile Gets a Kick Start
Battle of Champions: HTC Droid Incredible vs. Palm Pre Plus
Designing for the Retina Display (326ppi)
AUDIO: John Resig: You Don’t Know Mobile (Webstyle Magazine) – ~$5,000 minimum to do mobile testing
Tapworthy: Designing Great iPhone Apps
eMobile: We have the fastest network in Japan!
Apple iPad User Analysis — Phase II
VIDEO: Using iPhone with a Braille display (Victor Tsaran)
Mobile Access 2010 (Pew Research)
BlackBerry and iPhone losing ground to Android, overall smartphone growth (comScore data)

JavaScript

JavaScript needs modules!
JavaScript Cache Provider (Dustin Diaz)
Writing Testable JavaScript

CSS

VIDEO: Nicole Sullivan on CSS (The Big Web Show)
CSS Media Queries & Using Available Space
Data URIs make CSS sprites obsolete (Nicholas Zakas)

Books

HTML5 For Web Designers
Tapworthy: Designing Great iPhone Apps
HTML5: Up and Running
JavaScript Patterns

Etc.

Web Forms: Semantic Mark Up in our Forms [part 2]
Non Hover – “Elements that rely only on mousemove, mouseover, mouseout or the CSS pseudo-class :hover may not always behave as expected on a touch-screen device such as iPad or iPhone.”
Video to ASCII conversion with Canvas
CAPTCHA slider
Rich snippets and structured markup (Google Webmaster Central) (SEO)
Firefox 4 beta 1 is here – what’s in it for web developers?

Targeting Internet Explorer (IE): the age-old struggle

Wednesday, July 7th, 2010

As long as I can remember, developers have always been trying to target IE one way or another. Thanks to the wonders of modern technology, there have been multiple ways to pull this off.

I guess I really haven’t been keeping up with the latest frontend trends (doh!), as I’ve just recently discovered this very elegant solution circa 2008 offered by Paul Irish, which sticks a class on the body tag using proprietary conditional IE tags (no JavaScript magic needed here!):

<!--[if lt IE 7 ]> <body class="ie6"> <![endif]-->
<!--[if IE 7 ]>    <body class="ie7"> <![endif]-->
<!--[if IE 8 ]>    <body class="ie8"> <![endif]-->
<!--[if IE 9 ]>    <body class="ie9"> <![endif]-->
<!--[if gt IE 9]>  <body>             <![endif]-->
<!--[if !IE]><!--> <body>         <!--<![endif]-->

No need for creating multiple stylesheets for each version of IE (that makes extra network requests… boo)! Now you can add adjustments to your main stylesheet just as you would with CSS hacks, except now you’re doing it in a not-so-hacky way.

For instance, if you have some peculiar CSS quirk in IE6, you simply apply a fix like this:

.some-element { width: 200px; }         /* standards-based browsers */
.ie6 .some-element { width: 160px; }  /* elegant ie6 fix! */

The old way: CSS hacks

Previously I considered some CSS hacks the most elegant solution, but that was in the days when IE6/7 ruled. You can see that the following CSS hack gets really unruly for IE8 (that hack thanks to David Bloom):

.some-element {
    width: 200px;                /* standards-based browsers */
    /* some yet-to-be-determined IE9 hack goes here */
    width /*\**/: 180px\9        /* targets IE8 standards mode */
    *width: 170px;               /* targets IE7/IE6 */
    _width: 160px;               /* targets IE6 */
}

This works, but becomes quite difficult to maintain and understand. And it just creates a need for someone to find yet another hack for each new version of IE that’s released. By using the IE conditional comments to add a class to the body tag, we can accomplish the same result in a way that is easier to read and maintain and is dead simple to update when a new version of IE is released:

.some-element { width: 200px; }
.ie9 .some-element { width: 190px; }
.ie8 .some-element { width: 180px; }
.ie7 .some-element { width: 170px; }
.ie6 .some-element { width: 160px; }

Woohoo!

Related links

Conditional comments block downloads: Stoyan Stefanov’s concerns over using this pattern