Bug 948622 - Improve activate_edit_mode()