Bug 1090008 - [Text Selection]Refactor the TextDialog DOM event