Changeset 187311 in webkit
- Timestamp:
- Jul 24, 2015, 12:54:09 AM (11 years ago)
- Location:
- branches/safari-601.1-branch/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
-
branches/safari-601.1-branch/Source/WebCore/ChangeLog
r187310 r187311 1 2015-07-24 Matthew Hanson <matthew_hanson@apple.com> 2 3 Merge r187173. rdar://problem/21637698 4 5 2015-07-22 Beth Dakin <bdakin@apple.com> 6 7 Animated images should animate in previews 8 https://bugs.webkit.org/show_bug.cgi?id=147173 9 -and corresponding- 10 rdar://problem/21637698 11 12 Reviewed by Dan Bernstein. 13 14 New virtual function to indicate whether or not the image is animated. 15 * platform/graphics/BitmapImage.h: 16 * platform/graphics/Image.h: 17 (WebCore::Image::isAnimated): 18 1 19 2015-07-24 Matthew Hanson <matthew_hanson@apple.com> 2 20 -
branches/safari-601.1-branch/Source/WebCore/platform/graphics/BitmapImage.h
r184793 r187311 179 179 180 180 virtual bool currentFrameKnownToBeOpaque() override; 181 182 virtual bool isAnimated() override { return m_frameCount > 1; } 181 183 182 184 bool canAnimate(); -
branches/safari-601.1-branch/Source/WebCore/platform/graphics/Image.h
r183716 r187311 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. -
branches/safari-601.1-branch/Source/WebKit2/ChangeLog
r187306 r187311 1 2015-07-24 Matthew Hanson <matthew_hanson@apple.com> 2 3 Merge r187173. rdar://problem/21637698 4 5 2015-07-22 Beth Dakin <bdakin@apple.com> 6 7 Animated images should animate in previews 8 https://bugs.webkit.org/show_bug.cgi?id=147173 9 -and corresponding- 10 rdar://problem/21637698 11 12 Reviewed by Dan Bernstein. 13 14 InteractionInformationAtPosition needs to know if it’s an animated image. 15 * Shared/InteractionInformationAtPosition.cpp: 16 (WebKit::InteractionInformationAtPosition::encode): 17 (WebKit::InteractionInformationAtPosition::decode): 18 * Shared/InteractionInformationAtPosition.h: 19 20 New delegate method to create a link preview view controller for animated 21 images. 22 * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: 23 24 Treat animated images more like link previews. 25 * UIProcess/ios/WKContentViewInteraction.mm: 26 (-[WKContentView previewViewControllerForPosition:inSourceView:]): 27 28 Set info.isAnimatedImage 29 * WebProcess/WebPage/ios/WebPageIOS.mm: 30 (WebKit::WebPage::getPositionInformation): 31 1 32 2015-07-24 Lucas Forschler <lforschler@apple.com> 2 33 -
branches/safari-601.1-branch/Source/WebKit2/Shared/InteractionInformationAtPosition.cpp
r187062 r187311 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 -
branches/safari-601.1-branch/Source/WebKit2/Shared/InteractionInformationAtPosition.h
r187062 r187311 44 44 bool isNearMarkedText { false }; 45 45 bool touchCalloutEnabled { true }; 46 bool isAnimatedImage { false }; 46 47 String clickableElementName; 47 48 String url; -
branches/safari-601.1-branch/Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h
r186734 r187311 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 -
branches/safari-601.1-branch/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
r187299 r187311 3268 3268 if (absoluteImageURL.isEmpty() || !(WebCore::protocolIsInHTTPFamily(absoluteImageURL) || WebCore::protocolIs(absoluteImageURL, "data"))) 3269 3269 return nil; 3270 3271 NSURL *targetURL = [NSURL _web_URLWithWTFString:_positionInformation.imageURL]; 3272 RetainPtr<_WKActivatedElementInfo> elementInfo = adoptNS([[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeImage URL:targetURL location:_positionInformation.point title:_positionInformation.title rect:_positionInformation.bounds image:_positionInformation.image.get()]); 3273 _page->startInteractionWithElementAtPosition(_positionInformation.point); 3274 3275 // Treat animated images like a link preview 3276 if (_positionInformation.isAnimatedImage) { 3277 if ([uiDelegate respondsToSelector:@selector(_webView:previewViewControllerForAnimatedImageAtURL:defaultActions:elementInfo:imageSize:)]) { 3278 _previewType = PreviewElementType::Link; 3279 RetainPtr<NSArray> actions = [_actionSheetAssistant defaultActionsForImageSheet:elementInfo.get()]; 3280 _highlightLongPressCanClick = NO; 3281 return [uiDelegate _webView:_webView previewViewControllerForAnimatedImageAtURL:targetURL defaultActions:actions.get() elementInfo:elementInfo.get() imageSize:_positionInformation.image->size()]; 3282 } 3283 } 3284 3270 3285 _previewType = PreviewElementType::Image; 3271 NSURL *targetURL = [NSURL _web_URLWithWTFString:_positionInformation.imageURL];3272 3286 if ([uiDelegate respondsToSelector:@selector(_webView:willPreviewImageWithURL:)]) 3273 3287 [uiDelegate _webView:_webView willPreviewImageWithURL:targetURL]; 3274 RetainPtr<_WKActivatedElementInfo> elementInfo = adoptNS([[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeImage URL:targetURL location:_positionInformation.point title:_positionInformation.title rect:_positionInformation.bounds image:_positionInformation.image.get()]);3275 _page->startInteractionWithElementAtPosition(_positionInformation.point);3276 3288 return [[[WKImagePreviewViewController alloc] initWithCGImage:_positionInformation.image->makeCGImageCopy() defaultActions:[_actionSheetAssistant defaultActionsForImageSheet:elementInfo.get()] elementInfo:elementInfo] autorelease]; 3277 3289 } -
branches/safari-601.1-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
r187299 r187311 2187 2187 info.imageURL = [(NSURL *)element->document().completeURL(renderImage.cachedImage()->url()) absoluteString]; 2188 2188 if (Image* image = renderImage.cachedImage()->imageForRenderer(&renderImage)) { 2189 info.isAnimatedImage = image->isAnimated(); 2189 2190 FloatSize screenSizeInPixels = screenSize(); 2190 2191 screenSizeInPixels.scale(corePage()->deviceScaleFactor());
Note:
See TracChangeset
for help on using the changeset viewer.