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

[whatwg] Control over selection direction

From: Tim Down <timdown@gmail.com>
Date: Thu, 13 Jan 2011 10:51:03 +0000
Message-ID: <AANLkTimR-vXzV8eZizU9r7mTOfqf_sGNZQJ+wZkMY7y4@mail.gmail.com>
On 13 January 2011 08:48, Marijn Haverbeke <marijnh at gmail.com> wrote:
>> Rather than a single string property, how about integer
>> selectionAnchor and selectionFocus properties? This is then analogous
>> to Selection's anchorNode, anchorOffset, focusNode and focusOffset
>> properties and avoids an awkward string property.
>
> That seems to introduce the problem of having this integer match up
> with one of the ends. It's not a big problem, you could just ignore
> values that don't correspond to an end, but it seems to add
> unnecessary conceptual noise, since this is simply a two-valued piece
> of state. I don't think strings are all that awkward, but I guess
> that's a taste thing.

Fair enough, I think you may be right. Given that this is a binary
property of the selection state, how about a a Boolean
`selectionBackwards` property?

Tim
Received on Thursday, 13 January 2011 02:51:03 UTC

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