Bug 23886 - JS Range object should support ==
Summary: JS Range object should support ==
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-10 18:25 PST by Eric Seidel (no email)
Modified: 2009-02-10 18:30 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.

Moreover:
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

Likewise:
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:
http://bclary.com/2004/11/07/#a-11.9.3

So sad.