fix text selection problem on IE9 in quirks mode, fixes #17216
thanks to neek for the investigation and patch
(cherry picked from commit c86c4ea8504875fa749fc096043907bdf90de1e5)