Well, 'selecting' and 'highlighting' can mean a few different things, I guess.

It depends on the browser (sigh).  In Chrome 13 and IE 9, you can use the mouse 
to select the contents of svg <text> elements, much like you can with text from 
standard HTML.  FF 6 doesn't appear to do this.

(At least in Chome) you can access that selection via the getSelection() 
function. The actual selected portions of the document are available as 
selectionRange objects.
 Something like:
 var range = window.getSelection().getRangeAt(0);
 
(At leat in Chrome), the actual selected text is in the .data member.
 
  In standard HTML you should be able to programmatically select text by using 
something like window.getSelection().addRange(newRange);  
I don't know that this does with SVG text and textrange objects>.

 
--- In svg-developers@yahoogroups.com, "dark3251" <dark3251@...> wrote:
>
> Correct me if I'm wrong, but I think the only way it's even possible to 
> highlight text is to make some makeshift functions that create <tspans> and 
> change colors manually. 
> 
> The more I look at the spec, it seems like these focus events seem to be 
> associated with text even though they are on all primitives. Perhaps they are 
> pseudo attributes that will be implemented later? I don't know...
> 
> --- In svg-developers@yahoogroups.com, "Chris Peto" <svgdev@> wrote:
> >
> > This brings up a good question.  When the user does highlight text, how can
> > we get that event (onfocusin?) and text that they have highlighted?
> > 
> >  
> > 
> > From: svg-developers@yahoogroups.com [mailto:svg-developers@yahoogroups.com]
> > On Behalf Of random_transform
> > Sent: Donnerstag, 15. September 2011 18:39
> > To: svg-developers@yahoogroups.com
> > Subject: [svg-developers] Re: No Keyboard Events
> > 
> >  
> > 
> >   
> > 
> > The onfocusin event seems to fire (in IE 9) when one selects text (as when
> > highlighting text with a mouse while preparing to copy it). I don't see it
> > firing in FF 6 or Chrome 13, though.
> > 
> > --- In svg-developers@yahoogroups.com
> > <mailto:svg-developers%40yahoogroups.com> , "dark3251" <dark3251@> wrote:
> > >
> > > I am very thankful for all the answers I have received. I still have not
> > received a full answer as to what the SVG event attributes "onfocusin" and
> > "onfocusout" are all about. I would love to see an example of these in
> > action.
> > > 
> > > Thanks
> > > 
> > > --- In svg-developers@yahoogroups.com
> > <mailto:svg-developers%40yahoogroups.com> , "dark3251" <dark3251@> wrote:
> > > >
> > > > Am I right to assume there are no keyboard events associated with SVG at
> > this time? I see nothing in the specifications although the confusing thing
> > to me is that I see events describing "focus" as if there were keyboard
> > events (e.g. onfocusin/out). Am I just misunderstanding the meaning of focus
> > here?
> > > >
> > >
> > 
> >  
> > 
> > 
> > 
> > [Non-text portions of this message have been removed]
> >
>




------------------------------------

-----
To unsubscribe send a message to: svg-developers-unsubscr...@yahoogroups.com
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
----Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/svg-developers/join
    (Yahoo! ID required)

<*> To change settings via email:
    svg-developers-dig...@yahoogroups.com 
    svg-developers-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    svg-developers-unsubscr...@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to