Bug 838001 IME management code should use root widget instead of the nearest widget of the PresContext r=smaug