protected SurfaceSelection getNextRootRange(SurfaceSelection selection) {
		Node base = selection.getSelection().getRange().getCommonAncestorContainer();
		Element ancestor;
		if (base.getNodeType() == Node.TEXT_NODE) {
			ancestor = base.getParentElement();
		} else {
			ancestor = (Element) base;
		}

		if (ancestor != null && !ancestor.hasAttribute(DOMUtil.ROOT_ATTRIBUTE)) {
			while (ancestor != null && !ancestor.getParentElement().hasAttribute(DOMUtil.ROOT_ATTRIBUTE)) {
				ancestor = ancestor.getParentElement();
			}
			if (!ancestor.getTagName().equals(emptyElement.getTagName())) {
				// On calcule l'offset du noeud
				int offset = 1;// 1 car on veut s'insérer après ancestor
				Node child = ancestor.getParentElement().getFirstChild();
				while (!child.equals(ancestor)) {
					offset++;
					child = child.getNextSibling();
				}
				// on place la sélection après cet ancetre
				selection.getSelection().getRange().setStart(ancestor.getParentElement(), offset);
				selection.getSelection().getRange().setEnd(ancestor.getParentElement(), offset);
			}
		}
		return selection;
	}