瀏覽代碼

Added a note to the checkChild() method.

Piotrek Koszuliński 7 年之前
父節點
當前提交
a3f4bd25d6
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      packages/ckeditor5-engine/src/model/schema.js

+ 5 - 0
packages/ckeditor5-engine/src/model/schema.js

@@ -375,6 +375,11 @@ export default class Schema {
 	 *		} );
 	 *		schema.checkChild( model.document.getRoot(), paragraph ); // -> true
 	 *
+	 * Note: When verifying whether the given node can be a child of the given context,
+	 * schema also verifies the entire context – from its root to its last element. Therefore, it is possible
+	 * for `checkChild()` to return `false` even though context's last element can contain the checked child.
+	 * It happens if one of the context's elements does not allow its child.
+	 *
 	 * @fires checkChild
 	 * @param {module:engine/model/schema~SchemaContextDefinition} context Context in which the child will be checked.
 	 * @param {module:engine/model/node~Node|String} def The child to check.