<rdar://problem/10336700> Add API to get rendered text image without having to select it
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Nov 2011 21:46:01 +0000 (21:46 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Nov 2011 21:46:01 +0000 (21:46 +0000)
commitad793a48812b10fa18418cbb496c7d08eea4ae42
tree730677b39cf794c7189782b24a97634313c6c9d3
parent894d35408c87a819ef3da2a80a669255c29b4e8e
<rdar://problem/10336700> Add API to get rendered text image without having to select it
https://bugs.webkit.org/show_bug.cgi?id=71407

Reviewed by Simon Fraser.

Source/WebCore:

Test: TestWebKitAPI/Tests/mac/RenderedImageFromDOMRange.mm

* bindings/objc/DOM.mm:
(-[DOMRange renderedImageForcingBlackText:]): Added.
* bindings/objc/DOMPrivate.h:
* page/Frame.h:
* page/mac/FrameMac.mm:
(WebCore::Frame::rangeImage): Added. Sets the selection in the RenderView (only) based on the
given range and gets a selection-only rendering of the view, then restores the selection.
* rendering/RenderView.cpp:
(WebCore::RenderView::setSelection): Skip all invalidation if the repaint behavior is RepaintNothing.
(WebCore::RenderView::getSelection): Added this getter.
* rendering/RenderView.h:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/mac/RenderedImageFromDOMRange.mm: Added.
(-[RenderedImageFromDOMRangeFrameLoadDelegate webView:didFinishLoadForFrame:]):
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@99099 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/bindings/objc/DOM.mm
Source/WebCore/bindings/objc/DOMPrivate.h
Source/WebCore/page/Frame.h
Source/WebCore/page/mac/FrameMac.mm
Source/WebCore/rendering/RenderView.cpp
Source/WebCore/rendering/RenderView.h
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/mac/RenderedImageFromDOMRange.mm [new file with mode: 0644]