Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Added a note to the checkChild() method.
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed Jun 15, 2018
1 parent 648cd37 commit 8fcc831
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/model/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 8fcc831

Please sign in to comment.