@ckeditor/ckeditor5-engine 35.3.2 → 36.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/LICENSE.md +1 -1
  2. package/package.json +22 -22
  3. package/src/controller/datacontroller.js +10 -8
  4. package/src/controller/editingcontroller.js +3 -4
  5. package/src/conversion/conversion.js +2 -3
  6. package/src/conversion/conversionhelpers.js +1 -1
  7. package/src/conversion/downcastdispatcher.js +3 -3
  8. package/src/conversion/downcasthelpers.js +2 -3
  9. package/src/conversion/mapper.js +3 -4
  10. package/src/conversion/modelconsumable.js +2 -2
  11. package/src/conversion/upcastdispatcher.js +3 -4
  12. package/src/conversion/upcasthelpers.js +10 -3
  13. package/src/conversion/viewconsumable.js +2 -2
  14. package/src/dataprocessor/basichtmlwriter.js +1 -1
  15. package/src/dataprocessor/dataprocessor.js +1 -1
  16. package/src/dataprocessor/htmldataprocessor.js +3 -3
  17. package/src/dataprocessor/htmlwriter.js +1 -1
  18. package/src/dataprocessor/xmldataprocessor.js +6 -2
  19. package/src/dev-utils/model.js +3 -3
  20. package/src/dev-utils/operationreplayer.js +1 -1
  21. package/src/dev-utils/utils.js +1 -1
  22. package/src/dev-utils/view.js +1 -1
  23. package/src/index.js +13 -3
  24. package/src/model/batch.js +10 -47
  25. package/src/model/differ.js +81 -174
  26. package/src/model/document.js +38 -97
  27. package/src/model/documentfragment.js +44 -97
  28. package/src/model/documentselection.js +152 -251
  29. package/src/model/element.js +48 -101
  30. package/src/model/history.js +15 -46
  31. package/src/model/item.js +1 -1
  32. package/src/model/liveposition.js +11 -39
  33. package/src/model/liverange.js +14 -38
  34. package/src/model/markercollection.js +42 -115
  35. package/src/model/model.js +214 -292
  36. package/src/model/node.js +36 -128
  37. package/src/model/nodelist.js +12 -41
  38. package/src/model/operation/attributeoperation.js +14 -45
  39. package/src/model/operation/detachoperation.js +4 -17
  40. package/src/model/operation/insertoperation.js +7 -35
  41. package/src/model/operation/markeroperation.js +9 -48
  42. package/src/model/operation/mergeoperation.js +9 -42
  43. package/src/model/operation/moveoperation.js +15 -39
  44. package/src/model/operation/nooperation.js +1 -7
  45. package/src/model/operation/operation.js +5 -63
  46. package/src/model/operation/operationfactory.js +3 -6
  47. package/src/model/operation/renameoperation.js +9 -29
  48. package/src/model/operation/rootattributeoperation.js +19 -48
  49. package/src/model/operation/splitoperation.js +10 -48
  50. package/src/model/operation/transform.js +110 -151
  51. package/src/model/operation/utils.js +37 -52
  52. package/src/model/position.js +118 -230
  53. package/src/model/range.js +146 -202
  54. package/src/model/rootelement.js +8 -47
  55. package/src/model/schema.js +245 -282
  56. package/src/model/selection.js +135 -196
  57. package/src/model/text.js +10 -37
  58. package/src/model/textproxy.js +16 -70
  59. package/src/model/treewalker.js +11 -102
  60. package/src/model/typecheckable.js +1 -1
  61. package/src/model/utils/autoparagraphing.js +11 -12
  62. package/src/model/utils/deletecontent.js +93 -62
  63. package/src/model/utils/findoptimalinsertionrange.js +25 -25
  64. package/src/model/utils/getselectedcontent.js +3 -6
  65. package/src/model/utils/insertcontent.js +37 -130
  66. package/src/model/utils/insertobject.js +40 -40
  67. package/src/model/utils/modifyselection.js +24 -34
  68. package/src/model/utils/selection-post-fixer.js +53 -59
  69. package/src/model/writer.js +209 -316
  70. package/src/view/attributeelement.js +2 -2
  71. package/src/view/containerelement.js +1 -1
  72. package/src/view/datatransfer.js +1 -1
  73. package/src/view/document.js +3 -5
  74. package/src/view/documentfragment.js +50 -4
  75. package/src/view/documentselection.js +2 -3
  76. package/src/view/domconverter.js +4 -8
  77. package/src/view/downcastwriter.js +2 -3
  78. package/src/view/editableelement.js +2 -3
  79. package/src/view/element.js +6 -8
  80. package/src/view/elementdefinition.js +1 -1
  81. package/src/view/emptyelement.js +2 -2
  82. package/src/view/filler.js +2 -3
  83. package/src/view/item.js +1 -1
  84. package/src/view/matcher.js +2 -2
  85. package/src/view/node.js +2 -5
  86. package/src/view/observer/arrowkeysobserver.js +1 -1
  87. package/src/view/observer/bubblingemittermixin.js +3 -6
  88. package/src/view/observer/bubblingeventinfo.js +2 -2
  89. package/src/view/observer/clickobserver.js +1 -1
  90. package/src/view/observer/compositionobserver.js +1 -1
  91. package/src/view/observer/domeventdata.js +1 -1
  92. package/src/view/observer/domeventobserver.js +1 -1
  93. package/src/view/observer/fakeselectionobserver.js +2 -2
  94. package/src/view/observer/focusobserver.js +25 -3
  95. package/src/view/observer/inputobserver.js +2 -2
  96. package/src/view/observer/keyobserver.js +2 -2
  97. package/src/view/observer/mouseobserver.js +1 -1
  98. package/src/view/observer/mutationobserver.js +1 -1
  99. package/src/view/observer/observer.js +3 -3
  100. package/src/view/observer/selectionobserver.js +21 -3
  101. package/src/view/observer/tabobserver.js +2 -2
  102. package/src/view/placeholder.js +1 -1
  103. package/src/view/position.js +2 -3
  104. package/src/view/range.js +1 -1
  105. package/src/view/rawelement.js +2 -2
  106. package/src/view/renderer.js +3 -12
  107. package/src/view/rooteditableelement.js +1 -1
  108. package/src/view/selection.js +2 -6
  109. package/src/view/styles/background.js +1 -1
  110. package/src/view/styles/border.js +1 -1
  111. package/src/view/styles/margin.js +1 -1
  112. package/src/view/styles/padding.js +1 -1
  113. package/src/view/styles/utils.js +1 -1
  114. package/src/view/stylesmap.js +1 -1
  115. package/src/view/text.js +1 -1
  116. package/src/view/textproxy.js +2 -2
  117. package/src/view/treewalker.js +2 -2
  118. package/src/view/typecheckable.js +1 -1
  119. package/src/view/uielement.js +2 -3
  120. package/src/view/upcastwriter.js +1 -1
  121. package/src/view/view.js +7 -7
  122. package/theme/placeholder.css +1 -1
  123. package/theme/renderer.css +1 -1
@@ -1,13 +1,12 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- /* eslint-disable new-cap */
6
5
  /**
7
6
  * @module engine/model/liverange
8
7
  */
9
8
  import Range from './range';
10
- import EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';
9
+ import { EmitterMixin } from '@ckeditor/ckeditor5-utils';
11
10
  /**
12
11
  * `LiveRange` is a type of {@link module:engine/model/range~Range Range}
13
12
  * that updates itself as {@link module:engine/model/document~Document document}
@@ -36,47 +35,28 @@ export default class LiveRange extends EmitterMixin(Range) {
36
35
  }
37
36
  /**
38
37
  * Creates a {@link module:engine/model/range~Range range instance} that is equal to this live range.
39
- *
40
- * @returns {module:engine/model/range~Range}
41
38
  */
42
39
  toRange() {
43
40
  return new Range(this.start, this.end);
44
41
  }
45
42
  /**
46
43
  * Creates a `LiveRange` instance that is equal to the given range.
47
- *
48
- * @param {module:engine/model/range~Range} range
49
- * @returns {module:engine/model/liverange~LiveRange}
50
44
  */
51
45
  static fromRange(range) {
52
46
  return new LiveRange(range.start, range.end);
53
47
  }
54
48
  }
55
- /**
56
- * Checks whether this object is of the given.
57
- *
58
- * liveRange.is( 'range' ); // -> true
59
- * liveRange.is( 'model:range' ); // -> true
60
- * liveRange.is( 'liveRange' ); // -> true
61
- * liveRange.is( 'model:liveRange' ); // -> true
62
- *
63
- * liveRange.is( 'view:range' ); // -> false
64
- * liveRange.is( 'documentSelection' ); // -> false
65
- *
66
- * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
67
- *
68
- * @param {String} type
69
- * @returns {Boolean}
70
- */
49
+ // The magic of type inference using `is` method is centralized in `TypeCheckable` class.
50
+ // Proper overload would interfere with that.
71
51
  LiveRange.prototype.is = function (type) {
72
52
  return type === 'liveRange' || type === 'model:liveRange' ||
73
53
  // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
74
54
  type == 'range' || type === 'model:range';
75
55
  };
76
- // Binds this `LiveRange` to the {@link module:engine/model/document~Document document}
77
- // that owns this range's {@link module:engine/model/range~Range#root root}.
78
- //
79
- // @private
56
+ /**
57
+ * Binds this `LiveRange` to the {@link module:engine/model/document~Document document}
58
+ * that owns this range's {@link module:engine/model/range~Range#root root}.
59
+ */
80
60
  function bindWithDocument() {
81
61
  this.listenTo(this.root.document.model, 'applyOperation', (event, args) => {
82
62
  const operation = args[0];
@@ -86,10 +66,9 @@ function bindWithDocument() {
86
66
  transform.call(this, operation);
87
67
  }, { priority: 'low' });
88
68
  }
89
- // Updates this range accordingly to the updates applied to the model. Bases on change events.
90
- //
91
- // @private
92
- // @param {module:engine/model/operation/operation~Operation} operation Executed operation.
69
+ /**
70
+ * Updates this range accordingly to the updates applied to the model. Bases on change events.
71
+ */
93
72
  function transform(operation) {
94
73
  // Transform the range by the operation. Join the result ranges if needed.
95
74
  const ranges = this.getTransformedByOperation(operation);
@@ -120,12 +99,9 @@ function transform(operation) {
120
99
  this.fire('change:content', this.toRange(), { deletionPosition });
121
100
  }
122
101
  }
123
- // Checks whether given operation changes something inside the range (even if it does not change boundaries).
124
- //
125
- // @private
126
- // @param {module:engine/model/range~Range} range Range to check.
127
- // @param {module:engine/model/operation/operation~Operation} operation Executed operation.
128
- // @returns {Boolean}
102
+ /**
103
+ * Checks whether given operation changes something inside the range (even if it does not change boundaries).
104
+ */
129
105
  function doesOperationChangeRangeContent(range, operation) {
130
106
  switch (operation.type) {
131
107
  case 'insert':
@@ -1,15 +1,13 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- /* eslint-disable new-cap */
6
5
  /**
7
6
  * @module engine/model/markercollection
8
7
  */
9
8
  import TypeCheckable from './typecheckable';
10
9
  import LiveRange from './liverange';
11
- import EmitterMixin, { Emitter } from '@ckeditor/ckeditor5-utils/src/emittermixin';
12
- import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
10
+ import { CKEditorError, EmitterMixin } from '@ckeditor/ckeditor5-utils';
13
11
  /**
14
12
  * The collection of all {@link module:engine/model/markercollection~Marker markers} attached to the document.
15
13
  * It lets you {@link module:engine/model/markercollection~MarkerCollection#get get} markers or track them using
@@ -24,17 +22,11 @@ import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
24
22
  *
25
23
  * @see module:engine/model/markercollection~Marker
26
24
  */
27
- export default class MarkerCollection extends Emitter {
28
- /**
29
- * Creates a markers collection.
30
- */
25
+ export default class MarkerCollection extends EmitterMixin() {
31
26
  constructor() {
32
- super();
27
+ super(...arguments);
33
28
  /**
34
29
  * Stores {@link ~Marker markers} added to the collection.
35
- *
36
- * @private
37
- * @member {Map} #_markers
38
30
  */
39
31
  this._markers = new Map();
40
32
  }
@@ -42,8 +34,6 @@ export default class MarkerCollection extends Emitter {
42
34
  * Iterable interface.
43
35
  *
44
36
  * Iterates over all {@link ~Marker markers} added to the collection.
45
- *
46
- * @returns {Iterator}
47
37
  */
48
38
  [Symbol.iterator]() {
49
39
  return this._markers.values();
@@ -51,8 +41,8 @@ export default class MarkerCollection extends Emitter {
51
41
  /**
52
42
  * Checks if given {@link ~Marker marker} or marker name is in the collection.
53
43
  *
54
- * @param {String|module:engine/model/markercollection~Marker} markerOrName Name of marker or marker instance to check.
55
- * @returns {Boolean} `true` if marker is in the collection, `false` otherwise.
44
+ * @param markerOrName Name of marker or marker instance to check.
45
+ * @returns `true` if marker is in the collection, `false` otherwise.
56
46
  */
57
47
  has(markerOrName) {
58
48
  const markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;
@@ -61,8 +51,8 @@ export default class MarkerCollection extends Emitter {
61
51
  /**
62
52
  * Returns {@link ~Marker marker} with given `markerName`.
63
53
  *
64
- * @param {String} markerName Name of marker to get.
65
- * @returns {module:engine/model/markercollection~Marker|null} Marker with given name or `null` if such marker was
54
+ * @param markerName Name of marker to get.
55
+ * @returns Marker with given name or `null` if such marker was
66
56
  * not added to the collection.
67
57
  */
68
58
  get(markerName) {
@@ -78,14 +68,13 @@ export default class MarkerCollection extends Emitter {
78
68
  * flag has changed.
79
69
  *
80
70
  * @internal
81
- * @protected
82
- * @fires module:engine/model/markercollection~MarkerCollection#event:update
83
- * @param {String|module:engine/model/markercollection~Marker} markerOrName Name of marker to set or marker instance to update.
84
- * @param {module:engine/model/range~Range} range Marker range.
85
- * @param {Boolean} [managedUsingOperations=false] Specifies whether the marker is managed using operations.
86
- * @param {Boolean} [affectsData=false] Specifies whether the marker affects the data produced by the data pipeline
71
+ * @fires update
72
+ * @param markerOrName Name of marker to set or marker instance to update.
73
+ * @param range Marker range.
74
+ * @param managedUsingOperations Specifies whether the marker is managed using operations.
75
+ * @param affectsData Specifies whether the marker affects the data produced by the data pipeline
87
76
  * (is persisted in the editor's data).
88
- * @returns {module:engine/model/markercollection~Marker} `Marker` instance which was added or updated.
77
+ * @returns `Marker` instance which was added or updated.
89
78
  */
90
79
  _set(markerOrName, range, managedUsingOperations = false, affectsData = false) {
91
80
  const markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;
@@ -129,10 +118,9 @@ export default class MarkerCollection extends Emitter {
129
118
  * Removes given {@link ~Marker marker} or a marker with given name from the `MarkerCollection`.
130
119
  *
131
120
  * @internal
132
- * @protected
133
- * @fires module:engine/model/markercollection~MarkerCollection#event:update
134
- * @param {String|module:engine/model/markercollection~Marker} markerOrName Marker or name of a marker to remove.
135
- * @returns {Boolean} `true` if marker was found and removed, `false` otherwise.
121
+ * @fires update
122
+ * @param markerOrName Marker or name of a marker to remove.
123
+ * @returns `true` if marker was found and removed, `false` otherwise.
136
124
  */
137
125
  _remove(markerOrName) {
138
126
  const markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;
@@ -151,9 +139,8 @@ export default class MarkerCollection extends Emitter {
151
139
  * conversion} for the marker.
152
140
  *
153
141
  * @internal
154
- * @protected
155
- * @fires module:engine/model/markercollection~MarkerCollection#event:update
156
- * @param {String|module:engine/model/markercollection~Marker} markerOrName Marker or name of a marker to refresh.
142
+ * @fires update
143
+ * @param markerOrName Marker or name of a marker to refresh.
157
144
  */
158
145
  _refresh(markerOrName) {
159
146
  const markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;
@@ -171,9 +158,6 @@ export default class MarkerCollection extends Emitter {
171
158
  }
172
159
  /**
173
160
  * Returns iterator that iterates over all markers, which ranges contain given {@link module:engine/model/position~Position position}.
174
- *
175
- * @param {module:engine/model/position~Position} position
176
- * @returns {Iterable.<module:engine/model/markercollection~Marker>}
177
161
  */
178
162
  *getMarkersAtPosition(position) {
179
163
  for (const marker of this) {
@@ -184,9 +168,6 @@ export default class MarkerCollection extends Emitter {
184
168
  }
185
169
  /**
186
170
  * Returns iterator that iterates over all markers, which intersects with given {@link module:engine/model/range~Range range}.
187
- *
188
- * @param {module:engine/model/range~Range} range
189
- * @returns {Iterable.<module:engine/model/markercollection~Marker>}
190
171
  */
191
172
  *getMarkersIntersectingRange(range) {
192
173
  for (const marker of this) {
@@ -208,15 +189,14 @@ export default class MarkerCollection extends Emitter {
208
189
  /**
209
190
  * Iterates over all markers that starts with given `prefix`.
210
191
  *
211
- * const markerFooA = markersCollection.set( 'foo:a', rangeFooA );
212
- * const markerFooB = markersCollection.set( 'foo:b', rangeFooB );
213
- * const markerBarA = markersCollection.set( 'bar:a', rangeBarA );
214
- * const markerFooBarA = markersCollection.set( 'foobar:a', rangeFooBarA );
215
- * Array.from( markersCollection.getMarkersGroup( 'foo' ) ); // [ markerFooA, markerFooB ]
216
- * Array.from( markersCollection.getMarkersGroup( 'a' ) ); // []
217
- *
218
- * @param prefix
219
- * @returns {Iterable.<module:engine/model/markercollection~Marker>}
192
+ * ```ts
193
+ * const markerFooA = markersCollection.set( 'foo:a', rangeFooA );
194
+ * const markerFooB = markersCollection.set( 'foo:b', rangeFooB );
195
+ * const markerBarA = markersCollection.set( 'bar:a', rangeBarA );
196
+ * const markerFooBarA = markersCollection.set( 'foobar:a', rangeFooBarA );
197
+ * Array.from( markersCollection.getMarkersGroup( 'foo' ) ); // [ markerFooA, markerFooB ]
198
+ * Array.from( markersCollection.getMarkersGroup( 'a' ) ); // []
199
+ * ```
220
200
  */
221
201
  *getMarkersGroup(prefix) {
222
202
  for (const marker of this._markers.values()) {
@@ -227,9 +207,6 @@ export default class MarkerCollection extends Emitter {
227
207
  }
228
208
  /**
229
209
  * Destroys the marker.
230
- *
231
- * @private
232
- * @param {module:engine/model/markercollection~Marker} marker Marker to destroy.
233
210
  */
234
211
  _destroyMarker(marker) {
235
212
  marker.stopListening();
@@ -279,13 +256,15 @@ export default class MarkerCollection extends Emitter {
279
256
  * Both type of them should be added / updated by {@link module:engine/model/writer~Writer#addMarker}
280
257
  * and removed by {@link module:engine/model/writer~Writer#removeMarker} methods.
281
258
  *
282
- * model.change( ( writer ) => {
283
- * const marker = writer.addMarker( name, { range, usingOperation: true } );
259
+ * ```ts
260
+ * model.change( ( writer ) => {
261
+ * const marker = writer.addMarker( name, { range, usingOperation: true } );
284
262
  *
285
- * // ...
263
+ * // ...
286
264
  *
287
- * writer.removeMarker( marker );
288
- * } );
265
+ * writer.removeMarker( marker );
266
+ * } );
267
+ * ```
289
268
  *
290
269
  * See {@link module:engine/model/writer~Writer} to find more examples.
291
270
  *
@@ -307,50 +286,22 @@ class Marker extends EmitterMixin(TypeCheckable) {
307
286
  /**
308
287
  * Creates a marker instance.
309
288
  *
310
- * @param {String} name Marker name.
311
- * @param {module:engine/model/liverange~LiveRange} liveRange Range marked by the marker.
312
- * @param {Boolean} managedUsingOperations Specifies whether the marker is managed using operations.
313
- * @param {Boolean} affectsData Specifies whether the marker affects the data produced by the data pipeline
314
- * (is persisted in the editor's data).
289
+ * @param name Marker name.
290
+ * @param liveRange Range marked by the marker.
291
+ * @param managedUsingOperations Specifies whether the marker is managed using operations.
292
+ * @param affectsData Specifies whether the marker affects the data produced by the data pipeline (is persisted in the editor's data).
315
293
  */
316
294
  constructor(name, liveRange, managedUsingOperations, affectsData) {
317
295
  super();
318
- /**
319
- * Marker's name.
320
- *
321
- * @readonly
322
- * @type {String}
323
- */
324
296
  this.name = name;
325
- /**
326
- * Range marked by the marker.
327
- *
328
- * @protected
329
- * @member {module:engine/model/liverange~LiveRange}
330
- */
331
297
  this._liveRange = this._attachLiveRange(liveRange);
332
- /**
333
- * Flag indicates if the marker is managed using operations or not.
334
- *
335
- * @private
336
- * @member {Boolean}
337
- */
338
298
  this._managedUsingOperations = managedUsingOperations;
339
- /**
340
- * Specifies whether the marker affects the data produced by the data pipeline
341
- * (is persisted in the editor's data).
342
- *
343
- * @private
344
- * @member {Boolean}
345
- */
346
299
  this._affectsData = affectsData;
347
300
  }
348
301
  /**
349
302
  * A value indicating if the marker is managed using operations.
350
303
  * See {@link ~Marker marker class description} to learn more about marker types.
351
304
  * See {@link module:engine/model/writer~Writer#addMarker}.
352
- *
353
- * @returns {Boolean}
354
305
  */
355
306
  get managedUsingOperations() {
356
307
  if (!this._liveRange) {
@@ -360,8 +311,6 @@ class Marker extends EmitterMixin(TypeCheckable) {
360
311
  }
361
312
  /**
362
313
  * A value indicating if the marker changes the data.
363
- *
364
- * @returns {Boolean}
365
314
  */
366
315
  get affectsData() {
367
316
  if (!this._liveRange) {
@@ -371,8 +320,6 @@ class Marker extends EmitterMixin(TypeCheckable) {
371
320
  }
372
321
  /**
373
322
  * Returns the marker data (properties defining the marker).
374
- *
375
- * @returns {module:engine/model/markercollection~MarkerData}
376
323
  */
377
324
  getData() {
378
325
  return {
@@ -383,8 +330,6 @@ class Marker extends EmitterMixin(TypeCheckable) {
383
330
  }
384
331
  /**
385
332
  * Returns current marker start position.
386
- *
387
- * @returns {module:engine/model/position~Position}
388
333
  */
389
334
  getStart() {
390
335
  if (!this._liveRange) {
@@ -394,8 +339,6 @@ class Marker extends EmitterMixin(TypeCheckable) {
394
339
  }
395
340
  /**
396
341
  * Returns current marker end position.
397
- *
398
- * @returns {module:engine/model/position~Position}
399
342
  */
400
343
  getEnd() {
401
344
  if (!this._liveRange) {
@@ -412,8 +355,6 @@ class Marker extends EmitterMixin(TypeCheckable) {
412
355
  * and get `Marker` instance from {@link module:engine/model/markercollection~MarkerCollection MarkerCollection} every
413
356
  * time there is a need to read marker properties. This will guarantee that the marker has not been removed and
414
357
  * that it's data is up-to-date.
415
- *
416
- * @returns {module:engine/model/range~Range}
417
358
  */
418
359
  getRange() {
419
360
  if (!this._liveRange) {
@@ -425,9 +366,8 @@ class Marker extends EmitterMixin(TypeCheckable) {
425
366
  * Binds new live range to the marker and detach the old one if is attached.
426
367
  *
427
368
  * @internal
428
- * @protected
429
- * @param {module:engine/model/liverange~LiveRange} liveRange Live range to attach
430
- * @returns {module:engine/model/liverange~LiveRange} Attached live range.
369
+ * @param liveRange Live range to attach
370
+ * @returns Attached live range.
431
371
  */
432
372
  _attachLiveRange(liveRange) {
433
373
  if (this._liveRange) {
@@ -443,7 +383,6 @@ class Marker extends EmitterMixin(TypeCheckable) {
443
383
  * Unbinds and destroys currently attached live range.
444
384
  *
445
385
  * @internal
446
- * @protected
447
386
  */
448
387
  _detachLiveRange() {
449
388
  this._liveRange.stopDelegating('change:range', this);
@@ -452,20 +391,8 @@ class Marker extends EmitterMixin(TypeCheckable) {
452
391
  this._liveRange = null;
453
392
  }
454
393
  }
455
- /**
456
- * Checks whether this object is of the given.
457
- *
458
- * marker.is( 'marker' ); // -> true
459
- * marker.is( 'model:marker' ); // -> true
460
- *
461
- * marker.is( 'view:element' ); // -> false
462
- * marker.is( 'documentSelection' ); // -> false
463
- *
464
- * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
465
- *
466
- * @param {String} type
467
- * @returns {Boolean}
468
- */
394
+ // The magic of type inference using `is` method is centralized in `TypeCheckable` class.
395
+ // Proper overload would interfere with that.
469
396
  Marker.prototype.is = function (type) {
470
397
  return type === 'marker' || type === 'model:marker';
471
398
  };