W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2011

[whatwg] selection.modify behavior across platforms

From: Ryosuke Niwa <rniwa@webkit.org>
Date: Fri, 25 Mar 2011 23:51:50 -0700
Message-ID: <AANLkTikpyA+uHH-sD6J7RVUvHhA9HNCpqCcTVg7RCP20@mail.gmail.com>
On Fri, Mar 25, 2011 at 10:46 PM, Ehsan Akhgari <ehsan at mozilla.com> wrote:
>
> But with the behavior of the API changing based on the platform, the author
> can either choose to sniff the UA string, or check what the API did after
> calling it.  The scarier scenario is the author testing their application on
> one platform, and deploying it without realizing that it will break in other
> platforms.
>

I'm not sure why we need to provide a consistent behavior all platforms.  I
think the whole point of modify() function is so that scripts can emulate
selection operations user can initiate.  Imagine an app that intercepts user
actions such as key down and manually sets selection using modify() because
it needs to update some internal state, etc... in such applications, it's
extremely desirable that the result of modify() to match what user does.

I think if we want to have the platform specific word selection capability
> in the API, we should have a different granularity value which points out
> that its results are platform specific.  Otherwise, it's just too easy to
> assume that the result of calling this API is

the same across all platforms, just like almost all other Web APIs.
>

Our implementation of modify() is already platform-specific in many ways. I
personally don't see a point in making this specific case
platform-independent.

- Ryosuke
Received on Friday, 25 March 2011 23:51:50 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:31 UTC