<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[206683] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/206683">206683</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-09-30 15:30:20 -0700 (Fri, 30 Sep 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>The dragged image should be the current frame only of the animated image
https://bugs.webkit.org/show_bug.cgi?id=162109
Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2016-09-30
Reviewed by Tim Horton.
Source/WebCore:
Instead of creating an NSImage with all the frames for the dragImage,
create an NSImage with the current frame only.
* dom/DataTransferMac.mm:
(WebCore::DataTransfer::createDragImage): Call currentFrameNSImage() to create the dragImage.
* editing/cocoa/HTMLConverter.mm:
(fileWrapperForElement): Call the Image function with its new name.
* platform/graphics/BitmapImage.h:
* platform/graphics/Image.h:
(WebCore::Image::nsImage): Rename getNSImage() to nsImage().
(WebCore::Image::currentFrameNSImage): Returns the NSImage of the current frame.
(WebCore::Image::tiffRepresentation): Rename getTIFFRepresentation() to tiffRepresentation().
(WebCore::Image::getNSImage): Deleted.
(WebCore::Image::getTIFFRepresentation): Deleted.
* platform/graphics/mac/ImageMac.mm:
(WebCore::BitmapImage::tiffRepresentation): Rename getTIFFRepresentation() to tiffRepresentation().
(WebCore::BitmapImage::nsImage): Rename getNSImage() to nsImage().
(WebCore::BitmapImage::currentFrameNSImage): Returns the NSImage of the current frame.
(WebCore::BitmapImage::getTIFFRepresentation): Deleted.
(WebCore::BitmapImage::getNSImage): Deleted.
* platform/mac/CursorMac.mm:
(WebCore::createCustomCursor): Call currentFrameNSImage() since the cursor does not animate anyway.
* platform/mac/DragImageMac.mm:
(WebCore::createDragImageFromImage): Use currentFrameNSImage() for the dragImage.
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::write): Call the Image function with its new name.
Source/WebKit/mac:
* DOM/DOM.mm:
(-[DOMElement image]): Call the Image function with its new name.
(-[DOMElement _imageTIFFRepresentation]): Ditto.
* Misc/WebElementDictionary.mm:
(-[WebElementDictionary _image]): Call the Image function with its new name.
* Misc/WebIconDatabase.mm:
(-[WebIconDatabase defaultIconWithSize:]): Call currentFrameNSImage() to create the icon image.
(webGetNSImage): Call the Image function with its new name.
* WebCoreSupport/WebContextMenuClient.mm:
(WebContextMenuClient::imageForCurrentSharingServicePickerItem): Call currentFrameNSImage() instead of nsImage()..
(WebContextMenuClient::contextMenuForEvent): Ditto.
* WebView/WebHTMLView.mm:
(-[WebHTMLView pasteboard:provideDataForType:]): Call the Image function with its new name.
Source/WebKit2:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::provideDataForPasteboard): Call the Image function with its new name.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomDataTransferMacmm">trunk/Source/WebCore/dom/DataTransferMac.mm</a></li>
<li><a href="#trunkSourceWebCoreeditingcocoaHTMLConvertermm">trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsBitmapImageh">trunk/Source/WebCore/platform/graphics/BitmapImage.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsImageh">trunk/Source/WebCore/platform/graphics/Image.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacImageMacmm">trunk/Source/WebCore/platform/graphics/mac/ImageMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacCursorMacmm">trunk/Source/WebCore/platform/mac/CursorMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacDragImageMacmm">trunk/Source/WebCore/platform/mac/DragImageMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacPasteboardMacmm">trunk/Source/WebCore/platform/mac/PasteboardMac.mm</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacDOMDOMmm">trunk/Source/WebKit/mac/DOM/DOM.mm</a></li>
<li><a href="#trunkSourceWebKitmacMiscWebElementDictionarymm">trunk/Source/WebKit/mac/Misc/WebElementDictionary.mm</a></li>
<li><a href="#trunkSourceWebKitmacMiscWebIconDatabasemm">trunk/Source/WebKit/mac/Misc/WebIconDatabase.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebContextMenuClientmm">trunk/Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebHTMLViewmm">trunk/Source/WebKit/mac/WebView/WebHTMLView.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaWebViewImplmm">trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (206682 => 206683)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-09-30 22:29:24 UTC (rev 206682)
+++ trunk/Source/WebCore/ChangeLog        2016-09-30 22:30:20 UTC (rev 206683)
</span><span class="lines">@@ -1,3 +1,37 @@
</span><ins>+2016-09-30 Said Abou-Hallawa <sabouhallawa@apple.com>
+
+ The dragged image should be the current frame only of the animated image
+ https://bugs.webkit.org/show_bug.cgi?id=162109
+
+ Reviewed by Tim Horton.
+
+ Instead of creating an NSImage with all the frames for the dragImage,
+ create an NSImage with the current frame only.
+
+ * dom/DataTransferMac.mm:
+ (WebCore::DataTransfer::createDragImage): Call currentFrameNSImage() to create the dragImage.
+ * editing/cocoa/HTMLConverter.mm:
+ (fileWrapperForElement): Call the Image function with its new name.
+ * platform/graphics/BitmapImage.h:
+ * platform/graphics/Image.h:
+ (WebCore::Image::nsImage): Rename getNSImage() to nsImage().
+ (WebCore::Image::currentFrameNSImage): Returns the NSImage of the current frame.
+ (WebCore::Image::tiffRepresentation): Rename getTIFFRepresentation() to tiffRepresentation().
+ (WebCore::Image::getNSImage): Deleted.
+ (WebCore::Image::getTIFFRepresentation): Deleted.
+ * platform/graphics/mac/ImageMac.mm:
+ (WebCore::BitmapImage::tiffRepresentation): Rename getTIFFRepresentation() to tiffRepresentation().
+ (WebCore::BitmapImage::nsImage): Rename getNSImage() to nsImage().
+ (WebCore::BitmapImage::currentFrameNSImage): Returns the NSImage of the current frame.
+ (WebCore::BitmapImage::getTIFFRepresentation): Deleted.
+ (WebCore::BitmapImage::getNSImage): Deleted.
+ * platform/mac/CursorMac.mm:
+ (WebCore::createCustomCursor): Call currentFrameNSImage() since the cursor does not animate anyway.
+ * platform/mac/DragImageMac.mm:
+ (WebCore::createDragImageFromImage): Use currentFrameNSImage() for the dragImage.
+ * platform/mac/PasteboardMac.mm:
+ (WebCore::Pasteboard::write): Call the Image function with its new name.
+
</ins><span class="cx"> 2016-09-30 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> [iOS] Allow sequence<Touch> input in TouchEvent constructor
</span></span></pre></div>
<a id="trunkSourceWebCoredomDataTransferMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DataTransferMac.mm (206682 => 206683)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DataTransferMac.mm        2016-09-30 22:29:24 UTC (rev 206682)
+++ trunk/Source/WebCore/dom/DataTransferMac.mm        2016-09-30 22:30:20 UTC (rev 206683)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx"> location.setY(imageRect.height() - (elementRect.y() - imageRect.y() + m_dragLocation.y()));
</span><span class="cx"> }
</span><span class="cx"> } else if (m_dragImage) {
</span><del>- result = m_dragImage->image()->getNSImage();
</del><ins>+ result = m_dragImage->image()->currentFrameNSImage();
</ins><span class="cx">
</span><span class="cx"> location = m_dragLocation;
</span><span class="cx"> location.setY([result size].height - location.y());
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingcocoaHTMLConvertermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm (206682 => 206683)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm        2016-09-30 22:29:24 UTC (rev 206682)
+++ trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm        2016-09-30 22:30:20 UTC (rev 206683)
</span><span class="lines">@@ -2464,7 +2464,7 @@
</span><span class="cx"> if (is<RenderImage>(renderer)) {
</span><span class="cx"> auto* image = downcast<RenderImage>(*renderer).cachedImage();
</span><span class="cx"> if (image && !image->errorOccurred()) {
</span><del>- RetainPtr<NSFileWrapper> wrapper = adoptNS([[NSFileWrapper alloc] initRegularFileWithContents:(NSData *)image->imageForRenderer(renderer)->getTIFFRepresentation()]);
</del><ins>+ RetainPtr<NSFileWrapper> wrapper = adoptNS([[NSFileWrapper alloc] initRegularFileWithContents:(NSData *)image->imageForRenderer(renderer)->tiffRepresentation()]);
</ins><span class="cx"> [wrapper setPreferredFilename:@"image.tiff"];
</span><span class="cx"> return wrapper;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsBitmapImageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/BitmapImage.h (206682 => 206683)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/BitmapImage.h        2016-09-30 22:29:24 UTC (rev 206682)
+++ trunk/Source/WebCore/platform/graphics/BitmapImage.h        2016-09-30 22:30:20 UTC (rev 206683)
</span><span class="lines">@@ -96,11 +96,12 @@
</span><span class="cx">
</span><span class="cx"> // Accessors for native image formats.
</span><span class="cx"> #if USE(APPKIT)
</span><del>- NSImage* getNSImage() override;
</del><ins>+ NSImage *nsImage() override;
+ RetainPtr<NSImage> currentFrameNSImage() override;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span><del>- CFDataRef getTIFFRepresentation() override;
</del><ins>+ CFDataRef tiffRepresentation() override;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(WIN)
</span><span class="lines">@@ -191,10 +192,10 @@
</span><span class="cx"> bool m_animationFinishedWhenCatchingUp { false };
</span><span class="cx">
</span><span class="cx"> #if USE(APPKIT)
</span><del>- mutable RetainPtr<NSImage> m_nsImage; // A cached NSImage of frame 0. Only built lazily if someone actually queries for one.
</del><ins>+ mutable RetainPtr<NSImage> m_nsImage; // A cached NSImage of all the frames. Only built lazily if someone actually queries for one.
</ins><span class="cx"> #endif
</span><span class="cx"> #if USE(CG)
</span><del>- mutable RetainPtr<CFDataRef> m_tiffRep; // Cached TIFF rep for frame 0. Only built lazily if someone queries for one.
</del><ins>+ mutable RetainPtr<CFDataRef> m_tiffRep; // Cached TIFF rep for all the frames. Only built lazily if someone queries for one.
</ins><span class="cx"> #endif
</span><span class="cx"> RefPtr<Image> m_cachedImage;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsImageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/Image.h (206682 => 206683)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/Image.h        2016-09-30 22:29:24 UTC (rev 206682)
+++ trunk/Source/WebCore/platform/graphics/Image.h        2016-09-30 22:30:20 UTC (rev 206683)
</span><span class="lines">@@ -146,11 +146,12 @@
</span><span class="cx"> // Accessors for native image formats.
</span><span class="cx">
</span><span class="cx"> #if USE(APPKIT)
</span><del>- virtual NSImage* getNSImage() { return nullptr; }
</del><ins>+ virtual NSImage *nsImage() { return nullptr; }
+ virtual RetainPtr<NSImage> currentFrameNSImage() { return nullptr; }
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span><del>- virtual CFDataRef getTIFFRepresentation() { return nullptr; }
</del><ins>+ virtual CFDataRef tiffRepresentation() { return nullptr; }
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(WIN)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacImageMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/ImageMac.mm (206682 => 206683)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/ImageMac.mm        2016-09-30 22:29:24 UTC (rev 206682)
+++ trunk/Source/WebCore/platform/graphics/mac/ImageMac.mm        2016-09-30 22:30:20 UTC (rev 206683)
</span><span class="lines">@@ -74,14 +74,14 @@
</span><span class="cx"> return Image::nullImage();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-CFDataRef BitmapImage::getTIFFRepresentation()
</del><ins>+CFDataRef BitmapImage::tiffRepresentation()
</ins><span class="cx"> {
</span><span class="cx"> if (m_tiffRep)
</span><span class="cx"> return m_tiffRep.get();
</span><span class="cx">
</span><del>- auto nativeImages = this->framesNativeImages();
</del><ins>+ auto nativeImages = framesNativeImages();
</ins><span class="cx">
</span><del>- // If framesImages.size() is zero, we know for certain this image doesn't have valid data
</del><ins>+ // If nativeImages.size() is zero, we know for certain this image doesn't have valid data
</ins><span class="cx"> // Even though the call to CGImageDestinationCreateWithData will fail and we'll handle it gracefully,
</span><span class="cx"> // in certain circumstances that call will spam the console with an error message
</span><span class="cx"> if (!nativeImages.size())
</span><span class="lines">@@ -103,18 +103,27 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if USE(APPKIT)
</span><del>-NSImage* BitmapImage::getNSImage()
</del><ins>+NSImage* BitmapImage::nsImage()
</ins><span class="cx"> {
</span><span class="cx"> if (m_nsImage)
</span><span class="cx"> return m_nsImage.get();
</span><span class="cx">
</span><del>- CFDataRef data = getTIFFRepresentation();
</del><ins>+ CFDataRef data = tiffRepresentation();
</ins><span class="cx"> if (!data)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx">
</span><span class="cx"> m_nsImage = adoptNS([[NSImage alloc] initWithData:(NSData*)data]);
</span><span class="cx"> return m_nsImage.get();
</span><span class="cx"> }
</span><ins>+
+RetainPtr<NSImage> BitmapImage::currentFrameNSImage()
+{
+ auto nativeImage = this->nativeImageForCurrentFrame();
+ if (!nativeImage)
+ return nullptr;
+
+ return adoptNS([[NSImage alloc] initWithCGImage:nativeImage.get() size:NSZeroSize]);
+}
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacCursorMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/CursorMac.mm (206682 => 206683)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/CursorMac.mm        2016-09-30 22:29:24 UTC (rev 206682)
+++ trunk/Source/WebCore/platform/mac/CursorMac.mm        2016-09-30 22:30:20 UTC (rev 206683)
</span><span class="lines">@@ -48,9 +48,9 @@
</span><span class="cx"> #endif
</span><span class="cx"> {
</span><span class="cx"> // FIXME: The cursor won't animate. Not sure if that's a big deal.
</span><del>- NSImage* nsImage = image->getNSImage();
</del><ins>+ auto nsImage = image->currentFrameNSImage();
</ins><span class="cx"> if (!nsImage)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> BEGIN_BLOCK_OBJC_EXCEPTIONS;
</span><span class="cx">
</span><span class="cx"> #if ENABLE(MOUSE_CURSOR_SCALE)
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx"> [[[nsImage representations] objectAtIndex:0] setSize:expandedSize];
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- return adoptNS([[NSCursor alloc] initWithImage:nsImage hotSpot:hotSpot]);
</del><ins>+ return adoptNS([[NSCursor alloc] initWithImage:nsImage.get() hotSpot:hotSpot]);
</ins><span class="cx"> END_BLOCK_OBJC_EXCEPTIONS;
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacDragImageMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/DragImageMac.mm (206682 => 206683)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/DragImageMac.mm        2016-09-30 22:29:24 UTC (rev 206682)
+++ trunk/Source/WebCore/platform/mac/DragImageMac.mm        2016-09-30 22:30:20 UTC (rev 206683)
</span><span class="lines">@@ -121,7 +121,7 @@
</span><span class="cx">
</span><span class="cx"> #pragma clang diagnostic push
</span><span class="cx"> #pragma clang diagnostic ignored "-Wdeprecated-declarations"
</span><del>- [image->getNSImage() drawInRect:destRect fromRect:NSMakeRect(0, 0, size.width(), size.height()) operation:NSCompositeSourceOver fraction:1.0];
</del><ins>+ [image->currentFrameNSImage() drawInRect:destRect fromRect:NSMakeRect(0, 0, size.width(), size.height()) operation:NSCompositeSourceOver fraction:1.0];
</ins><span class="cx"> #pragma clang diagnostic pop
</span><span class="cx"> [rotatedDragImage.get() unlockFocus];
</span><span class="cx">
</span><span class="lines">@@ -129,7 +129,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- RetainPtr<NSImage> dragImage = adoptNS([image->getNSImage() copy]);
</del><ins>+ auto dragImage = image->currentFrameNSImage();
</ins><span class="cx"> [dragImage.get() setSize:(NSSize)size];
</span><span class="cx"> return dragImage;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacPasteboardMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/PasteboardMac.mm (206682 => 206683)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/PasteboardMac.mm        2016-09-30 22:29:24 UTC (rev 206682)
+++ trunk/Source/WebCore/platform/mac/PasteboardMac.mm        2016-09-30 22:30:20 UTC (rev 206683)
</span><span class="lines">@@ -255,7 +255,7 @@
</span><span class="cx">
</span><span class="cx"> void Pasteboard::write(const PasteboardImage& pasteboardImage)
</span><span class="cx"> {
</span><del>- CFDataRef imageData = pasteboardImage.image->getTIFFRepresentation();
</del><ins>+ CFDataRef imageData = pasteboardImage.image->tiffRepresentation();
</ins><span class="cx"> if (!imageData)
</span><span class="cx"> return;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (206682 => 206683)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2016-09-30 22:29:24 UTC (rev 206682)
+++ trunk/Source/WebKit/mac/ChangeLog        2016-09-30 22:30:20 UTC (rev 206683)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2016-09-30 Said Abou-Hallawa <sabouhallawa@apple.com>
+
+ The dragged image should be the current frame only of the animated image
+ https://bugs.webkit.org/show_bug.cgi?id=162109
+
+ Reviewed by Tim Horton.
+
+ * DOM/DOM.mm:
+ (-[DOMElement image]): Call the Image function with its new name.
+ (-[DOMElement _imageTIFFRepresentation]): Ditto.
+ * Misc/WebElementDictionary.mm:
+ (-[WebElementDictionary _image]): Call the Image function with its new name.
+ * Misc/WebIconDatabase.mm:
+ (-[WebIconDatabase defaultIconWithSize:]): Call currentFrameNSImage() to create the icon image.
+ (webGetNSImage): Call the Image function with its new name.
+ * WebCoreSupport/WebContextMenuClient.mm:
+ (WebContextMenuClient::imageForCurrentSharingServicePickerItem): Call currentFrameNSImage() instead of nsImage()..
+ (WebContextMenuClient::contextMenuForEvent): Ditto.
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView pasteboard:provideDataForType:]): Call the Image function with its new name.
+
</ins><span class="cx"> 2016-09-27 Jer Noble <jer.noble@apple.com>
</span><span class="cx">
</span><span class="cx"> Remove deprecated ENCRYPTED_MEDIA implementation.
</span></span></pre></div>
<a id="trunkSourceWebKitmacDOMDOMmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/DOM/DOM.mm (206682 => 206683)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/DOM/DOM.mm        2016-09-30 22:29:24 UTC (rev 206682)
+++ trunk/Source/WebKit/mac/DOM/DOM.mm        2016-09-30 22:30:20 UTC (rev 206683)
</span><span class="lines">@@ -670,7 +670,7 @@
</span><span class="cx"> auto* cachedImage = downcast<RenderImage>(*renderer).cachedImage();
</span><span class="cx"> if (!cachedImage || cachedImage->errorOccurred())
</span><span class="cx"> return nil;
</span><del>- return cachedImage->imageForRenderer(renderer)->getNSImage();
</del><ins>+ return cachedImage->imageForRenderer(renderer)->nsImage();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #endif
</span><span class="lines">@@ -698,7 +698,7 @@
</span><span class="cx"> auto* cachedImage = downcast<RenderImage>(*renderer).cachedImage();
</span><span class="cx"> if (!cachedImage || cachedImage->errorOccurred())
</span><span class="cx"> return nil;
</span><del>- return (NSData *)cachedImage->imageForRenderer(renderer)->getTIFFRepresentation();
</del><ins>+ return (NSData *)cachedImage->imageForRenderer(renderer)->tiffRepresentation();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitmacMiscWebElementDictionarymm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Misc/WebElementDictionary.mm (206682 => 206683)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Misc/WebElementDictionary.mm        2016-09-30 22:29:24 UTC (rev 206682)
+++ trunk/Source/WebKit/mac/Misc/WebElementDictionary.mm        2016-09-30 22:30:20 UTC (rev 206683)
</span><span class="lines">@@ -204,7 +204,7 @@
</span><span class="cx"> - (NSImage *)_image
</span><span class="cx"> {
</span><span class="cx"> Image* image = _result->image();
</span><del>- return image ? image->getNSImage() : nil;
</del><ins>+ return image ? image->nsImage() : nil;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (NSValue *)_imageRect
</span></span></pre></div>
<a id="trunkSourceWebKitmacMiscWebIconDatabasemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Misc/WebIconDatabase.mm (206682 => 206683)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Misc/WebIconDatabase.mm        2016-09-30 22:29:24 UTC (rev 206682)
+++ trunk/Source/WebKit/mac/Misc/WebIconDatabase.mm        2016-09-30 22:30:20 UTC (rev 206683)
</span><span class="lines">@@ -163,7 +163,7 @@
</span><span class="cx"> ASSERT(size.height);
</span><span class="cx">
</span><span class="cx"> Image* image = iconDatabase().defaultIcon(IntSize(size));
</span><del>- return image ? image->getNSImage() : nil;
</del><ins>+ return image ? image->currentFrameNSImage().autorelease() : nil;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (NSImage *)defaultIconForURL:(NSString *)URL withSize:(NSSize)size
</span><span class="lines">@@ -470,7 +470,7 @@
</span><span class="cx"> // to WebCore::Image at some point.
</span><span class="cx"> if (!image)
</span><span class="cx"> return nil;
</span><del>- NSImage* nsImage = image->getNSImage();
</del><ins>+ NSImage* nsImage = image->nsImage();
</ins><span class="cx"> if (!nsImage)
</span><span class="cx"> return nil;
</span><span class="cx"> if (!NSEqualSizes([nsImage size], size)) {
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebContextMenuClientmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm (206682 => 206683)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm        2016-09-30 22:29:24 UTC (rev 206682)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm        2016-09-30 22:30:20 UTC (rev 206683)
</span><span class="lines">@@ -226,7 +226,7 @@
</span><span class="cx"> if (!image)
</span><span class="cx"> return nil;
</span><span class="cx">
</span><del>- return [[image->getNSImage() retain] autorelease];
</del><ins>+ return image->currentFrameNSImage();
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="lines">@@ -242,7 +242,7 @@
</span><span class="cx"> if (Image* image = page->contextMenuController().context().controlledImage()) {
</span><span class="cx"> ASSERT(page->contextMenuController().context().hitTestResult().innerNode());
</span><span class="cx">
</span><del>- RetainPtr<NSItemProvider> itemProvider = adoptNS([[NSItemProvider alloc] initWithItem:image->getNSImage() typeIdentifier:@"public.image"]);
</del><ins>+ RetainPtr<NSItemProvider> itemProvider = adoptNS([[NSItemProvider alloc] initWithItem:image->currentFrameNSImage().autorelease() typeIdentifier:@"public.image"]);
</ins><span class="cx">
</span><span class="cx"> bool isContentEditable = page->contextMenuController().context().hitTestResult().innerNode()->isContentEditable();
</span><span class="cx"> m_sharingServicePickerController = adoptNS([[WebSharingServicePickerController alloc] initWithItems:@[ itemProvider.get() ] includeEditorServices:isContentEditable client:this style:NSSharingServicePickerStyleRollover]);
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebHTMLViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebHTMLView.mm (206682 => 206683)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebHTMLView.mm        2016-09-30 22:29:24 UTC (rev 206682)
+++ trunk/Source/WebKit/mac/WebView/WebHTMLView.mm        2016-09-30 22:30:20 UTC (rev 206683)
</span><span class="lines">@@ -2210,7 +2210,7 @@
</span><span class="cx"> [archive release];
</span><span class="cx"> } else if ([type isEqual:NSTIFFPboardType] && [self promisedDragTIFFDataSource]) {
</span><span class="cx"> if (Image* image = [self promisedDragTIFFDataSource]->image())
</span><del>- [pasteboard setData:(NSData *)image->getTIFFRepresentation() forType:NSTIFFPboardType];
</del><ins>+ [pasteboard setData:(NSData *)image->tiffRepresentation() forType:NSTIFFPboardType];
</ins><span class="cx"> [self setPromisedDragTIFFDataSource:0];
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (206682 => 206683)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-09-30 22:29:24 UTC (rev 206682)
+++ trunk/Source/WebKit2/ChangeLog        2016-09-30 22:30:20 UTC (rev 206683)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-09-30 Said Abou-Hallawa <sabouhallawa@apple.com>
+
+ The dragged image should be the current frame only of the animated image
+ https://bugs.webkit.org/show_bug.cgi?id=162109
+
+ Reviewed by Tim Horton.
+
+ * UIProcess/Cocoa/WebViewImpl.mm:
+ (WebKit::WebViewImpl::provideDataForPasteboard): Call the Image function with its new name.
+
</ins><span class="cx"> 2016-09-30 Anders Carlsson <andersca@apple.com>
</span><span class="cx">
</span><span class="cx"> Second time going into fullscreen using silverlight, will hide the menu bar and dock for Safari
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaWebViewImplmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm (206682 => 206683)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm        2016-09-30 22:29:24 UTC (rev 206682)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm        2016-09-30 22:30:20 UTC (rev 206683)
</span><span class="lines">@@ -3038,7 +3038,7 @@
</span><span class="cx"> // FIXME: need to support NSRTFDPboardType
</span><span class="cx">
</span><span class="cx"> if ([type isEqual:NSTIFFPboardType] && m_promisedImage) {
</span><del>- [pasteboard setData:(NSData *)m_promisedImage->getTIFFRepresentation() forType:NSTIFFPboardType];
</del><ins>+ [pasteboard setData:(NSData *)m_promisedImage->tiffRepresentation() forType:NSTIFFPboardType];
</ins><span class="cx"> m_promisedImage = nullptr;
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>