getRectangle calculates the right values when there is at least one scrollable inner element