setSelection (sel) {
    // HACK: ignore this if not Browser (e.g. when running the test suite in node)
    if (!platform.inBrowser) return
    const state = this.state
    const wSel = window.getSelection()
    const wRange = this.wRange
    if (!sel || sel.isNull()) return this.clear()
    // console.log('### DOMSelection: setting selection', sel.toString());
    let { start, end } = this.mapModelToDOMCoordinates(sel)
    if (!start) return this.clear()
    if (sel.isReverse()) {
      [start, end] = [end, start]
    }
    state.dom = {
      anchorNode: start.container,
      anchorOffset: start.offset,
      focusNode: end.container,
      focusOffset: end.offset
    }
    // HACK: sometimes it happens that this fails
    // doing a try-finally lets the debugger still stop, but continue
    try {
      _set(state.dom)
    } finally {}

    function _set ({ anchorNode, anchorOffset, focusNode, focusOffset }) {
      wSel.removeAllRanges()
      wRange.setStart(anchorNode, anchorOffset)
      wRange.setEnd(anchorNode, anchorOffset)
      wSel.addRange(wRange)
      if (focusNode !== anchorOffset || focusOffset !== anchorOffset) {
        wSel.extend(focusNode, focusOffset)
      }
    }
  }
Transfer a given model selection into the DOM.

    @param {model/Selection} sel