Element element = positionToElement(offset);  if (element == null) return 0;  return children.indexOf(element);
    public int getElementIndex(int offset)    {      if (children.size() == 0)	return 0;            Element element = positionToElement(offset);      if (element == null)	return 0;            return children.indexOf(element);    }