[Webkit-unassigned] [Bug 25898] [Gtk] object:text-changed events should be emitted for entries and password text

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 8 10:33:29 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=25898





--- Comment #74 from Mario Sanchez Prada <msanchez at igalia.com>  2010-09-08 10:33:28 PST ---
(In reply to comment #73)
> > I'm afraid you're right, although I still can't see clearly how to do that in the way you suggest. For instance, how do I get the range associated to the full text in a text entry so I can truly know the offset for a given position, even if that text is internally represented by different text nodes?
> > 
> > If you could ellaborate a bit more on this topic, I'd certainly appreciate it quite a lot.
> > Thanks in advance.
> 
> Take a look at the static methods in TextIterator:
>     static int rangeLength(const Range*, bool spacesForReplacedElements = false);
>     static PassRefPtr<Range> rangeFromLocationAndLength(Element* scope, int rangeLocation, int rangeLength, bool spacesForReplacedElements = false);
>     static PassRefPtr<Range> subrange(Range* entireRange, int characterOffset, int characterCount);
> Examples of their use can be found in various places in the editing code. Take a look at IndentOutdentCommand.cpp for an example of use of rangeFromLocationAndLength.
> CompositeEditCommand.cpp has examples of use of rangeLenght, that should be fairly close to what you need.
> >

Thanks Enrica, that's just what I needed. As soon as I finish addressing other issues in other patches I'll try this out.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list