Stereobit / dragend

dragend JS – a touch ready, full responsive, content swipe script
http://stereobit.github.com/dragend/
MIT License
486 stars 113 forks source link

Safari crash on drag over image content (version 2013-1-17 0.2.0_rc3) #19

Closed nonnenmacher closed 10 years ago

nonnenmacher commented 10 years ago

On Safari 7.0 (build 9357.71 on 10.9 Mavericks) got systematic crash whenever there is a drag event over an image.

Assertion failed: (error == kCGErrorSuccess), function WKSetDragImage, file /SourceCache/WebKitSystemInterface/WebKitSystemInterface-7537.64/WebKitSystemInterface.m, line 1045.

Could be reproduced on all demos pages from the distribution (not compiled), or directly from the home page.

It works OK on Chrome.

here is the crash log

Process: com.apple.WebKit.WebContent [4030] Path: /System/Library/PrivateFrameworks/WebKit2.framework/Versions/A/XPCServices/com.apple.WebKit.WebContent.xpc/Contents/MacOS/com.apple.WebKit.WebContent Identifier: com.apple.WebKit.WebContent Version: 9537 (9537.71) Build Info: WebKit2-7537071000000000~3 Code Type: X86-64 (Native) Parent Process: ??? [1] Responsible: Safari [3761] User ID: 501

Date/Time: 2013-12-04 19:29:28.043 +0100 OS Version: Mac OS X 10.9 (13A603) Report Version: 11

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000

Application Specific Information: Assertion failed: (error == kCGErrorSuccess), function WKSetDragImage, file /SourceCache/WebKitSystemInterface/WebKitSystemInterface-7537.64/WebKitSystemInterface.m, line 1045.

Bundle controller class: BrowserBundleController

Process Model: Multiple Web Processes

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x00007fff8bc11866 *pthread_kill + 10 1 libsystem_pthread.dylib 0x00007fff8bc4535c pthread_kill + 92 2 libsystem_c.dylib 0x00007fff834e2bba abort + 125 3 libsystem_c.dylib 0x00007fff834aca5f __assertrtn + 321 4 com.apple.WebKit2 0x00007fff8b5c8157 WKSetDragImage + 1098 5 com.apple.WebCore 0x00007fff8d4daea0 WebCore::Pasteboard::setDragImage(WTF::RetainPtr, WebCore::IntPoint const&) + 112 6 com.apple.WebCore 0x00007fff8cfb93c0 WebCore::Clipboard::updateDragImage() + 80 7 com.apple.WebCore 0x00007fff8cb6537a WebCore::CachedImage::notifyObservers(WebCore::IntRect const) + 154 8 com.apple.WebCore 0x00007fff8cb66ffd WebCore::CachedImage::finishLoading(WebCore::ResourceBuffer) + 205 9 com.apple.WebCore 0x00007fff8cb44025 WebCore::SubresourceLoader::didFinishLoading(double) + 133 10 com.apple.WebKit2 0x00007fff8b483ea1 WebKit::WebResourceLoader::didReceiveWebResourceLoaderMessage(CoreIPC::Connection, CoreIPC::MessageDecoder&) + 541 11 com.apple.WebKit2 0x00007fff8b4836de WebKit::NetworkProcessConnection::didReceiveMessage(CoreIPC::Connection_, CoreIPC::MessageDecoder&) + 138 12 com.apple.WebKit2 0x00007fff8b45e9b9 CoreIPC::Connection::dispatchMessage(WTF::PassOwnPtrCoreIPC::MessageDecoder) + 101 13 com.apple.WebKit2 0x00007fff8b45e8e2 CoreIPC::Connection::dispatchOneMessage() + 106 14 com.apple.WebCore 0x00007fff8ca149ce WebCore::RunLoop::performWork() + 270 15 com.apple.WebCore 0x00007fff8ca148a2 WebCore::RunLoop::performWork(void) + 34 16 com.apple.CoreFoundation 0x00007fff8e4098f1 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION** + 17 17 com.apple.CoreFoundation 0x00007fff8e3fb062 CFRunLoopDoSources0 + 242 18 com.apple.CoreFoundation 0x00007fff8e3fa7ef __CFRunLoopRun + 831 19 com.apple.CoreFoundation 0x00007fff8e3fa275 CFRunLoopRunSpecific + 309 20 com.apple.HIToolbox 0x00007fff8353ef0d RunCurrentEventLoopInMode + 226 21 com.apple.HIToolbox 0x00007fff8353ecb7 ReceiveNextEventCommon + 479 22 com.apple.HIToolbox 0x00007fff8353eabc _BlockUntilNextEventMatchingListInModeWithFilter + 65 23 com.apple.AppKit 0x00007fff86fc228e _DPSNextEvent + 1434 24 com.apple.AppKit 0x00007fff86fc18db -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 122 25 com.apple.AppKit 0x00007fff86fb59cc -[NSApplication run] + 553 26 com.apple.AppKit 0x00007fff86fa0803 NSApplicationMain + 940 27 com.apple.XPCService 0x00007fff8bb69c0f _xpc_main + 385 28 libxpc.dylib 0x00007fff895bfb2e xpc_main + 399 29 com.apple.WebKit.WebContent 0x00000001076cfba0 0x1076cf000 + 2976 30 libdyld.dylib 0x00007fff87fa15fd start + 1

Stereobit commented 10 years ago

I'll have a look into this as soon as possible ...

Stereobit commented 10 years ago

It seems to be more a Safari then a dragend JS problem. See https://bugs.webkit.org/show_bug.cgi?id=119027

I'm trying to find a workaround for this.

Stereobit commented 10 years ago

Found one. Hope this will not break anything. It seems like Safari can't handle images set via setDragImage right now. I'm using a empty div for now.

Fingers crossed that this will not break at some point.

Stereobit commented 10 years ago

The fix is already pushed. Can you confirm?

nonnenmacher commented 10 years ago

yes, it works and sorry to have not be clear enough, it was indeed a Safari bug ;-)

Thanks for the quick fix

Hope this empty div will not cause trouble, I'm having difficulties to impose a responsive design, for a one-page/whole screen site design, where I'm forced to parse down all items to force some dimensions depending on the client window, before handing the whole stack to dragend.js

Stereobit commented 10 years ago

Nice!

Why not parsing the items after dragend sized the pages?