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