|
@@ -11,21 +11,32 @@ import ViewDocument from '/ckeditor5/engine/view/document.js';
|
|
|
import { INLINE_FILLER_LENGTH, isInlineFiller, startsWithFiller } from '/ckeditor5/engine/view/filler.js';
|
|
import { INLINE_FILLER_LENGTH, isInlineFiller, startsWithFiller } from '/ckeditor5/engine/view/filler.js';
|
|
|
|
|
|
|
|
import { keyCodes } from '/ckeditor5/utils/keyboard.js';
|
|
import { keyCodes } from '/ckeditor5/utils/keyboard.js';
|
|
|
|
|
+import createElement from '/ckeditor5/utils/dom/createelement.js';
|
|
|
|
|
|
|
|
import { parse, setData } from '/ckeditor5/engine/dev-utils/view.js';
|
|
import { parse, setData } from '/ckeditor5/engine/dev-utils/view.js';
|
|
|
|
|
|
|
|
describe( 'Document', () => {
|
|
describe( 'Document', () => {
|
|
|
- let viewDocument;
|
|
|
|
|
|
|
+ let viewDocument, domRoot;
|
|
|
|
|
|
|
|
before( () => {
|
|
before( () => {
|
|
|
|
|
+ domRoot = createElement( document, 'div', {
|
|
|
|
|
+ id: 'editor',
|
|
|
|
|
+ contenteditable: 'true'
|
|
|
|
|
+ } );
|
|
|
|
|
+ document.body.appendChild( domRoot );
|
|
|
|
|
+
|
|
|
viewDocument = new ViewDocument();
|
|
viewDocument = new ViewDocument();
|
|
|
- viewDocument.createRoot( document.getElementById( 'editor' ) ) ;
|
|
|
|
|
|
|
+ viewDocument.createRoot( domRoot );
|
|
|
|
|
|
|
|
document.getSelection().removeAllRanges();
|
|
document.getSelection().removeAllRanges();
|
|
|
|
|
|
|
|
viewDocument.isFocused = true;
|
|
viewDocument.isFocused = true;
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
|
|
+ after( () => {
|
|
|
|
|
+ domRoot.parentElement.removeChild( domRoot );
|
|
|
|
|
+ } );
|
|
|
|
|
+
|
|
|
describe( 'jump over inline filler hack', () => {
|
|
describe( 'jump over inline filler hack', () => {
|
|
|
it( 'should jump over inline filler when left arrow is pressed after inline filler', () => {
|
|
it( 'should jump over inline filler when left arrow is pressed after inline filler', () => {
|
|
|
setData( viewDocument, '<container:p>foo<attribute:b>[]</attribute:b>bar</container:p>' );
|
|
setData( viewDocument, '<container:p>foo<attribute:b>[]</attribute:b>bar</container:p>' );
|