Use a cross-browser compatible method of determining document height

The automatic setting of height for the preview iframe stopped working in
Chrome. This change fixes this.