Changeset 187173 in webkit
- Timestamp:
- Jul 22, 2015, 12:15:06 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 9 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/platform/graphics/BitmapImage.h (modified) (1 diff)
-
WebCore/platform/graphics/Image.h (modified) (1 diff)
-
WebKit2/ChangeLog (modified) (1 diff)
-
WebKit2/Shared/InteractionInformationAtPosition.cpp (modified) (2 diffs)
-
WebKit2/Shared/InteractionInformationAtPosition.h (modified) (1 diff)
-
WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h (modified) (3 diffs)
-
WebKit2/UIProcess/ios/WKContentViewInteraction.mm (modified) (1 diff)
-
WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r187171 r187173 1 2015-07-22 Beth Dakin <bdakin@apple.com> 2 3 Animated images should animate in previews 4 https://bugs.webkit.org/show_bug.cgi?id=147173 5 -and corresponding- 6 rdar://problem/21637698 7 8 Reviewed by Dan Bernstein. 9 10 New virtual function to indicate whether or not the image is animated. 11 * platform/graphics/BitmapImage.h: 12 * platform/graphics/Image.h: 13 (WebCore::Image::isAnimated): 14 1 15 2015-07-22 Jinyoung Hur <hur.ims@navercorp.com> 2 16 -
trunk/Source/WebCore/platform/graphics/BitmapImage.h
r184793 r187173 179 179 180 180 virtual bool currentFrameKnownToBeOpaque() override; 181 182 virtual bool isAnimated() override { return m_frameCount > 1; } 181 183 182 184 bool canAnimate(); -
trunk/Source/WebCore/platform/graphics/Image.h
r183716 r187173 86 86 virtual bool currentFrameKnownToBeOpaque() = 0; 87 87 88 virtual bool isAnimated() { return false; } 89 88 90 // Derived classes should override this if they can assure that 89 91 // the image contains only resources from its own security origin. -
trunk/Source/WebKit2/ChangeLog
r187159 r187173 1 2015-07-22 Beth Dakin <bdakin@apple.com> 2 3 Animated images should animate in previews 4 https://bugs.webkit.org/show_bug.cgi?id=147173 5 -and corresponding- 6 rdar://problem/21637698 7 8 Reviewed by Dan Bernstein. 9 10 InteractionInformationAtPosition needs to know if it’s an animated image. 11 * Shared/InteractionInformationAtPosition.cpp: 12 (WebKit::InteractionInformationAtPosition::encode): 13 (WebKit::InteractionInformationAtPosition::decode): 14 * Shared/InteractionInformationAtPosition.h: 15 16 New delegate method to create a link preview view controller for animated 17 images. 18 * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: 19 20 Treat animated images more like link previews. 21 * UIProcess/ios/WKContentViewInteraction.mm: 22 (-[WKContentView previewViewControllerForPosition:inSourceView:]): 23 24 Set info.isAnimatedImage 25 * WebProcess/WebPage/ios/WebPageIOS.mm: 26 (WebKit::WebPage::getPositionInformation): 27 1 28 2015-07-22 Michael Catanzaro <mcatanzaro@igalia.com> 2 29 -
trunk/Source/WebKit2/Shared/InteractionInformationAtPosition.cpp
r186916 r187173 40 40 encoder << isNearMarkedText; 41 41 encoder << touchCalloutEnabled; 42 encoder << isAnimatedImage; 42 43 encoder << clickableElementName; 43 44 encoder << url; … … 68 69 69 70 if (!decoder.decode(result.touchCalloutEnabled)) 71 return false; 72 73 if (!decoder.decode(result.isAnimatedImage)) 70 74 return false; 71 75 -
trunk/Source/WebKit2/Shared/InteractionInformationAtPosition.h
r186916 r187173 44 44 bool isNearMarkedText { false }; 45 45 bool touchCalloutEnabled { true }; 46 bool isAnimatedImage { false }; 46 47 String clickableElementName; 47 48 String url; -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h
r186719 r187173 34 34 @class UIViewController; 35 35 @class _WKActivatedElementInfo; 36 @class _WKElementAction; 36 37 @class _WKFrameHandle; 37 38 … … 57 58 #if TARGET_OS_IPHONE 58 59 - (BOOL)_webView:(WKWebView *)webView shouldIncludeAppLinkActionsForElement:(_WKActivatedElementInfo *)element WK_AVAILABLE(NA, WK_IOS_TBA); 59 - (NSArray *)_webView:(WKWebView *)webView actionsForElement:(_WKActivatedElementInfo *)element defaultActions:( NSArray*)defaultActions;60 - (NSArray *)_webView:(WKWebView *)webView actionsForElement:(_WKActivatedElementInfo *)element defaultActions:(WK_ARRAY(_WKElementAction *) *)defaultActions; 60 61 - (void)_webView:(WKWebView *)webView didNotHandleTapAsClickAtPoint:(CGPoint)point; 61 62 - (BOOL)_webView:(WKWebView *)webView shouldRequestGeolocationAuthorizationForURL:(NSURL *)url isMainFrame:(BOOL)isMainFrame mainFrameURL:(NSURL *)mainFrameURL; … … 66 67 - (void)_webView:(WKWebView *)webView didDismissPreviewViewController:(UIViewController *)previewedViewController; 67 68 - (UIEdgeInsets)_webView:(WKWebView *)webView finalObscuredInsetsForScrollView:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset; 68 - (UIViewController *)_webView:(WKWebView *)webView previewViewControllerForURL:(NSURL *)url defaultActions:(NSArray *)actions elementInfo:(_WKActivatedElementInfo *)elementInfo WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA); 69 - (UIViewController *)_webView:(WKWebView *)webView previewViewControllerForURL:(NSURL *)url defaultActions:(WK_ARRAY(_WKElementAction *) *)actions elementInfo:(_WKActivatedElementInfo *)elementInfo WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA); 70 - (UIViewController *)_webView:(WKWebView *)webView previewViewControllerForAnimatedImageAtURL:(NSURL *)url defaultActions:(WK_ARRAY(_WKElementAction *) *)actions elementInfo:(_WKActivatedElementInfo *)elementInfo imageSize:(CGSize)imageSize WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA); 69 71 #endif 70 72 -
trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
r187117 r187173 3278 3278 if (absoluteImageURL.isEmpty() || !(WebCore::protocolIsInHTTPFamily(absoluteImageURL) || WebCore::protocolIs(absoluteImageURL, "data"))) 3279 3279 return nil; 3280 3281 NSURL *targetURL = [NSURL _web_URLWithWTFString:_positionInformation.imageURL]; 3282 RetainPtr<_WKActivatedElementInfo> elementInfo = adoptNS([[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeImage URL:targetURL location:_positionInformation.point title:_positionInformation.title rect:_positionInformation.bounds image:_positionInformation.image.get()]); 3283 _page->startInteractionWithElementAtPosition(_positionInformation.point); 3284 3285 // Treat animated images like a link preview 3286 if (_positionInformation.isAnimatedImage) { 3287 if ([uiDelegate respondsToSelector:@selector(_webView:previewViewControllerForAnimatedImageAtURL:defaultActions:elementInfo:imageSize:)]) { 3288 _previewType = PreviewElementType::Link; 3289 RetainPtr<NSArray> actions = [_actionSheetAssistant defaultActionsForImageSheet:elementInfo.get()]; 3290 _highlightLongPressCanClick = NO; 3291 return [uiDelegate _webView:_webView previewViewControllerForAnimatedImageAtURL:targetURL defaultActions:actions.get() elementInfo:elementInfo.get() imageSize:_positionInformation.image->size()]; 3292 } 3293 } 3294 3280 3295 _previewType = PreviewElementType::Image; 3281 NSURL *targetURL = [NSURL _web_URLWithWTFString:_positionInformation.imageURL];3282 3296 if ([uiDelegate respondsToSelector:@selector(_webView:willPreviewImageWithURL:)]) 3283 3297 [uiDelegate _webView:_webView willPreviewImageWithURL:targetURL]; 3284 RetainPtr<_WKActivatedElementInfo> elementInfo = adoptNS([[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeImage URL:targetURL location:_positionInformation.point title:_positionInformation.title rect:_positionInformation.bounds image:_positionInformation.image.get()]);3285 _page->startInteractionWithElementAtPosition(_positionInformation.point);3286 3298 return [[[WKImagePreviewViewController alloc] initWithCGImage:_positionInformation.image->makeCGImageCopy() defaultActions:[_actionSheetAssistant defaultActionsForImageSheet:elementInfo.get()] elementInfo:elementInfo] autorelease]; 3287 3299 } -
trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
r187117 r187173 2224 2224 info.imageURL = [(NSURL *)element->document().completeURL(renderImage.cachedImage()->url()) absoluteString]; 2225 2225 if (Image* image = renderImage.cachedImage()->imageForRenderer(&renderImage)) { 2226 info.isAnimatedImage = image->isAnimated(); 2226 2227 FloatSize screenSizeInPixels = screenSize(); 2227 2228 screenSizeInPixels.scale(corePage()->deviceScaleFactor());
Note:
See TracChangeset
for help on using the changeset viewer.