See https://github.com/elemoine/ol3/commit/a7181ca06ed4af92520c651187966896e6868220.