Changeset 19920 in webkit


Ignore:
Timestamp:
Feb 28, 2007 3:46:58 PM (17 years ago)
Author:
bdakin
Message:

Reviewed by Brady.

Fix for http://bugs.webkit.org/show_bug.cgi?id=12923 REGRESSION:
Assertion failure copying standalone image

  • platform/mac/PasteboardMac.mm: (WebCore::Pasteboard::writeImage): Use the CachedImage as the resource. This makes more sense anyway. There is no need to null- check the renderer or the CachedImage since we return early if there is no Image* and the HitTestResult::image() function checks for these things.
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r19919 r19920  
     12007-02-28  Beth Dakin  <bdakin@apple.com>
     2
     3        Reviewed by Brady.
     4
     5        Fix for http://bugs.webkit.org/show_bug.cgi?id=12923 REGRESSION:
     6        Assertion failure copying standalone image
     7
     8        * platform/mac/PasteboardMac.mm:
     9        (WebCore::Pasteboard::writeImage): Use the CachedImage as the
     10        resource. This makes more sense anyway. There is no need to null-
     11        check the renderer or the CachedImage since we return early if
     12        there is no Image* and the HitTestResult::image() function checks
     13        for these things.
     14
    1152007-02-28  Adele Peterson  <adele@apple.com>
    216
  • trunk/WebCore/platform/mac/PasteboardMac.mm

    r19764 r19920  
    2727#import "Pasteboard.h"
    2828
    29 #import "Cache.h"
    3029#import "CachedResource.h"
    3130#import "CharacterNames.h"
     
    4039#import "LoaderNSURLExtras.h"
    4140#import "MimeTypeRegistry.h"
     41#import "RenderImage.h"
    4242#import "RetainPtr.h"
    4343#import "WebCoreNSStringExtras.h"
     
    279279    ASSERT(URL);
    280280
     281    Node* node = result.innerNonSharedNode();
     282    if (!node)
     283        return;
     284
    281285    NSString *title = result.altDisplayString().isNull() ? nil : (NSString*)(result.altDisplayString());
    282     Frame* frame = result.innerNonSharedNode()->document()->frame();
     286    Frame* frame = node->document()->frame();
    283287
    284288    writeURL(URL, title, frame, true);
     
    286290    [m_pasteboard declareTypes:types owner:nil];
    287291
    288     NSImage *image = (NSImage *)(result.image() ? result.image()->getNSImage() : nil);
    289     ASSERT(image);
    290     [m_pasteboard setData:[image TIFFRepresentation] forType:NSTIFFPboardType];
    291 
    292     CachedResource* imageResource = WebCore::cache()->resourceForURL(result.absoluteImageURL().url());
     292    Image* coreImage = result.image();
     293    ASSERT(coreImage);
     294    if (!coreImage)
     295        return;
     296    [m_pasteboard setData:[coreImage->getNSImage() TIFFRepresentation] forType:NSTIFFPboardType];
     297
     298    RenderImage* renderer = static_cast<RenderImage*>(node->renderer());
     299    CachedResource* imageResource = static_cast<CachedResource*>(renderer->cachedImage());
    293300    ASSERT(imageResource);
    294301    String MIMEType = imageResource->response().mimeType();
Note: See TracChangeset for help on using the changeset viewer.