Broken off from bug 14868.
Created attachment 16601 [details] Patch
Comment on attachment 16601 [details] Patch r=me
Committed revision 26619.