X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fcore%2Fdom%2Fwalker.js;h=ae9dfec31e1dcda5df1218ea0966a727c608ae70;hp=1bf0eab1c65e5ec8245af210d021a7e68c3f6479;hb=039a051ccf3901311661022a30afd60fc38130c9;hpb=c9fdde67e6384bd5a66adc2b3bba5c4ce9db56c7 diff --git a/_source/core/dom/walker.js b/_source/core/dom/walker.js index 1bf0eab..ae9dfec 100644 --- a/_source/core/dom/walker.js +++ b/_source/core/dom/walker.js @@ -261,7 +261,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license */ previous : function() { - return iterate.call( this, true ); + return iterate.call( this, 1 ); }, /** @@ -271,7 +271,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license */ checkForward : function() { - return iterate.call( this, false, true ) !== false; + return iterate.call( this, 0, 1 ) !== false; }, /** @@ -281,7 +281,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license */ checkBackward : function() { - return iterate.call( this, true, true ) !== false; + return iterate.call( this, 1, 1 ) !== false; }, /** @@ -303,7 +303,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license */ lastBackward : function() { - return iterateToLast.call( this, true ); + return iterateToLast.call( this, 1 ); }, reset : function() @@ -374,7 +374,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { return ( node && node.getName && node.getName() == 'span' - && node.hasAttribute('_cke_bookmark') ); + && node.hasAttribute( '_cke_bookmark' ) ); } return function( node ) @@ -385,7 +385,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license && isBookmarkNode( parent ) ); // Is bookmark node? isBookmark = contentOnly ? isBookmark : isBookmark || isBookmarkNode( node ); - return isReject ^ isBookmark; + return !! ( isReject ^ isBookmark ); }; }; @@ -399,7 +399,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { var isWhitespace = node && ( node.type == CKEDITOR.NODE_TEXT ) && !CKEDITOR.tools.trim( node.getText() ); - return isReject ^ isWhitespace; + return !! ( isReject ^ isWhitespace ); }; }; @@ -418,20 +418,20 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // 'offsetHeight' instead of 'offsetWidth' for properly excluding // all sorts of empty paragraph, e.g.
. var isInvisible = whitespace( node ) || node.is && !node.$.offsetHeight; - return isReject ^ isInvisible; + return !! ( isReject ^ isInvisible ); }; }; var tailNbspRegex = /^[\t\r\n ]*(?: |\xa0)$/, - isNotWhitespaces = CKEDITOR.dom.walker.whitespaces( true ), - isNotBookmark = CKEDITOR.dom.walker.bookmark( false, true ), + isNotWhitespaces = CKEDITOR.dom.walker.whitespaces( 1 ), + isNotBookmark = CKEDITOR.dom.walker.bookmark( 0, 1 ), fillerEvaluator = function( element ) { return isNotBookmark( element ) && isNotWhitespaces( element ); }; // Check if there's a filler node at the end of an element, and return it. - CKEDITOR.dom.element.prototype.getBogus = function () + CKEDITOR.dom.element.prototype.getBogus = function() { var tail = this.getLast( fillerEvaluator ); if ( tail && ( !CKEDITOR.env.ie ? tail.is && tail.is( 'br' )