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