The repaint is what does a full layout and updates the desired size required to know what the new scroll height is. I'd like to split everything out such that I could do a height calculation pass and a full layout pass, but that's a lot more work. Since the double paint only happens on window resize or load, it's not that bad for now.