Skip to content

Commit

Permalink
Reverted unnecessary changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
mlewand committed Sep 5, 2018
1 parent 17f6981 commit 7da825e
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions core/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -788,12 +788,9 @@ CKEDITOR.STYLE_OBJECT = 3;
);
}

function isElement( currentNode ) {
return currentNode && currentNode.type == CKEDITOR.NODE_ELEMENT;
}

function isReadonlyOrEmptyElement( currentNode, nodeIsReadonly ) {
return nodeIsReadonly || ( isElement( currentNode ) && !currentNode.getChildCount() );
function checkIfTextOrReadonlyOrEmptyElement( currentNode, nodeIsReadonly ) {
var nodeType = currentNode.type;
return nodeType == CKEDITOR.NODE_TEXT || nodeIsReadonly || ( nodeType == CKEDITOR.NODE_ELEMENT && !currentNode.getChildCount() );
}

// Checks if position is a subset of posBitFlags and that nodeA fulfills style def rule.
Expand Down Expand Up @@ -908,8 +905,8 @@ CKEDITOR.STYLE_OBJECT = 3;
}

// Non element nodes, readonly elements, or empty
// elements can be added completely to the range (#2294).
if ( !isElement( currentNode ) || isReadonlyOrEmptyElement( currentNode, nodeIsReadonly ) ) {
// elements can be added completely to the range.
if ( checkIfTextOrReadonlyOrEmptyElement( currentNode, nodeIsReadonly ) ) {
var includedNode = currentNode;
var parentNode;

Expand Down

0 comments on commit 7da825e

Please sign in to comment.