[Webkit-unassigned] [Bug 22025] range.deleteContents() does not collapse the selection

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 16 17:11:56 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=22025





------- Comment #4 from eric at webkit.org  2009-03-16 17:11 PDT -------
        window.getSelection().getRangeAt(0).setEnd(mybody, 0);
        window.getSelection().getRangeAt(0).setStart(mybody, 0);

That code only works in FF.  Ranges returned from getRangeAt() in WebKit are
not tied to the Selection object like they are in Firefox.  So you end up
modifying a temporary range object, not the selection itself.

You can use setBaseAndExtent to modify the selection in WebKit.

We're currently considering redesigning the whole Selection API, since
Firefox's is rather confusing (and IE's is similarly confusing, and WebKit's is
a strange broken hybrid of the two)


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list