Skip to content
  • mitz@apple.com's avatar
    <rdar://problem/10336700> Add API to get rendered text image without having to select it · ea2b2379
    mitz@apple.com authored
    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: http://svn.webkit.org/repository/webkit/trunk@99099 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    ea2b2379