Bug 23885 - window.getSelection().getRangeAt(0).setEnd will modify the selection in FF
Summary: window.getSelection().getRangeAt(0).setEnd will modify the selection in FF
Status: RESOLVED DUPLICATE of bug 15921
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-10 18:17 PST by Eric Seidel (no email)
Modified: 2009-02-11 08:19 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:17:48 PST
window.getSelection().getRangeAt(0).setEnd will modify the selection in FF

I don't think we want to support this.  But I'm pointing out here that we differ from FF in this behavior.  I will file a bug with FF once I come up with a nice test case (which I will attach here).

FF's getRangeAt function returns the same Range objects as were passed into addRange, meaning === returns true when compared with the range object passed into addRange.  Moreover, modifying the Range object returned by getRangeAt will modify the selection.

I don't know how many sites depend on this behavior (if any).  My vote is that we do not support this behavior and that we convince FF to change away from this confusing API, but I'd be very interested in hearing others opinions on the matter.
Comment 1 Alexey Proskuryakov 2009-02-11 08:19:40 PST

*** This bug has been marked as a duplicate of 15921 ***