Fix selection on Firefox
Fix selection on Firefox

Apparently ShadowRoot on Firefox might be missing the getSelection
method, although MDN sounds otherwise. Anyway, let's revert back to
the check that we did before the ts conversion.

Change-Id: Id5486ea0e5ef1bd1e541714ea404f4a4e8ce4e67

GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit