fix text selection problem on IE9 in quirks mode, fixes #17216
thanks to neek for the investigation and patch