@ckeditor/ckeditor5-engine 43.0.0-alpha.6 → 43.1.0-alpha.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.
package/dist/index.js CHANGED
@@ -11157,7 +11157,12 @@ function getFiles(nativeDataTransfer) {
11157
11157
  if (name === 'class') {
11158
11158
  this._writer.addClass(value.split(' '), viewRoot);
11159
11159
  } else {
11160
- this._writer.setAttribute(name, value, viewRoot);
11160
+ // There is a chance that some attributes have already been set on the view root before attaching
11161
+ // the DOM root and should be preserved. This is a similar case to the "class" attribute except
11162
+ // this time there is no workaround using a some low-level API.
11163
+ if (!viewRoot.hasAttribute(name)) {
11164
+ this._writer.setAttribute(name, value, viewRoot);
11165
+ }
11161
11166
  }
11162
11167
  }
11163
11168
  this._initialDomRootAttributes.set(domRoot, initialDomRootAttributes);
@@ -30121,7 +30126,17 @@ LivePosition.prototype.is = function(type) {
30121
30126
  // We removed `howMany` old nodes, update `oldChildrenHandled`.
30122
30127
  oldChildrenHandled += change.howMany;
30123
30128
  } else {
30124
- diff.push(...'a'.repeat(change.howMany).split(''));
30129
+ // Total maximum amount of arguments that can be passed to `Array.prototype.push` may be limited so we need to
30130
+ // add them manually one by one to avoid this limit. However loop might be a bit slower than `push` method on
30131
+ // smaller changesets so we need to decide which method to use based on the size of the change.
30132
+ // See: https://github.com/ckeditor/ckeditor5/issues/16819
30133
+ if (change.howMany > 1500) {
30134
+ for(let i = 0; i < change.howMany; i++){
30135
+ diff.push('a');
30136
+ }
30137
+ } else {
30138
+ diff.push(...'a'.repeat(change.howMany).split(''));
30139
+ }
30125
30140
  // The last handled offset is at the position after the changed range.
30126
30141
  offset = change.offset + change.howMany;
30127
30142
  // We changed `howMany` old nodes, update `oldChildrenHandled`.