⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 187311 in webkit


Ignore:
Timestamp:
Jul 24, 2015, 12:54:09 AM (11 years ago)
Author:
matthew_hanson@apple.com
Message:

Merge r187173. rdar://problem/21637698

Location:
branches/safari-601.1-branch/Source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-601.1-branch/Source/WebCore/ChangeLog

    r187310 r187311  
     12015-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
    1192015-07-24  Matthew Hanson  <matthew_hanson@apple.com>
    220
  • branches/safari-601.1-branch/Source/WebCore/platform/graphics/BitmapImage.h

    r184793 r187311  
    179179
    180180    virtual bool currentFrameKnownToBeOpaque() override;
     181
     182    virtual bool isAnimated() override { return m_frameCount > 1; }
    181183   
    182184    bool canAnimate();
  • branches/safari-601.1-branch/Source/WebCore/platform/graphics/Image.h

    r183716 r187311  
    8686    virtual bool currentFrameKnownToBeOpaque() = 0;
    8787
     88    virtual bool isAnimated() { return false; }
     89
    8890    // Derived classes should override this if they can assure that
    8991    // the image contains only resources from its own security origin.
  • branches/safari-601.1-branch/Source/WebKit2/ChangeLog

    r187306 r187311  
     12015-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
    1322015-07-24  Lucas Forschler  <lforschler@apple.com>
    233
  • branches/safari-601.1-branch/Source/WebKit2/Shared/InteractionInformationAtPosition.cpp

    r187062 r187311  
    4040    encoder << isNearMarkedText;
    4141    encoder << touchCalloutEnabled;
     42    encoder << isAnimatedImage;
    4243    encoder << clickableElementName;
    4344    encoder << url;
     
    6869
    6970    if (!decoder.decode(result.touchCalloutEnabled))
     71        return false;
     72
     73    if (!decoder.decode(result.isAnimatedImage))
    7074        return false;
    7175   
  • branches/safari-601.1-branch/Source/WebKit2/Shared/InteractionInformationAtPosition.h

    r187062 r187311  
    4444    bool isNearMarkedText { false };
    4545    bool touchCalloutEnabled { true };
     46    bool isAnimatedImage { false };
    4647    String clickableElementName;
    4748    String url;
  • branches/safari-601.1-branch/Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h

    r186734 r187311  
    3434@class UIViewController;
    3535@class _WKActivatedElementInfo;
     36@class _WKElementAction;
    3637@class _WKFrameHandle;
    3738
     
    5758#if TARGET_OS_IPHONE
    5859- (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;
    6061- (void)_webView:(WKWebView *)webView didNotHandleTapAsClickAtPoint:(CGPoint)point;
    6162- (BOOL)_webView:(WKWebView *)webView shouldRequestGeolocationAuthorizationForURL:(NSURL *)url isMainFrame:(BOOL)isMainFrame mainFrameURL:(NSURL *)mainFrameURL;
     
    6667- (void)_webView:(WKWebView *)webView didDismissPreviewViewController:(UIViewController *)previewedViewController;
    6768- (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);
    6971#endif
    7072
  • branches/safari-601.1-branch/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm

    r187299 r187311  
    32683268        if (absoluteImageURL.isEmpty() || !(WebCore::protocolIsInHTTPFamily(absoluteImageURL) || WebCore::protocolIs(absoluteImageURL, "data")))
    32693269            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
    32703285        _previewType = PreviewElementType::Image;
    3271         NSURL *targetURL = [NSURL _web_URLWithWTFString:_positionInformation.imageURL];
    32723286        if ([uiDelegate respondsToSelector:@selector(_webView:willPreviewImageWithURL:)])
    32733287            [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);
    32763288        return [[[WKImagePreviewViewController alloc] initWithCGImage:_positionInformation.image->makeCGImageCopy() defaultActions:[_actionSheetAssistant defaultActionsForImageSheet:elementInfo.get()] elementInfo:elementInfo] autorelease];
    32773289    }
  • branches/safari-601.1-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm

    r187299 r187311  
    21872187                        info.imageURL = [(NSURL *)element->document().completeURL(renderImage.cachedImage()->url()) absoluteString];
    21882188                        if (Image* image = renderImage.cachedImage()->imageForRenderer(&renderImage)) {
     2189                            info.isAnimatedImage = image->isAnimated();
    21892190                            FloatSize screenSizeInPixels = screenSize();
    21902191                            screenSizeInPixels.scale(corePage()->deviceScaleFactor());
Note: See TracChangeset for help on using the changeset viewer.