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

[whatwg] Control over selection direction

From: Tim Down <timdown@gmail.com>
Date: Fri, 4 Feb 2011 12:00:11 +0000
Message-ID: <AANLkTi=fN-5ttBNwhW9zXArTveVwR1H96gua5k1kWQ0X@mail.gmail.com>
On 4 February 2011 11:07, Marijn Haverbeke <marijnh at gmail.com> wrote:
> See below for a revised proposal, based on the discussion here. To
> move this forward, I understand I must get some people to implement
> it. I'll probably eventually get to submitting a Firefox patch. If
> anyone reading this list knows the people who'd be able to make this
> happen on other browsers, please point them at it.
>
> -----
>
> element.selectionDirection [= value]
>
> Returns either "forward" or "backward", indicating which side of the
> selection is anchored. For "forward" it is the top, for "backward" the
> bottom.
>
> Can be set to one of these strings to change the side of the selection
> that counts as the anchor.
>
> [...]
>
> The selectionDirection attribute must, on getting, return one of the
> strings "forward" or "backward". "backward" is returned when the anchor, the
> fixed end, of the selection lies after the base, the movable end.
> "forward" is returned in all other cases.
>
> When set to "forward" when its current value is "backward", or set to
> "backward" when its current value is "forward", it must flip the roles of
> the ends of the selection, so that what used to be the anchor now
> becomes the base. When set to any other value, this is ignored.
>

I still prefer a Boolean (and therefore a change of name to
selectionBackwards or similar). I see no gain from using a string.
Otherwise, this seems like the best solution.

Tim
Received on Friday, 4 February 2011 04:00:11 UTC

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