2009-01-08 Darin Adler <darin@apple.com>
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Jan 2009 20:59:59 +0000 (20:59 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Jan 2009 20:59:59 +0000 (20:59 +0000)
commitadebe9682c38aeed677c2724f60bfbf52f12a59e
treee524a261353e2c5ad7b544e167086e79aa176393
parenta9aeeb2d78ae2ddce09b2bdcfe91cc04c7aba2b0
2009-01-08  Darin Adler  <darin@apple.com>

        Reviewed by Tim Hatcher.

        Bug 23185: add a currentRange method to the WebTextIterator SPI
        https://bugs.webkit.org/show_bug.cgi?id=23185
        rdar://problem/6455834

        I also noticed a garbage-collection-related threading issue that I fixed, and
        that the SPI for getting text was unnecessarily inefficient, so I fixed that too.

        * WebView/WebTextIterator.h: Moved currentNode and currentText into a "deprecated"
        category. Added currentTextPointer and currentTextLength.

        * WebView/WebTextIterator.mm: Changed m_textIterator into an OwnPtr, and also
        used _textIterator to be consistent with ObjC rather than C++ naming.
        (+[WebTextIteratorPrivate initialize]): Added. Calls WebCoreObjCFinalizeOnMainThread,
        since the finalize method here works with main-thread only WebCore objects.
        (-[WebTextIterator initWithRange:]): Changed since _textIterator is an OwnPtr now.
        (-[WebTextIterator advance]): Changed name of m_textIterator. Removed null assertion,
        since I don't think it provides much value.
        (-[WebTextIterator atEnd]): Ditto.
        (-[WebTextIterator currentRange]): Added.
        (-[WebTextIterator currentTextPointer]): Added.
        (-[WebTextIterator currentTextLength]): Added.
        (-[WebTextIterator currentNode]): Did same as above, but also put into new category.
        (-[WebTextIterator currentText]): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@39715 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKit/mac/ChangeLog
WebKit/mac/WebView/WebTextIterator.h
WebKit/mac/WebView/WebTextIterator.mm