[whatwg] selection.modify behavior across platforms
Simetrical+w3c at gmail.com
Tue Mar 29 11:26:19 PDT 2011
On Mon, Mar 28, 2011 at 7:09 PM, Ehsan Akhgari <ehsan at mozilla.com> wrote:
> I was talking about the way that the spell checking dialog works in OpenOffice Writer, for example. The selection would be visible on the screen, and its contents might get changed if the user chooses to. But spell checking is just one example where Selection.modify might be useful. Let's not get distracted from the main discussion.
I'd say figuring out what are use-cases are is the first step we
should be having in the main discussion, because without that, we
won't have any basis on which to decide how the feature should work.
> Here's a possible use case: https://bugzilla.mozilla.org/show_bug.cgi?id=496275#c10
The use-case suggested there is to expose to authors a generic way of
detecting word/sentence boundaries across languages. For this
use-case, you certainly want platform-independent behavior, but you
also wouldn't want the API to be tied to selections. You'd want to be
able to do things like count the number of words of sentences in a run
of text, that sort of thing. So Range would be a better place to put
it. Or maybe it would be better to expose it as an API that operates
only on strings, without touching the DOM at all. Depends what people
would want to use the API for.
More information about the whatwg