RESOLVED FIXED 13044
Drag CSS image prints "Uncaught exception - Can't cache image" in Shell
https://bugs.webkit.org/show_bug.cgi?id=13044
Summary Drag CSS image prints "Uncaught exception - Can't cache image" in Shell
Charles Gaudette
Reported 2007-03-12 00:14:46 PDT
Present in, at least, r20108; dragging the web page's top most "text"* generates: <DATE> <TIME> Safari[PID] Uncaught exception - Can't cache image many times per second in the shell (I'm using tcsh and Terminal.app here) until the drag event ends. (The drag item has no outline as would normally be seen.) * The "text" is actually a GIF image loaded via the page's stylesheet: http://www.vechtwijk.nl/libraries/stylesheet.css http://www.vechtwijk.nl/var/images/header.gif I suspect that this issue has nothing to do with the image being that top, but rather it is with the way the image is loaded via CSS. Also note, the site's XHTML and CSS validate with the respective W3 validators. The issue is also seen at http://webkit.org/blog/ when double-clicking and dragging the page's Safari icon.
Attachments
Reduction (without background-image) (559 bytes, text/html)
2007-03-12 03:29 PDT, mitz
no flags
David Kilzer (:ddkilzer)
Comment 1 2007-03-12 02:48:39 PDT
I can't even drag the CSS images in a local debug build of WebKit r20106.
David Kilzer (:ddkilzer)
Comment 2 2007-03-12 03:06:21 PDT
(In reply to comment #1) > I can't even drag the CSS images in a local debug build of WebKit r20106. I still can't get a hold of the CSS images in r20112. Is there some setting in Safari that I'm missing that lets you grab CSS images?
mitz
Comment 3 2007-03-12 03:19:58 PDT
Backgrounds are not included in the drag image. I don't think this bug as anything to do with there being a background-image, though. It seems to be about the selection rect being empty and some drag-image code not liking empty rects. Another way to describe this bug is that there is a selection but you don't see anything being highlighted.
mitz
Comment 4 2007-03-12 03:29:35 PDT
Created attachment 13589 [details] Reduction (without background-image) Double-click inside the purple rect then drag it.
Charles Gaudette
Comment 5 2007-03-12 11:56:03 PDT
(In reply to comment #4) > Created an attachment (id=13589) [edit] Yes, the reduction demonstrates what I am seeing here. (Silly me for being lead by the word "image" in the error output.)
David Kilzer (:ddkilzer)
Comment 6 2007-03-12 15:41:12 PDT
With a local debug build of WebKit r20112, I get a crash. Console message: ASSERTION FAILED: Uncaught exception - Can't cache image 0 (/path/to/WebKit/WebCore/platform/mac/BlockExceptions.mm:36 ReportBlockedObjCException) Segmentation fault Stack trace: Exception: EXC_BAD_ACCESS (0x0001) Codes: KERN_INVALID_ADDRESS (0x0001) at 0xbbadbeef Thread 0 Crashed: 0 com.apple.WebCore 0x01053390 ReportBlockedObjCException(NSException*) + 88 (BlockExceptions.mm:36) 1 com.apple.WebCore 0x014c6de0 WebCore::EventHandler::mouseDragged(NSEvent*) + 264 (EventHandlerMac.mm:494) 2 com.apple.WebKit 0x0035147c -[WebHTMLView mouseDragged:] + 336 (WebHTMLView.mm:2996) 3 com.apple.AppKit 0x93768fa0 -[NSWindow sendEvent:] + 6424 4 com.apple.Safari 0x00021734 0x1000 + 132916 5 com.apple.AppKit 0x937118d4 -[NSApplication sendEvent:] + 4172 6 com.apple.Safari 0x00021238 0x1000 + 131640 7 com.apple.AppKit 0x93708d10 -[NSApplication run] + 508 8 com.apple.AppKit 0x937f987c NSApplicationMain + 452 9 com.apple.Safari 0x0005c77c 0x1000 + 374652 10 com.apple.Safari 0x0005c624 0x1000 + 374308
mitz
Comment 7 2007-03-12 16:21:03 PDT
(In reply to comment #6) > Stack trace: For future reference, with Cocoa exceptions, what you really want is the backtrace from where the exception was raised. You get it by setting a breakpoint at -[NSException raise], and backtracing from there. In this case: #0 0x9297c008 in -[NSException raise] () #1 0x9297be5c in +[NSException raise:format:] () #2 0x9375b900 in -[NSImage lockFocus] () #3 0x01507700 in WebCore::dissolveDragImageToFraction (image=@0xbfffe228, delta=0.75) at WebCore/platform/mac/DragImageMac.mm:69 #4 0x01506f08 in WebCore::createDragImageForSelection (frame=0xa1e6c10) at WebCore/platform/DragImage.cpp:62 #5 0x014e6dbc in WebCore::DragController::startDrag (this=0x7dfe210, src=0xa1e6c10, clipboard=0xc44e8e0, srcOp=WebCore::DragOperationNone, dragEvent=@0xbfffe82c, dragOrigin=@0x2a65bc8, isDHTMLDrag=false) at WebCore/page/DragController.cpp:614 #6 0x014cf820 in WebCore::EventHandler::handleDrag (this=0x2a65b18, event=@0xbfffe82c) at WebCore/page/EventHandler.cpp:1480 #7 0x014cf954 in WebCore::EventHandler::handleMouseMoveEvent (this=0x2a65b18, event=@0xbfffe82c) at WebCore/page/EventHandler.cpp:310 #8 0x014d0e54 in WebCore::EventHandler::handleMouseMoveEvent (this=0x2a65b18, mouseEvent=@0xbfffeca0) at WebCore/page/EventHandler.cpp:910 #9 0x010fbaf0 in WebCore::FrameView::handleMouseMoveEvent (this=0x76b78b0, event=@0xbfffeca0) at WebCore/page/FrameView.cpp:863 #10 0x014c7490 in WebCore::EventHandler::mouseDragged (this=0x2a65b18, event=0xa114350) at WebCore/page/mac/EventHandlerMac.mm:488 #11 0x003511cc in -[WebHTMLView mouseDragged:] (self=0xc145c20, _cmd=0x90aa13a0, event=0xa114350) at WebKit/WebView/WebHTMLView.mm:2986 #12 0x93768fa0 in -[NSWindow sendEvent:] () #13 0x00021734 in ?? () #14 0x937118d4 in -[NSApplication sendEvent:] () #15 0x00021238 in ?? () #16 0x93708d10 in -[NSApplication run] () #17 0x937f987c in NSApplicationMain () #18 0x0005c77c in ?? () #19 0x0005c624 in ?? ()
Charles Gaudette
Comment 8 2007-06-24 20:47:24 PDT
This bug appears to have evaporated on my Safari 3.0.2 beta (522.12) with r23755 build linked into it; also running Mac OS X 10.4.10.
Oliver Hunt
Comment 9 2007-06-24 20:58:54 PDT
Indeed it has... I wasn't aware of this bug, but i've made a few rather changes to handle drag and drop handles images during drag, which almost certainly fixed this. r20888 - stopped drag and drop from even attempting to provide data if the cached resource it would rely on has be destroyed. r21533 - Was a performance improvement that removed the requirement for a cached image in many cases. One of those revisions is likely to be the cause of this bug disappearing.
David Kilzer (:ddkilzer)
Comment 10 2007-06-25 21:39:29 PDT
Marked RESOLVED/FIXED per Comment #8 and Comment #9.
Oliver Hunt
Comment 11 2007-06-25 21:43:17 PDT
whoops, i didn't originate this, someone elses task to verify :D
Note You need to log in before you can comment on or make changes to this bug.