8
0
Эх сурвалжийг харах

Changed format of static markers on DocumentFragment.

Oskar Wróbel 9 жил өмнө
parent
commit
69726939eb

+ 5 - 5
packages/ckeditor5-engine/src/model/documentfragment.js

@@ -7,7 +7,6 @@
  * @module module:engine/model/documentfragment
  * @module module:engine/model/documentfragment
  */
  */
 
 
-import MarkerCollection from './markercollection';
 import NodeList from './nodelist';
 import NodeList from './nodelist';
 import Element from './element';
 import Element from './element';
 import Text from './text';
 import Text from './text';
@@ -30,12 +29,13 @@ export default class DocumentFragment {
 	 */
 	 */
 	constructor( children ) {
 	constructor( children ) {
 		/**
 		/**
-		 * DocumentFragment markers collection.
+		 * DocumentFragment static markers list. This is a list of names and {@link module:engine/model/range~Range ranges}
+		 * which will be set as Markers to {@link module:engine/model/document~Document#markers document markers collection}
+		 * when DocumentFragment will be inserted to the document.
 		 *
 		 *
-		 * @readonly
-		 * @member {module:engine/model/markercollection~MarkerCollection}
+		 * @member {Map<String, {module:engine/model/range~Range}>} module:engine/model/documentfragment~DocumentFragment#markers
 		 */
 		 */
-		this.markers = new MarkerCollection();
+		this.markers = new Map();
 
 
 		/**
 		/**
 		 * List of nodes contained inside the document fragment.
 		 * List of nodes contained inside the document fragment.

+ 2 - 3
packages/ckeditor5-engine/tests/model/documentfragment.js

@@ -6,7 +6,6 @@
 import Element from '../../src/model/element';
 import Element from '../../src/model/element';
 import Text from '../../src/model/text';
 import Text from '../../src/model/text';
 import DocumentFragment from '../../src/model/documentfragment';
 import DocumentFragment from '../../src/model/documentfragment';
-import MarkerCollection from '../../src/model/markercollection';
 import { jsonParseStringify } from '../../tests/model/_utils/utils';
 import { jsonParseStringify } from '../../tests/model/_utils/utils';
 import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
 import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
 
 
@@ -30,10 +29,10 @@ describe( 'DocumentFragment', () => {
 			expect( frag.getChild( 2 ) ).to.have.property( 'data' ).that.equals( 'yy' );
 			expect( frag.getChild( 2 ) ).to.have.property( 'data' ).that.equals( 'yy' );
 		} );
 		} );
 
 
-		it( 'should have markers collection', () => {
+		it( 'should have markers list', () => {
 			let frag = new DocumentFragment();
 			let frag = new DocumentFragment();
 
 
-			expect( frag ).to.have.property( 'markers' ).to.instanceof( MarkerCollection );
+			expect( frag ).to.have.property( 'markers' ).to.instanceof( Map );
 		} );
 		} );
 
 
 		it( 'should have root property, equal to itself', () => {
 		it( 'should have root property, equal to itself', () => {