Selaa lähdekoodia

Added: parent property to model.DocumentFragment and view.DocumentFragment.

Szymon Cofalik 9 vuotta sitten
vanhempi
sitoutus
595c288d09

+ 10 - 0
packages/ckeditor5-engine/src/model/documentfragment.js

@@ -83,6 +83,16 @@ export default class DocumentFragment {
 		return this;
 	}
 
+	/**
+	 * Artificial parent of `DocumentFragment`. Returns `null`. Added for compatibility reasons.
+	 *
+	 * @readonly
+	 * @type {null}
+	 */
+	get parent() {
+		return null;
+	}
+
 	/**
 	 * Gets the child at the given index. Returns `null` if incorrect index was passed.
 	 *

+ 10 - 0
packages/ckeditor5-engine/src/view/documentfragment.js

@@ -71,6 +71,16 @@ export default class DocumentFragment {
 		return this;
 	}
 
+	/**
+	 * Artificial parent of `DocumentFragment`. Returns `null`. Added for compatibility reasons.
+	 *
+	 * @readonly
+	 * @type {null}
+	 */
+	get parent() {
+		return null;
+	}
+
 	/**
 	 * Returns ancestor elements of `DocumentFragment`, which is an empty array. Added for compatibility reasons.
 	 *