[webkit-dev] programmatic text selection
sgendler at ideasculptor.com
Fri May 26 14:12:08 PDT 2006
Thanks Giacomo - I think your original example had a typo (the 1 as a
last parameter), as the page you provided works great (a 0 as the last
One question - how does one select a node which has no sibling?
Putting the same node as both node parameters to setBaseAndExtent has
On 5/26/06, Giacomo Luca Maioli <luca at tricheco.net> wrote:
> > On 5/26/06, Giacomo Luca Maioli <luca at tricheco.net> wrote:
> >> >> But Safari throws an error while processing the last method (the
> >> one which actually highlight text), so you should try:
> >> >> window.getSelection().setBaseAndExtent(selDiv, 0, selDiv, 1);
> >> So you'll only need to play around with this (strange and mostly
> >> unknown) method.
> > I'm afraid Safari doesn't appear to support setBaseAndExtent() method
> > on a selection, either.
> I just tested the code on both Firefox and Safari. You can find a
> working example here:
> I'm using Safari Version 2.0.3 (417.9.3) and Firefox 18.104.22.168 on Mac
> and Windows.
> webkit-dev mailing list
> webkit-dev at opendarwin.org
More information about the webkit-dev