You're relying here on the fact that your view is completely transparent when there is no text in it.  I think it might be slightly more efficient for Gecko rendering if you actually set display:none on your view when it was not in use so that it could be completely removed from the layout and rendering tree.

Also, please use textContent instead of innerHTML whenever you can.