moveElementInDOM(container, element, contentElement, isRemovable) {
    const id = this.addPointerInTextLayer(contentElement, isRemovable);

    if (!container.hasChildNodes()) {
      container.append(element);
      return id;
    }

    const children = Array.from(container.childNodes).filter(
      node => node !== element
    );

    if (children.length === 0) {
      return id;
    }

    const elementToCompare = contentElement || element;
    const index = binarySearchFirstItem(
      children,
      node =>
        TextAccessibilityManager.#compareElementPositions(
          elementToCompare,
          node
        ) < 0
    );

    if (index === 0) {
      children[0].before(element);
    } else {
      children[index - 1].after(element);
    }

    return id;
  }
Move a div in the DOM in order to respect the visual order.
@param {HTMLDivElement} element
@returns {string|null} The id in the struct tree if any.