Bug 1074280 - Use AsContainerLayer() in order to avoid a bad cast. r=roc, a=2.0+

--HG--
extra : rebase_source : af4952827ece9be1d57c248d5df8baa49db39798