|
|
@@ -829,9 +829,7 @@ function isUnvisitedBlock( element, visited ) {
|
|
|
|
|
|
visited.add( element );
|
|
|
|
|
|
- const document = element.is( 'rootElement' ) ? element.document : element.root.document;
|
|
|
-
|
|
|
- return document.model.schema.isBlock( element ) && element.parent;
|
|
|
+ return element.root.document.model.schema.isBlock( element ) && element.parent;
|
|
|
}
|
|
|
|
|
|
// Checks if the given element is a $block was not previously visited and is a top block in a range.
|
|
|
@@ -844,8 +842,7 @@ function isUnvisitedTopBlock( element, visited, range ) {
|
|
|
// Marks all ancestors as already visited to not include any of them later on.
|
|
|
function getParentBlock( position, visited ) {
|
|
|
const element = position.parent;
|
|
|
- const document = element.is( 'rootElement' ) ? element.document : element.root.document;
|
|
|
- const schema = document.model.schema;
|
|
|
+ const schema = element.root.document.model.schema;
|
|
|
|
|
|
const ancestors = position.parent.getAncestors( { parentFirst: true, includeSelf: true } );
|
|
|
|
|
|
@@ -891,8 +888,7 @@ function isTopBlockInRange( block, range ) {
|
|
|
// @param {module:engine/model/node~Node} node
|
|
|
// @returns {module:engine/model/node~Node|undefined}
|
|
|
function findAncestorBlock( node ) {
|
|
|
- const document = node.is( 'rootElement' ) ? node.document : node.root.document;
|
|
|
- const schema = document.model.schema;
|
|
|
+ const schema = node.root.document.model.schema;
|
|
|
|
|
|
let parent = node.parent;
|
|
|
|