3
Resolution in Media Queries

I realized I hardly blog about mobile web development, although I do tweet about mobile quite often! (If you have not follow me on twitter, follow @girlie_mac now.)
So I decided to post a few short topics from my last presentation, and my first topic off the preso is about CSS resolution.
CSS Resolution
This is such obscure CSS 2 feature that not many people know or have used.
The resolution media feature describes the resolution of the output device, and its unit can be-
- dpi (dots per inch)
- dpcm (dots per centimeter), and
- dppx (dots per pixel, proposed for CSS3)
Why it matters?
So why has this become relavent to mobile web development now?
Because mobile display has been up-res’ing since Apple has announced the Retina display. To be honest with you, I am not sure if other manufacturers like Samsung had high pixel density displays before Apple, however, the hi-res trend has started ever since.
Retina display has the twice as much pixel density, and its device pixel ratio is 2 (DOM window.devicePixelRatio == 2), and for example, Nexus One has 1.5.
I am not talking more details on pixel density here, however, if you would like to learn more about what “device pixels” means and how a CSS pixel differs from a device pixel, I recommend PPK’s article, “A pixel is not a pixel is not a pixel“.
Crazy vender differences on device-pixel-ratio
In Webkit, the media query to differentiate the “regular” display (where a CSS pixel equals to a device pixel) versus the high pixel density displays, device-pixel-ratio is commonly used. To be precise, you must add the webkit prefix (as of August 2012), as -webkit-min-device-pixel-ratio, to check the minimum value of 2, 1.5, etc.
So what about non-Webkit?
Well, this gets more complicated than you think- For Mozilla, prefixed min-device-pixel-ratio is min--moz-device-pixel-ratio, and for Opera, the prefix rule is similar to webkit, -o-min-device-pixel-ratio, however, Opera requires the device pixel ratio value as a fraction, as 2/1 and 3/2 (instead of 2 and 1.5, respectively).
This is too annoying, right?
Unprefix it with resolution
So here’s a solution – use resolution.
Instead of writing,
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (min--moz-device-pixel-ratio: 1.5),
only screen and (-o-min-device-pixel-ratio: 3/2)
only screen and (min-device-pixel-ratio: 1.5) {
// some hi-res css
}
Write this:
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (min-resolution: 144dpi) {
// some hi-res css
}
On current mobile browsers, this shorter media-queries work on Webkits (Safari, Chrome, Android, MeeGo/Nokia, Dolphin etc.) and Firefox, Opera and IE9+! (Edit: IE9 and IE10 do support the resolution, however, it may recognize its value wrongly. e.g. Lumia 800 has the screen resolution of 480×800, while CSS pixel width of 320px, but the CSS resolution value is recognized as 96dpi, instead of 144dpi. Updated on Aug 23, 2012: According to Microsoft’s IE team, IE Mobile’s layout is done at 96dpi independently of the device so the dpi value not reflect the actual device.)
In case you wonder where the number 144 comes from – this is 1.5x of the regular screen resolution, 96dpi. If you want to detect Retina (Galaxy Nexus, or any displays with 2x pixel density), you use 192dpi.
Once the proposed unit, dppx is supported (no browsers support in this moment), this would be simpler like:
@media only screen and (min-resolution: 1.5dppx) {
// some hi-res css
}
So stop worrying about the confusing device-pixel-ratio. Life shouldn’t be more complicated!
References
31
HTML5: The Mobile Approach
It was great to be invited to speak at Innovators of the Web Conference at Adobe San Francisco on July 21.
My talk was about strategies on mobile with HTML5 – Adaptive approach (“Responsive Web Design”) and Mobile-only approach.
The slides for my preso is available on github. Use arrow keys or spacebar to navigate the slides. (This is created on Google’s HTML slide template, and it is best viewed on Webkit-based browsers.)
I will blog about some of the contents here or Nokia blog soon! (Yes, I went back to Nokia a few months ago, in case you didn’t know!)
19
Open Web Camp III
I had this wonderful opportunity to speak at OpenWebCamp III at Stanford University on this weekend, and I feel very honor to be there with so many great speakers and attendees.
Apparently, I have been doing mobile development longer than most of people, I picked the subject on developing mobile web, and how it has been changed and what we can do next.
I covered the topics including:
- How the mobile development has changed from WML, XHTML-MP, HTML4 and finally HTML5 with CSS3
- Legacy to HTML5: using input attributes to make easier for a user to type on phone
- Dealing with smarter phones: Viewport and Media-queries
- High DPI display: CSS pixel != Device pixel
- Device API
My slides, “WAP to HTML5: Mobile web – past, present, and future” is available in html5, not Powepoint or Keynotes so I couldn’t post it on SlideShare!
2
Simulating MacOS Dock-like menu with CSS3

Since my original “CSS Aqua button” written last year, I have seen more and more fan CSS3 UI mimic of MacOS components around! I think I have seen some Mac docks too, but as I remember they all use jQuery.
So I was thinking about making one only with CSS.
Initially I thought it was easy – let’s make an hovered icon larger like 200%, and make siblings in 150% of the original size using CSS sibling selector, and done! A piece of cake, huh? – Then I realized I made a mistake. The adjacent-sibling selector apply to an element which is immediately after the element in markup, not both before and after.
Oh well, so I needed to write a minimal JavaScript (so you don’t need to import a whole JS library) to add a class name to the element comes before the hovered object.
Anyway, here’s the live-demo! (Try it with the the latest Webkit Nightly or Safari 4) for the best experience!), and I’ll show you how I did-
Markup (Simplified)
Let’s create menu items as a list.
<div id="dock-container">
<div id="dock">
<ul>
<li><a href="http://android.com"><img src="images/dock-icons/android.png"/></a></li>
<li><a href="http://palm.com"><img src="images/dock-icons/palm.png"/></a></li>
<li>...
</ul>
<div class="base"></div>
</div>
</div>
The list should be displayed horizontally by setting the style to #dock li {display:inline-block}. Please see the source code from the demo for the details.
Magnify the icon with CSS transform
First, let’s define the dock icon animation with css transition.
The origin of the transform has to set to bottom, so the icon doesn’t scale from the middle of the icon. (Diagram #1).
I used only a webkit extension for this example but you can use -moz and -o extensions, for Firefox and Opera respectively.
Then, set the hover state – use css transform to scale the icon image up to 200%. Also you need to add some margin otherwise the enlarged icon overlaps with neighboring icons!
#dock li img {
width: 64px;
height: 64px;
-webkit-box-reflect: below 2px
-webkit-gradient(linear, left top, left bottom, from(transparent),
color-stop(0.7, transparent), to(rgba(255,255,255,.5))); /* reflection is supported by webkit only */
-webkit-transition: all 0.3s;
-webkit-transform-origin: 50% 100%;
}
#dock li:hover img {
-webkit-transform: scale(2);
margin: 0 2em;
}
Magnify adjacent icons
#dock li:hover + li img,
#dock li.prev img {
-webkit-transform: scale(1.5);
margin: 0 1.5em;
}
To magnify the icon at the right hand side of the hovered icon (Diagram #2), all you need to do is define the scale with using a CSS adjacent-sibling selector, E + F (an F element immediately preceded by an E element).
For the icon at the left (Diagram #3), ss I mentioned earlier, there is no css to get the previous sibling, so I need to rely on JavaScript.
I used the DOM node interface, previousElementSibling to access the sibling node. previousElementSibling should be supported by Webkit, Opera and Firefox.
Basically what I am doing here is that get the mouseovered object (should be an img element), find the parent li element (the immediate parent should be an a-alement, not a li, so get a’s parent! Check the HTML code again!), find the previous sibling li, then give a classname “prev” so I can apply the style.
Don’t forget to remove the class name as mouseout, otherwise the icon stays large.
function addPrevClass (e) {
var target = e.target;
if(target.getAttribute('src')) { // check if it is img
var li = target.parentNode.parentNode;
var prevLi = li.previousElementSibling;
if(prevLi) {
prevLi.className = 'prev';
}
target.addEventListener('mouseout', function() {
prevLi.removeAttribute('class');
}, false);
}
}
if (window.addEventListener) {
document.getElementById("dock").addEventListener('mouseover', addPrevClass, false);
}
For more details with the fancy CSS3 effects (e.g. the gradient and 3D-transform to create the “base” of the dock), please see the source code of the demo page!
29
I Can Has iPhone App on App Store
Finally, I have my app, called iCanHasLOL published on App Store!
Actually the app was reviewed within 24 hours by Apple, although I’ve heard it would usually take 2 weeks.
I mentioned that I had been writing an iPhone app using Appcelerator before, and an app was almost ready to go. However, I was not able to publish it with the particular contents so I re-wrote the app and re-created some graphics to finish up this brand-new app.
This is free of charge also ad-free (for now, at least!) so get your copy now!
5
iPhone Cocoa App development with JavaScript
Hello, I have neglected my blog since September although there have been some blog-worthy events like N900 meetup (plus Droid experience and new Fennec demo. See the videos by Tnkgrl from the link!), California Data Camp, release of Net2Streams Pro (the streaming radio app for Palm WebOS I helped writing) etc… Well, I keep microblogging on Twitter almost daily basis so follow me if you’d like!
One of the interesting I have been independently doing is that writing an app for iPhone with JavaScript, and this time, not an web app but a “native” Cocoa app. Yes I said a native iPhone app in JavaScript! But how? -I used this excellent open-source platform, called Titanium by Appcelerator! Without bothering Obj.C or Java, Titanium allows developers to write iPhone and Android apps with the familiar web technology.>
So, as a test run, I have created the iCuteoverload app for iPhone again. (Originally, I made the web app for iPhone, using iUI in 2007)
I will not release this app on AppStore -not because of the technical issue but the agreement with the business decision. (Yes, this app contents are not mine and copyrighted!) But I should be able to show the video capture as a demo to tell you what Titanium can do for web devs like me!
22
Classification of Mobile Browsers
Today, I am not going to post some CSS3 tricks on Webkit, or stuff like that. Instead, I post a list mobile browsers, since I am often asked about mobile / WAP browsers by engineers, product managers, and mobile-curious or mobile-newbie people.
I gathered 30+ major browsers I have worked with (plus a few I have never even seen), and categorize by the markup that browsers can render – WML, CHTML, XHTML-MP, and HTML4.
So, here you go. If you find some mistakes, let me know!
| WML Browsers (WAP 1.x) | |
|---|---|
| Openwave earliy browsers 4.x | |
| Early Nokia browser | |
| Early Obigo browser | |
| CHTML Browsers (Common in Japan) | |
|---|---|
| CHTML browsers | Compact-HTML browsers |
| Compact NetFront | |
| i-mode browsers (CHTML / XHTML) | NTT Docomo |
| XHTML Browsers (WAP 2.x – XHTML-MP / WML) | |
|---|---|
| WebKit | Nokia S40 |
| Nokia S60 – earlier versions, or “Services” browser | |
| NetFront by Access | Palm Blazer 3.x - |
| Sony Ericsson WAP browser | |
| Blazer by Handspring | original browsers before accured by Palm |
| Openwave 6.x | Siemens |
| Sharp | |
| Sanyo | |
| Motorola | |
| Toshiba | |
| Blackberry by RIM | Blackberry browser- earlier version ~4.3? (*) |
| Obigo by Teleca | |
| Polaris by InfraWare | |
| Helio | |
| Motorola MIB | |
| HTML Browsers | |
|---|---|
| WebKit | Nokia S60 3rd gen., “Web” Mini-map browser |
| Apple Mobile Safari | |
| Google Android | |
| Palm WebOS | |
| Iris, by Torch Mobile (now RIM) | |
| Bitstream Bolt (Proxy) | |
| MOTOMAGX (Motorola Linux devices) | |
| Gecko | Mozilla Minimo (dead?) |
| Mozilla Fennec | |
| Maemo (aka MicroB) | |
| Skyfire | |
| Opera (proxy) | Opera Mobile |
| Opera Mini | |
| Nintendo DSi | |
| Nintendo Wii | |
| Blackberry by RIM | Blackberry browser ver.4.6+ (I am not sure about 4.4 and 4.5) |
| Microsoft Internet Explorer (was Microsoft Pocket IE) | (earlier versions do not support CSS?) |
| NetFront 3.x ? | Sony Ericsson browsers |
| Sony PlayStation / PSP browsers | |
| Palm Blazer 4.x | |
| Amazon Kindle | |
| Teleca | Teleca Browser V3.x ? (LG Voyager) |
| Danger (now by Microsoft) | Sidekick |
I have categorized only with the markup type, and did not sub-categorize these browsers. However, if I would, I may want to grade XHTML-MP devices with page memory size (=”deck size”, yes I said deck size), and screen resolution for UI design purpose.
To grade full-HTML browsers, you need to spend massive time and effort on testing rendering capability with CSS, and Javascript DOM compatibility, events, etc. Actually, PPK has done excellent work on mobile browser testing, so you can simply visit Quirksmode.org!
3
Webkit CSS 3D + Local DB Demo

Ever since I heard of Snow Loepard’s hardware-accelerated CSS, I wanted try some cool CSS animation for Safari 4.
So after installing Snow Leopard, I spent about a day and half to try creating my first 3D animation with Flickr API.
Honestly, I wasn’t sure where to get started to make some cool 3D effect, so what I did was I tried to reproduce the one on webkit.org example and modify a lot by trial and error approach.
Also, I have been freqently asked about how I did with “My Favorites” feature on my Palm Pre app (which is also a WebKit-based), so I throw the HTML5′s local storage demo with this 3D demo.
So here, you can try my CSS 3D and Local DB Demo!!!
Be sure to view this demo on Safari 4, iPhone Safari, or WebKit Nightly! This doesn;t seem to work on other Webkit-based browsers such as Chrome and Palm.
I am not going to write a whole tutorial how to replicate this animation but I try to explain some examples.
Spin a Wheel!
Look at one of the flicke photo wheel on my demo. This is a combination of a few different animation.
Let’s focus on the small wheel inside. This is the snippet of HTML of the wheel:
<div id="gallery">
<div id="pic01"><img src="..."/></div>
<div id="pic02"><img src="..."/></div>
... (10 more imgs)
</div>

OK, for now, let’s ignore how each photo is rendered to form a loop, and just focus on the animation of one div, #gallery (= a wheel). A band of photos is ratating clockwise around Y-axis.
This means the animation starts as -webkit-transform: rotateY(0); and goes around an circle for a whole 360 degree. -webkit-transform: rotateY(-360deg);.
Use positive if you want to rotate in opposite direction.
I set the whole circle completion span as 60 seconds in linier motion and the animation goes infinite.
This diagram from Apple’s Safari Reference Library explains coordinates.
So the css for this movement is defined as:
#gallery {
-webkit-transform-style: preserve-3d;
-webkit-animation: spinY 60s linear infinite;
}
@-webkit-keyframes spinY {
from { -webkit-transform: rotateY(0);}
to { -webkit-transform: rotateY(-360deg);}
}
Use 3D style, -webkit-transform-style: preserve-3d;to give 3D illusion. I set the initial perspective in its parent div as -webkit-perspective: 380;.
It gives you an illusion of the depth. You can make the value lower to make it look more up-close to you.
The unit of perspective should be “px”, but it looks like you’d better remove it for iPhone.


To figure out how to render each photo in loop, also other animations, please look at the source code of my demo.
Also, I will write about how to use HTML 5′s local storage sometimes later!
References
- 3D Transforms by Webkit.org
- CSS Transforms (2D) by Webkit.org
- CSS Animation by Webkit.org
- CSS 3D Transforms Module Level 3 W3C Working Draft
- Safari Reference Library -Transforms by Apple
8
iPhone App – MuniApp for San Francisco Muni riders!

Ta-da, finally there’s an app for that! – I mean an iPhone native app that I involved is available on App Store!
This app is called, MuniApp, and this gives you access to San Francisco’s MUNI transit system on the go with real time predictions for buses, metro and cable cars.
I have worked on some UI and icons, while my friend Alberto has coded all the Obj.C. We are both SF residents and rely on MUNI pretty frequently and we do use this app on daily basis. Honestly, this is really simple and useful app
The official website for MuniApp is at www.obapp.com/muniapp
To directly go to App Store on iTunes, go to this link!
21
Find Your Tweeting Neighbor on iPhone with GeoLocation

iPhone OS 3.0 is now available, and developers can take advantage of the newly introduced geolocation feature in Safari browser.
To try it out quickly, I used Twitter Search API again to create a tiny test app called, NeighborTweet, which enable you to find out who are tweeting in your neighborhood. Basically, what it does is that obtain your location, and pass the latitude and longitude data to Twitter search and display the result tweets.
Try it out on your iPhone with:
Short URL http://bit.ly/K0ZaE
or
This QR Code with scanning app like BeeTagg.
If you are interested in learning more on Twitter search API and geocode, please read Twitter Wiki.
OK, now here’s the code.
To find out your location with Geolocation class is simple – you just call getCurrentPosition() method. This initiates an asynchronous request to detect the user’s position.
navigator.geolocation.getCurrentPosition(someFunction)
Get latitude and longitude, by using coords instance:
latitude = position.coords.latitude;
longitude = position.coords.longitude;
Here’s an actual code I used to create the sample app:
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
callback(position.coords.latitude, position.coords.longitude);
});
} else {
alert("Geolocation services are not supported by your browser.");
}
function callback(lat,lon){
// twitter search json-p callback
var geocode = "&geocode=" + lat + "%2C" + lon + "%2C1mi";
var fullUrl = url + geocode;
...
}
var url = "http://search.twitter.com/search.json?callback=getTweets";
function getTweets (json) {
// display json data
...
}
References
Geolocation References:
- Safari Reference Library – Getting Geographic Locations – Apple Developer Connection
- Using geolocation – Mozilla Developer Center
- Geolocation API Specification – W3C Working Draft
More References:
1
Mobile Safari for iPhone 3 includes Geolocation
Although W3C’s document, The Geolocation API Specification is still in draft state and not yet finalized, major browsers are working to support this functionality and as we all expected, Mobile Safari is not an exception.
According to ComputerWorld blog, the geolocation API has been implemented for the upcoming API. Apparently, Seth of ComputerWorld tried the test webpage, built by Doug Turner for Mozilla on a 3.0B5 iPhone’s Mobile Safari.
This screenshot is grabbed from the CompWorld’s blog.
Obviously I don’t have access to the new iPhone so I just tested the test page (http://people.mozilla.org/~dougt/geo.html) using Geolocation API watchPosition() method, on Mozilla 3.5. (And this should works similarly on Fennec too. I wish I could try on an actual device!)


I am using my old PowerBook G4, with Comcast,. Since this Mac is not equipped with GPS device, Firefox gathers information about nearby wireless access points and computer’s IP address.
Nice! I can’t wait to see this working on iPhone!
Especially, NextMuni.com with location enabled, that tells me where I am and where the nearest bus stop!
27
QuirksMode on Mobile!
One of the recent awesome news for mobile web developer is that “the browser guy” Peter-Paul Koch, known as PPK of Quirksmode.org has jumped onto mobile world, backed up by Vodafone. (See his blog).
I have been working for mobile phones since I joined Nokia in 2005, then Yahoo! later, I have been frustrated with luck of information on mobile browsers. Although Nokia was pioneering sharing information on S60 WebKit browsers, still there was not enough so I had to run many tests by myself without much help from anybody else, and recorded some quirks found a little bit at the time. So PPK’s work on compatibility test table is the one of the best resource I can have!
Anyway, PPK made his visit to Yahoo! last week and the video of his presentation is now on YUI Theater!
Also, his slides are availabe at SlideShare:
18
Using Keyframes – WebKit CSS Animation Examples
Now WebKit supports explicit CSS animations! After seeing the new animation examples posted on WebKit.org, I needed to test keyframes by myself.
So I have created a dumb-downed version of the fallen leaves seen on webkit.org blog, called “Let it Snow”.
Unlike the fallen leaves example, I stick strictly with CSS only (means zero JavaScript). Also I tested on Webkit nightly and an iPhone (OS 2.0) Safari. On my iPhone (Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_2 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5G77 Safari/525.20), the animation is slow and some feature is ingored.
Well, let’s see the “Let It Snow” animation in action!
How to use Keyframes?
Keyframes are specified with the CSS “At-Rule” by using the keyword,@-webkit-keyframes, followed by an identifier (= animation-name)
@-webkit-keyframes animation-name {
from {
style definition ["Before"-state]
}
to {
style definition ["After"-state]
}
}
A keyframe defines the styles applied within the animation. To specify multiple frames, use “%” instead of “from” and “to” keywords.
Here’s an actual example I used for “Let it Snow”.
@-webkit-keyframes fade {
0% { opacity: 0; }
10% { opacity: 0.8; }
100% { opacity: 0; }
}
This style is applie to create each snow flake appearance. A snowflake blurry appears (increase opacity) when 10% of the time elapsed (The total time is defined later. I’ll explain it next).
And at the end, the snowflake disappears (opacity back to zero).
Once the animation timeframe is defined, apply it using -webkit-animation-name and related properties.
I set total animation duration as 5 seconds, and the animatin goes forever (= infinite times. The default is 1).
See the simplified example below.
#snow div {
-webkit-animation-name: fade;
-webkit-animation-duration: 5s;
-webkit-animation-iteration-count: infinite;
}
<div id="snow" class="snow">
<div>❅</div> /* an entity for ❅ */
</div>
Using Transform
Let’s rotate and move around snowflakes by using -webkit-transform.
rotate, of course, rotate the element, and translate specifies a 2D translation by the vector [tx, ty]. (For more explanations, please see CSS transform spec page).
I used percent, 0 and 100% here, but of course you can use “from” and “to”.
Also note that transform doesn’t seem to work on current iPhone Safari yet.
@-webkit-keyframes spin{
0% { -webkit-transform: rotate(-180deg) translate(0px, 0px);}
100% { -webkit-transform: rotate(180deg) translate(10px, 75px);}
}
You can just add the amination-name to the #snow div selector, separating with comma.
#snow div {
-webkit-animation-name: fade, spin;
...
}
More
For the “Let it snow” example, I also include the cheesy “accumulate” keyframe to make snow accumulate on ground. Kinda ugly though.
Moreover, I gave the -webkit-animation-duration to individual snowflake so all flakes don’t fall all together!
.snowflake {
color: #fff;
font-size: 2em;
position: absolute; (Note: The parent container is set relative positioned!)
}
.snowflake.f1 {
left: 40px;
-webkit-animation-duration: 5s;
}
.snowflake.f2 {
font-size: 1.8em;
left: 120px;
-webkit-animation-duration: 7s;
}
...
<div id="snow" class="snow">
<div class="snowflake f1">❅</div> /* an entity for ❅ */
<div class="snowflake f2">❄</div> /* an entity for ❄ */
... (add two more snowflake-div in the actual sample)
</div>
To view the entire markup and CSS, just view source of the sample file!
Resources:
23
WebKit Comparison on CSS3
Bitstream has launched a new mobile browser called Bolt, which is a J2ME browser and use WebKit as a rendering engine.
Instead of writing a review on this new WebKit browser, I decided to just do some quick CSS3 test on variety of WebKit browsers!
If you rather read the review, I recommend WAP Review. There’s a very detailed great article on Bolt there.
WebKit browsers I used
- WebKit Nightly for Mac OS X (as a Control)
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/528.11+ (KHTML, like Gecko) Version/4.0dp1 Safari/526.11.2 - iPhone Safari
Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_2 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5G77 Safari/525.20 - Chrome by Google
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/1.0.154.43 Safari/525.19 - HTC Dream Android
Mozilla/5.0 (Linux; U; Android 1.0; en-us; dream) AppleWebKit/525.10+ (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2 - Nokia N95 8GB
Mozilla/5.0 (SymbianOS/9.2 U; Series60/3.1 NokiaN95_8GB/10.0.021; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413 - Bolt 0.74 on Nokia N95 8GB
Mozilla/5.0 (X11; 78; CentOS; US-en) AppleWebKit/527+ (KHTML, like Gecko) Bolt/0.741 Version/3.0 Safari/523.15
CSS3 Styling I tested
.opracity {opacity: .5;}
.textShadow {text-shadow: #777 2px 2px 2px;}
.textShadows2 {text-shadow: rgba(0,0,255, .7) 3px 3px 2px, rgba(255,0,0, .7) -3px -3px 2px;
.ellipsis{text-overflow: ellipsis; width: 200px; overflow: hidden;}
.borderRadius {background-color: #666; color: #fff; width: 200px; padding: 10px; -webkit-border-radius: 10px;}
.boxShodow{-webkit-box-shadow: #000 3px 2px 6px; width: 200px; padding:5px;}
.strokeAndFill{-webkit-text-stroke: 1px green; -webkit-text-fill-color: #ccc; font-size: 2em; }
.borderImg{-webkit-border-image: url(button.gif) 0 13 0 13 stretch stretch; border-width: 0px 13px; padding: 5px 0 7px;}
Results
WebKit Nightly – This is how everything should look like.

iPhone Safari

Chrome and Android Browser


Nokia “Web” and Bolt on N95 8GB

* note: Android’s actual screen res is 320×480. The screenshot is not an actual size. (Obviously this is a photograph!). Also the screenshot for iPhone is from emulator but I tested on an actual device as well.
Summary
| Properties | WebKit Ntly | iPhone | Chrome | Android | Nokia | Bolt |
|---|---|---|---|---|---|---|
| opacity | Y | Y | Y | Y | N | N |
| text-shodow | Y | Y* | N | N | N | N |
| text-overflow (ellipsis) | Y | Y | Y | Y | Y | N** |
| border-radius | Y | Y | Y | Y | N | N |
| -webkit-box-shodow | Y | Y | Y | Y | N | N** |
| -webkit-text-stroke | Y | Y | N | N | N | N |
| -webkit-text-fill | Y | Y | Y | Y | N | Y |
| -webkit-border-image | Y | Y | Y | Y | N | Y |
* Basic feature is spported, but not multiple shodows.
** Not degraded gracefully. Contents become unreadable so should be avoided.
Additional Notes
Besides the CSS3 test, it is noticeable that Bolt does not honer css font size, weight and header with H tag. This is happening to another J2ME browser, Opera Mini 4 (not tested here since Opera Mini is not WebKit-based). Additionally, like Opera Mini, Bolt uses proxy for rendering and compression. Data is passed through proxy before sending to device.
Recent Posts
- Touchy-Feely with DOM Events: Rethinking Cross-Device User Interaction
- My Mobile HTML5 Talks Slides
- How to Enable WP8 Emulator on Mac
- HTML5 Form Validation のカスタマイズ
- HTML5 Dev Conf Slides
- HTML5 File API & XHR2 with Node.js Express
- Because I Want Mobile Web to Be A Better Platform
- Resolution in Media Queries
- HTML5: The Mobile Approach
- Creating Non-disruptive Notifications with HTML5
- Making Chupa-Chups using CSS3 Pseudo-elements
- Quick Fun: CSS3 Filter Effects
- The Day I seized The InterWeb – HTTP Status Cats
- HTML5 Form Field Validation with CSS3
- HTML5 Input Event Handlers and User-Experience
- Creating Usable Enyo UI – Buttons and Interactive Dialogs
- Thank you, Steve!
- Five CSS tricks used in Enyo JS Framework, and you can try them too!
- Open Web Camp III
- Quick Demo: CSS3 Fancy Avatar



