testRemoveFormattingDoesNotShrinkSelection() {
    const div = document.getElementById('html');
    div.innerHTML = '<div>l </div><div><br><b>a</b>foo bar</div>';
    const div2 = div.lastChild;

    Range.createFromNodes(div2.firstChild, 0, div2.lastChild, 7).select();

    FORMATTER.removeFormatting_();

    const range = Range.createFromWindow();
    assertEquals(
        'Correct text should be selected', 'afoo bar', range.getText());

    // We have to trim out the leading BR in IE due to execCommand issues,
    // so it isn't sent off to the removeFormattingWorker.
    // Workaround for broken removeFormat in old webkit added an extra
    // <br> to the end of the html.
    let html = '<div>l </div><br class="GECKO WEBKIT">afoo bar';
    if (userAgent.EDGE) {  // TODO(sdh): I have no idea where this comes from
      html = html.replace(' class="GECKO WEBKIT"', '');
    }

    testingDom.assertHtmlContentsMatch(html, div);
    FIELDMOCK.$verify();
  }
@bug 1319715
@suppress {visibility} suppression added to enable type
     checking