Bug 1031230 - Change usage of AutoJSAPI in |DispatchAttributeEvent| for bug 951991, r=shuang