0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2025-01-03 05:00:13 -05:00

Tidy IE8 range code.

This commit is contained in:
Neil Jenkins 2012-07-24 15:54:05 +10:00
parent c964a6a564
commit 630a7c4e4f
2 changed files with 5 additions and 7 deletions

File diff suppressed because one or more lines are too long

View file

@ -16,7 +16,6 @@ var indexOf = Array.prototype.indexOf;
var START_TO_START = 0; var START_TO_START = 0;
var START_TO_END = 1; var START_TO_END = 1;
var END_TO_END = 2;
var END_TO_START = 3; var END_TO_START = 3;
var contains = function ( a, b ) { var contains = function ( a, b ) {
@ -342,13 +341,12 @@ var getTextRangeBoundaryPosition = function (
if ( nextNode && isCharacterDataNode( nextNode ) ) { if ( nextNode && isCharacterDataNode( nextNode ) ) {
boundaryPosition = new DomPosition( nextNode, 0 ); boundaryPosition = new DomPosition( nextNode, 0 );
} else if ( previousNode && isCharacterDataNode( previousNode ) ) { } else if ( previousNode && isCharacterDataNode( previousNode ) ) {
// Strange bug; if we don't read the data property, the length // Strange bug: if we don't read the data property, the length
// property is often returned incorrectly as 0. Don't ask me why. // property is often returned incorrectly as 0. Don't ask me why.
/*jshint expr: true */ // Therefore get the length from the data property rather than
previousNode.data; // reading it directly from the node.
/*jshint expr: false */
boundaryPosition = new DomPosition( boundaryPosition = new DomPosition(
previousNode, previousNode.length ); previousNode, previousNode.data.length );
} else { } else {
boundaryPosition = new DomPosition( boundaryPosition = new DomPosition(
containerElement, containerElement,