[whatwg] Selection events in editable content
timdown at gmail.com
Tue May 10 08:55:48 PDT 2011
On 10 May 2011 16:42, Ryosuke Niwa <rniwa at webkit.org> wrote:
> On Tue, May 10, 2011 at 8:33 AM, Ojan Vafai <ojan at chromium.org> wrote:
>> What's the difference between selectstart and selectionchange in WebKit?
>> In IE is this case the only difference between the two?
> selectstart fires before selection changes, it bubbles, and it's cancelable.
> So it's very useful if you want to prevent selection. But the event isn't
> useful as much as it could be because it doesn't tell you what new selection
> is so we might want to consider adding new property like newSelectionRanges
> that tells you what new selection will be.
> - Ryosuke
newSelectionRanges on its own wouldn't be as useful as possible, since
it tells you nothing about the selection direction. You could cover
this by adding newSelectionFocusNode, newSelectionFocusOffset,
newSelectionAnchorNode and newSelectionAnchorOffset as well.
More information about the whatwg