|
|
@@ -3,18 +3,23 @@
|
|
|
* For licensing, see LICENSE.md.
|
|
|
*/
|
|
|
|
|
|
-/* globals document */
|
|
|
+/* globals document, encodeURIComponent */
|
|
|
|
|
|
import View from '../../../src/view/view';
|
|
|
import { setData } from '../../../src/dev-utils/view';
|
|
|
import createViewRoot from '../_utils/createroot';
|
|
|
|
|
|
-const view = new View();
|
|
|
-const viewDocument = view.document;
|
|
|
-createViewRoot( viewDocument );
|
|
|
const iframe = document.getElementById( 'iframe' );
|
|
|
-view.attachDomRoot( iframe.contentWindow.document.getElementById( 'editor' ) );
|
|
|
+iframe.srcdoc = '<div contenteditable="true" id="editor"></div>';
|
|
|
|
|
|
-setData( view,
|
|
|
- '<container:p>foo</container:p>' +
|
|
|
- '<container:p>bar</container:p>' );
|
|
|
+iframe.addEventListener( 'load', () => {
|
|
|
+ const view = new View();
|
|
|
+ const viewDocument = view.document;
|
|
|
+ createViewRoot( viewDocument );
|
|
|
+
|
|
|
+ view.attachDomRoot( iframe.contentWindow.document.getElementById( 'editor' ) );
|
|
|
+
|
|
|
+ setData( view,
|
|
|
+ '<container:p>foo</container:p>' +
|
|
|
+ '<container:p>bar</container:p>' );
|
|
|
+} );
|