Basically when getSelection().toString() is called, Chromium may return an serialization on a different content than Firefox. This patch tries to address this webcompat issue by mimicing the same behaviour. We should still address the spec issues, but this seems to be an acceptable compromise. Differential Revision: https://phabricator.services.mozilla.com/D239657