Commit 959c6db7 authored by andersca@apple.com's avatar andersca@apple.com

<https://webkit.org/b/119777> Get rid of two gotos

Reviewed by Tim Horton.

* WebView/WebHTMLView.mm:
(-[WebHTMLView mouseDown:]):
(-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154031 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 728883c0
2013-08-13 Anders Carlsson <andersca@apple.com>
<https://webkit.org/b/119777> Get rid of two gotos
Reviewed by Tim Horton.
* WebView/WebHTMLView.mm:
(-[WebHTMLView mouseDown:]):
(-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]):
2013-08-13 Tim Horton <timothy_horton@apple.com>
Remotely hosted plugins don’t work in window-server-hosted WebKit1 views
......
......@@ -3555,23 +3555,22 @@ static void setMenuTargets(NSMenu* menu)
[self _setMouseDownEvent:event];
NSInputManager *currentInputManager = [NSInputManager currentInputManager];
if ([currentInputManager wantsToHandleMouseEvents] && [currentInputManager handleMouseEvent:event])
goto done;
[_private->completionController endRevertingChange:NO moveLeft:NO];
if (![currentInputManager wantsToHandleMouseEvents] || ![currentInputManager handleMouseEvent:event]) {
[_private->completionController endRevertingChange:NO moveLeft:NO];
// If the web page handles the context menu event and menuForEvent: returns nil, we'll get control click events here.
// We don't want to pass them along to KHTML a second time.
if (!([event modifierFlags] & NSControlKeyMask)) {
_private->ignoringMouseDraggedEvents = NO;
// If the web page handles the context menu event and menuForEvent: returns nil, we'll get control click events here.
// We don't want to pass them along to KHTML a second time.
if (!([event modifierFlags] & NSControlKeyMask)) {
_private->ignoringMouseDraggedEvents = NO;
// Let WebCore get a chance to deal with the event. This will call back to us
// to start the autoscroll timer if appropriate.
if (Frame* coreframe = core([self _frame]))
coreframe->eventHandler()->mouseDown(event);
// Let WebCore get a chance to deal with the event. This will call back to us
// to start the autoscroll timer if appropriate.
if (Frame* coreframe = core([self _frame]))
coreframe->eventHandler()->mouseDown(event);
}
}
done:
_private->handlingMouseDownEvent = NO;
}
......@@ -3666,23 +3665,18 @@ static bool matchesExtensionOrEquivalent(NSString *filename, NSString *extension
NSURL *draggingImageURL = nil;
if (WebCore::CachedImage* tiffResource = [self promisedDragTIFFDataSource]) {
ResourceBuffer *buffer = static_cast<CachedResource*>(tiffResource)->resourceBuffer();
if (!buffer)
goto noPromisedData;
NSData *data = buffer->createNSData();
NSURLResponse *response = tiffResource->response().nsURLResponse();
draggingImageURL = [response URL];
wrapper = [[[NSFileWrapper alloc] initRegularFileWithContents:data] autorelease];
NSString* filename = [response suggestedFilename];
NSString* trueExtension(tiffResource->image()->filenameExtension());
if (!matchesExtensionOrEquivalent(filename, trueExtension))
filename = [[filename stringByAppendingString:@"."] stringByAppendingString:trueExtension];
[wrapper setPreferredFilename:filename];
}
noPromisedData:
if (ResourceBuffer *buffer = static_cast<CachedResource*>(tiffResource)->resourceBuffer()) {
NSData *data = buffer->createNSData();
NSURLResponse *response = tiffResource->response().nsURLResponse();
draggingImageURL = [response URL];
wrapper = [[[NSFileWrapper alloc] initRegularFileWithContents:data] autorelease];
NSString* filename = [response suggestedFilename];
NSString* trueExtension(tiffResource->image()->filenameExtension());
if (!matchesExtensionOrEquivalent(filename, trueExtension))
filename = [[filename stringByAppendingString:@"."] stringByAppendingString:trueExtension];
[wrapper setPreferredFilename:filename];
}
}
if (!wrapper) {
ASSERT(![self _webView] || [self _isTopHTMLView]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment