src/modules/rangy-textrange.js
function() {
            if (!this.prepopulatedChar) {
                this.prepopulateChar();
            }
            if (this.checkForTrailingSpace) {
                var trailingSpace = this.session.getNodeWrapper(this.node.childNodes[this.offset - 1]).getTrailingSpace();
                log.debug("resolveLeadingAndTrailingSpaces checking for trailing space on " + this.inspect() + ", got '" + trailingSpace + "'");
                if (trailingSpace) {
                    this.isTrailingSpace = true;
                    this.character = trailingSpace;
                    this.characterType = COLLAPSIBLE_SPACE;
                }
                this.checkForTrailingSpace = false;
            }
            if (this.checkForLeadingSpace) {
                var leadingSpace = this.session.getNodeWrapper(this.node.childNodes[this.offset]).getLeadingSpace();
                log.debug("resolveLeadingAndTrailingSpaces checking for leading space on " + this.inspect() + ", got '" + leadingSpace + "'");
                if (leadingSpace) {
                    this.isLeadingSpace = true;
                    this.character = leadingSpace;
                    this.characterType = COLLAPSIBLE_SPACE;
                }
                this.checkForLeadingSpace = false;
            }
        }
function() {
            if (!this.prepopulatedChar) {
                this.prepopulateChar();
            }
            if (this.checkForTrailingSpace) {
                var trailingSpace = this.session.getNodeWrapper(this.node.childNodes[this.offset - 1]).getTrailingSpace();
                log.debug("resolveLeadingAndTrailingSpaces checking for trailing space on " + this.inspect() + ", got '" + trailingSpace + "'");
                if (trailingSpace) {
                    this.isTrailingSpace = true;
                    this.character = trailingSpace;
                    this.characterType = COLLAPSIBLE_SPACE;
                }
                this.checkForTrailingSpace = false;
            }
            if (this.checkForLeadingSpace) {
                var leadingSpace = this.session.getNodeWrapper(this.node.childNodes[this.offset]).getLeadingSpace();
                log.debug("resolveLeadingAndTrailingSpaces checking for leading space on " + this.inspect() + ", got '" + leadingSpace + "'");
                if (leadingSpace) {
                    this.isLeadingSpace = true;
                    this.character = leadingSpace;
                    this.characterType = COLLAPSIBLE_SPACE;
                }
                this.checkForLeadingSpace = false;
            }
        }
function ( ) { if ( ! this . prepopulatedChar ) { this . prepopulateChar ( ) ; } if ( this . checkForTrailingSpace ) { var trailingSpace = this . session . getNodeWrapper ( this . node . childNodes [ this . offset - 1 ] ) . getTrailingSpace ( ) ; log . debug ( "resolveLeadingAndTrailingSpaces checking for trailing space on " + this . inspect ( ) + ", got '" + trailingSpace + "'" ) ; if ( trailingSpace ) { this . isTrailingSpace = true ; this . character = trailingSpace ; this . characterType = COLLAPSIBLE_SPACE ; } this . checkForTrailingSpace = false ; } if ( this . checkForLeadingSpace ) { var leadingSpace = this . session . getNodeWrapper ( this . node . childNodes [ this . offset ] ) . getLeadingSpace ( ) ; log . debug ( "resolveLeadingAndTrailingSpaces checking for leading space on " + this . inspect ( ) + ", got '" + leadingSpace + "'" ) ; if ( leadingSpace ) { this . isLeadingSpace = true ; this . character = leadingSpace ; this . characterType = COLLAPSIBLE_SPACE ; } this . checkForLeadingSpace = false ; } }
Resolve leading and trailing spaces, which may involve prepopulating other positions
Resolve leading and trailing spaces which may involve prepopulating other positions