Show
Ignore:
Timestamp:
04/24/07 00:54:31 (3 years ago)
Author:
ydnar
Message:

bugid:47825; fixed logic flaw that would return all child nodes of a single parent (like body) if selection was zero-length

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/common/SelectionRange.js

    r152 r154  
    170170            return nodes; 
    171171        nodes.push( this.startContainer ); 
    172         if( this.startContainer === this.endContainer && !this.startContainer.firstChild ) 
     172        if( this.startContainer === this.endContainer && 
     173            (this.startOffset == this.endOffset || !this.startContainer.firstChild) ) 
    173174            return nodes; 
    174175        var proxy = new DOM.Proxy( this.startContainer );