X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fcore%2Fdom%2Frange.js;h=b43a82dbf08b520e0b23d271b2cab1dd355b0224;hp=584648496c9f964244d1804ba29a5656b727e834;hb=039a051ccf3901311661022a30afd60fc38130c9;hpb=c9fdde67e6384bd5a66adc2b3bba5c4ce9db56c7 diff --git a/_source/core/dom/range.js b/_source/core/dom/range.js index 5846484..b43a82d 100644 --- a/_source/core/dom/range.js +++ b/_source/core/dom/range.js @@ -3,6 +3,9 @@ Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ +/** + * @class + */ CKEDITOR.dom.range = function( document ) { this.startContainer = null; @@ -1300,7 +1303,8 @@ CKEDITOR.dom.range = function( document ) } } - var walker = new CKEDITOR.dom.walker( walkerRange ); + var walker = new CKEDITOR.dom.walker( walkerRange ), + isBookmark = CKEDITOR.dom.walker.bookmark(); walker.evaluator = function( node ) { @@ -1311,6 +1315,9 @@ CKEDITOR.dom.range = function( document ) var currentElement; walker.guard = function( node, movingOut ) { + if ( isBookmark( node ) ) + return true; + // Stop when we're shrink in element mode while encountering a text node. if ( mode == CKEDITOR.SHRINK_ELEMENT && node.type == CKEDITOR.NODE_TEXT ) return false; @@ -1429,7 +1436,7 @@ CKEDITOR.dom.range = function( document ) // Fixing invalid range end inside dtd empty elements. if( endNode.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$empty[ endNode.getName() ] ) - endNode = endNode.getParent(), endOffset = endNode.getIndex() + 1; + endOffset = endNode.getIndex() + 1, endNode = endNode.getParent(); this.endContainer = endNode; this.endOffset = endOffset; @@ -1864,17 +1871,13 @@ CKEDITOR.ENLARGE_ELEMENT = 1; CKEDITOR.ENLARGE_BLOCK_CONTENTS = 2; CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS = 3; -/** - * Check boundary types. - * @see CKEDITOR.dom.range.prototype.checkBoundaryOfElement - */ +// Check boundary types. +// @see CKEDITOR.dom.range.prototype.checkBoundaryOfElement CKEDITOR.START = 1; CKEDITOR.END = 2; CKEDITOR.STARTEND = 3; -/** - * Shrink range types. - * @see CKEDITOR.dom.range.prototype.shrink - */ +// Shrink range types. +// @see CKEDITOR.dom.range.prototype.shrink CKEDITOR.SHRINK_ELEMENT = 1; CKEDITOR.SHRINK_TEXT = 2;