Bug 23886

Summary: JS Range object should support ==
Product: WebKit Reporter: Eric Seidel (no email) <eric>
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Severity: Normal CC: jparent, justin.garcia, ojan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Macintosh   
OS: OS X 10.5   

Description Eric Seidel (no email) 2009-02-10 18:25:56 PST
JS Range object should support ==

IMO document.createRange() == document.createRange() should return true.

var range1 = document.createRange();
range1.setStart(textNode, 0);
range1.setEnd(textNode, 1);
var range2 = document.createRange();
range2.setStart(textNode, 0);
range2.setEnd(textNode, 1);

range1 == range2 should return true
range1 === range2 should return false

var range1 = document.createRange()
var range2 = range1.cloneRange();

range1 == range2
should return true

FF does not support this behavior, but it makes sense from a user perspective.  Maybe it doesn't make sense from a JS language perspective?
Comment 1 Eric Seidel (no email) 2009-02-10 18:27:55 PST
Of course then, what do we do if someone sets custom JS attributes on the Range.
Comment 2 Eric Seidel (no email) 2009-02-10 18:30:15 PST
Hum.. ECMAScript seems to disagree with me:

So sad.