[Webkit-unassigned] [Bug 66681] Need API for getting surrounding text from webkit in chromium
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Aug 24 12:22:47 PDT 2011
https://bugs.webkit.org/show_bug.cgi?id=66681
--- Comment #12 from Peng Huang <penghuang at chromium.org> 2011-08-24 12:22:47 PST ---
(In reply to comment #4)
> (From update of attachment 104692 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=104692&action=review
>
> > Source/WebKit/chromium/src/WebViewImpl.cpp:1539
> > + anchor = TextIterator::rangeLength(testRange.get());
> > +
> > + ExceptionCode ec;
> > + testRange->setEnd(selection->extent().containerNode(), selection->extent().offsetInContainerNode(), ec);
> > + cursor = TextIterator::rangeLength(testRange.get());
>
> You should call TextIterator::locationAndLengthFromRange instead.
In this case, cursor and anchor is not a range object, and the order of cursor and anchor is not same (depends on the direction of the selection). So I think using TextIterator::rangeLength() directly is simpler and efficient. What do you think?
--
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