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

[whatwg] Control over selection direction

From: Marijn Haverbeke <marijnh@gmail.com>
Date: Fri, 14 Jan 2011 11:16:03 +0100
Message-ID: <AANLkTi=sEVgzUynFiZMQbbp7iW+kgVp920Lrmz5UBZKt@mail.gmail.com>
Another relevant precedent is window.getSelection().modify (Webkit and
Gecko-2 specific), which uses the strings "forward" and "backward" to
specify the direction in which to alter the selection. English is not
my native language, and I'm not sure what the semantic difference
between "forward" and "forwards" is, but I do expect people to
misremember which one we end up using, and use the other one. Would it
make sense to accept both the with-s and the without-s versions, or is
that kind of do-what-mean stuff not HTML5-style?

(This .modify method can, by the way, already be used, on the browsers
that support it, to create reversed selections by setting a collapsed
selection at the end of the desired selection, and then calling
getSelection().modify("extend", "backward", "character") X times to
adjust the start to the desired point. This is, unfortunately,
horribly slow, and quite clunky.)
Received on Friday, 14 January 2011 02:16:03 UTC

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