[whatwg] Selection events in editable content

Ojan Vafai ojan at chromium.org
Tue May 10 09:03:15 PDT 2011

On Tue, May 10, 2011 at 8:55 AM, Tim Down <timdown at gmail.com> wrote:

> 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.

Could we just put a Selection object on the event? That way, if we add new
fields to Selections, we won't need to add new fields to the selectstart

More information about the whatwg mailing list