[whatwg] Control over selection direction

Ian Hickson ian at hixie.ch
Fri May 6 15:28:35 PDT 2011


On Fri, 6 May 2011, Ryosuke Niwa wrote:
> On Fri, May 6, 2011 at 2:56 PM, Ian Hickson <ian at hixie.ch> wrote:
> >
> > On Windows, sure, it should default to "forward" just like the spec 
> > says. But on Mac, it should default to "none", since otherwise the 
> > behaviour is inconsistent with the platform selection behaviour.
> 
> Why is it inconsistent? DOM Selection works the same way in WebKit.  
> The only case you get non-directional selection in WebKit is if a user 
> set selection by mouse.

It's inconsistent with how selections work on Mac. Open TextEdit, type in 
the string "aouiaoueioethaoieiaoe", press Command+F, type "tha", hit 
Enter, and check to see what direction the selection is. It's not a 
forward selection, it's a default non-directional selection.

IMHO anything in the DOM API that is defaulting newly created selections 
to "'forward' is buggy, since that doesn't match the platform.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list