Delay initial measurement until the editor becomes visible

Previously, these measurements were always performed when the editor
component was mounted. This didn't work in situations where the
component was mounted in a non-visible state. This commit includes a
visibility check in the resize polling we were already doing, kicking
off the measurement process as soon as the editor is visible.