Title: [185328] trunk/Source/WebKit/mac
Revision
185328
Author
[email protected]
Date
2015-06-08 13:40:57 -0700 (Mon, 08 Jun 2015)

Log Message

Remove more unused Objective-C methods
https://bugs.webkit.org/show_bug.cgi?id=145761

Reviewed by Geoffrey Garen.

* Misc/WebNSImageExtras.h:
* Misc/WebNSImageExtras.m:
(-[NSImage _web_saveAndOpen]): Deleted.
* Misc/WebNSViewExtras.h:
* Misc/WebNSViewExtras.m:
(-[NSView _web_DragImageForElement:rect:event:pasteboard:source:offset:]): Deleted.
(-[NSView _web_convertRect:toView:]): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebKit/mac/ChangeLog (185327 => 185328)


--- trunk/Source/WebKit/mac/ChangeLog	2015-06-08 20:26:02 UTC (rev 185327)
+++ trunk/Source/WebKit/mac/ChangeLog	2015-06-08 20:40:57 UTC (rev 185328)
@@ -1,5 +1,20 @@
 2015-06-08  Anders Carlsson  <[email protected]>
 
+        Remove more unused Objective-C methods
+        https://bugs.webkit.org/show_bug.cgi?id=145761
+
+        Reviewed by Geoffrey Garen.
+
+        * Misc/WebNSImageExtras.h:
+        * Misc/WebNSImageExtras.m:
+        (-[NSImage _web_saveAndOpen]): Deleted.
+        * Misc/WebNSViewExtras.h:
+        * Misc/WebNSViewExtras.m:
+        (-[NSView _web_DragImageForElement:rect:event:pasteboard:source:offset:]): Deleted.
+        (-[NSView _web_convertRect:toView:]): Deleted.
+
+2015-06-08  Anders Carlsson  <[email protected]>
+
         Try to fix the Mavericks build.
 
         * WebView/WebPDFView.mm:

Modified: trunk/Source/WebKit/mac/Misc/WebNSImageExtras.h (185327 => 185328)


--- trunk/Source/WebKit/mac/Misc/WebNSImageExtras.h	2015-06-08 20:26:02 UTC (rev 185327)
+++ trunk/Source/WebKit/mac/Misc/WebNSImageExtras.h	2015-06-08 20:40:57 UTC (rev 185328)
@@ -36,9 +36,6 @@
 
 - (void)_web_dissolveToFraction:(float)delta;
 
-// Debug method. Saves an image and opens it in the preferred TIFF viewing application.
-- (void)_web_saveAndOpen;
-
 @end
 
 #endif

Modified: trunk/Source/WebKit/mac/Misc/WebNSImageExtras.m (185327 => 185328)


--- trunk/Source/WebKit/mac/Misc/WebNSImageExtras.m	2015-06-08 20:26:02 UTC (rev 185327)
+++ trunk/Source/WebKit/mac/Misc/WebNSImageExtras.m	2015-06-08 20:40:57 UTC (rev 185328)
@@ -93,18 +93,6 @@
     [dissolvedImage release];
 }
 
-- (void)_web_saveAndOpen
-{
-    char path[] = "/tmp/XXXXXX.tiff";
-    int fd = mkstemps(path, 5);
-    if (fd != -1) {
-        NSData *data = "" TIFFRepresentation];
-        write(fd, [data bytes], [data length]);
-        close(fd);
-        [[NSWorkspace sharedWorkspace] openFile:[NSString stringWithUTF8String:path]];
-    }
-}
-
 @end
 
 #endif // !PLATFORM(IOS)

Modified: trunk/Source/WebKit/mac/Misc/WebNSViewExtras.h (185327 => 185328)


--- trunk/Source/WebKit/mac/Misc/WebNSViewExtras.h	2015-06-08 20:26:02 UTC (rev 185327)
+++ trunk/Source/WebKit/mac/Misc/WebNSViewExtras.h	2015-06-08 20:40:57 UTC (rev 185328)
@@ -68,19 +68,10 @@
 // Returns NSDragOperationNone otherwise.
 - (NSDragOperation)_web_dragOperationForDraggingInfo:(id <NSDraggingInfo>)sender;
 
-// Resizes and applies alpha to image and drags it.
-- (void)_web_DragImageForElement:(DOMElement *)element
-                         rect:(NSRect)rect
-                        event:(NSEvent *)event
-                   pasteboard:(NSPasteboard *)pasteboard 
-                       source:(id)source
-                       offset:(NSPoint *)dragImageOffset;
 #endif
 
 - (BOOL)_web_firstResponderIsSelfOrDescendantView;
 
-- (NSRect)_web_convertRect:(NSRect)aRect toView:(NSView *)aView;
-
 @end
 
 #if TARGET_OS_IPHONE

Modified: trunk/Source/WebKit/mac/Misc/WebNSViewExtras.m (185327 => 185328)


--- trunk/Source/WebKit/mac/Misc/WebNSViewExtras.m	2015-06-08 20:26:02 UTC (rev 185327)
+++ trunk/Source/WebKit/mac/Misc/WebNSViewExtras.m	2015-06-08 20:40:57 UTC (rev 185328)
@@ -159,61 +159,6 @@
     return NSDragOperationNone;
 }
 
-- (void)_web_DragImageForElement:(DOMElement *)element
-                         rect:(NSRect)rect
-                        event:(NSEvent *)event
-                   pasteboard:(NSPasteboard *)pasteboard 
-                       source:(id)source
-                       offset:(NSPoint *)dragImageOffset
-{
-    NSPoint mouseDownPoint = [self convertPoint:[event locationInWindow] fromView:nil];
-    NSImage *dragImage;
-    NSPoint origin;
-
-    NSImage *image = [element image];
-    if (image != nil && [image size].height * [image size].width <= WebMaxOriginalImageArea) {
-        NSSize originalSize = rect.size;
-        origin = rect.origin;
-        
-        dragImage = [[image copy] autorelease];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-        [dragImage setScalesWhenResized:YES];
-#pragma clang diagnostic pop
-        [dragImage setSize:originalSize];
-        
-        [dragImage _web_scaleToMaxSize:WebMaxDragImageSize];
-        NSSize newSize = [dragImage size];
-        
-        [dragImage _web_dissolveToFraction:WebDragImageAlpha];
-        
-        // Properly orient the drag image and orient it differently if it's smaller than the original
-        origin.x = mouseDownPoint.x - (((mouseDownPoint.x - origin.x) / originalSize.width) * newSize.width);
-        origin.y = origin.y + originalSize.height;
-        origin.y = mouseDownPoint.y - (((mouseDownPoint.y - origin.y) / originalSize.height) * newSize.height);
-    } else {
-        // FIXME: This has been broken for a while.
-        // There's no way to get the MIME type for the image from a DOM element.
-        // The old code used [image MIMEType];
-        NSString *extension = @"";
-        dragImage = [[NSWorkspace sharedWorkspace] iconForFileType:extension];
-        NSSize offset = NSMakeSize([dragImage size].width - WebDragIconRightInset, -WebDragIconBottomInset);
-        origin = NSMakePoint(mouseDownPoint.x - offset.width, mouseDownPoint.y - offset.height);
-    }
-
-    // This is the offset from the lower left corner of the image to the mouse location.  Because we
-    // are a flipped view the calculation of Y is inverted.
-    if (dragImageOffset) {
-        dragImageOffset->x = mouseDownPoint.x - origin.x;
-        dragImageOffset->y = origin.y - mouseDownPoint.y;
-    }
-    
-    // Per kwebster, offset arg is ignored
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    [self dragImage:dragImage at:origin offset:NSZeroSize event:event pasteboard:pasteboard source:source slideBack:YES];
-#pragma clang diagnostic pop
-}
 #endif // !PLATFORM(IOS)
 
 - (BOOL)_web_firstResponderIsSelfOrDescendantView
@@ -224,40 +169,6 @@
            ([responder isKindOfClass:[NSView class]] && [(NSView *)responder isDescendantOf:self])));
 }
 
-- (NSRect)_web_convertRect:(NSRect)aRect toView:(NSView *)aView
-{
-    // Converting to this view's window; let -convertRect:toView: handle it
-    if (aView == nil)
-        return [self convertRect:aRect toView:nil];
-        
-    // This view must be in a window.  Do whatever weird thing -convertRect:toView: does in this situation.
-    NSWindow *thisWindow = [self window];
-    if (!thisWindow)
-        return [self convertRect:aRect toView:aView];
-    
-    // The other view must be in a window, too.
-    NSWindow *otherWindow = [aView window];
-    if (!otherWindow)
-        return [self convertRect:aRect toView:aView];
-
-    // Convert to this window's coordinates
-    NSRect convertedRect = [self convertRect:aRect toView:nil];
-    
-    // Convert to screen coordinates
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    convertedRect.origin = [thisWindow convertBaseToScreen:convertedRect.origin];
-
-    // Convert to other window's coordinates
-    convertedRect.origin = [otherWindow convertScreenToBase:convertedRect.origin];
-#pragma clang diagnostic pop
-    
-    // Convert to other view's coordinates
-    convertedRect = [aView convertRect:convertedRect fromView:nil];
-    
-    return convertedRect;
-}
-
 @end
 
 #if PLATFORM(IOS)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to