W3C home > Mailing lists > Public > public-editing-tf@w3.org > February 2016

Re: [Editing] Replacing `targetRanges` on `InputEvent` by `getTargetRanges`

From: Ojan Vafai <ojan@google.com>
Date: Wed, 10 Feb 2016 04:15:17 +0000
Message-ID: <CANMdWTuAixBx1PbAdzEVLgs-v_M=XyzYX5yW9xnMqcBPuoXTyA@mail.gmail.com>
To: Enrica Casucci <enrica@apple.com>, Ryosuke Niwa <rniwa@apple.com>
Cc: public-editing-tf <public-editing-tf@w3.org>, Grisha Lyukshin <glyuk@microsoft.com>
Sorry for the delayed response...

I think we should not make targetRanges null. We should make it always
populated so that people use that instead of the selection. The upside
there is that their code will naturally work well in the context of IMEs
where using the browser selection won't.

On Tue, Jan 12, 2016 at 5:33 AM Enrica Casucci <enrica@apple.com> wrote:

> If it is used very seldom, one more reason to remove the parameter and
> just provide the method.
>
>         Enrica
>
> > On Jan 9, 2016, at 3:50 PM, Ryosuke Niwa <rniwa@apple.com> wrote:
> >
> > Hi all,
> >
> > We discussed about replacing `targetRanges` on `InputEvent` by
> `getTargetRanges` because an event listener of `beforeinput` event can
> mutate DOM and a subsequent event listener can receive a bad range.  There
> was another concern about the cost of computing the range upfront at the
> event dispatching time.
> >
> > However, it looks like `targetRanges` is almost always NULL except when
> `replaceContent` is used for spelling correction, etc... so perhaps we
> don't need to make this change.
> >
> > Do you remember any other reason why we needed a method instead?
> >
> > - R. Niwa
> >
>
>
Received on Wednesday, 10 February 2016 04:15:54 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 10 February 2016 04:15:55 UTC