replace Webkit-only functions with universal ones, fix cityscape for gecko