Only set both height and width of editor when shadow DOM is used

These work inside a shadow root, but break the flexbox behavior when
the shadow DOM is disabled.