Fixed <rdar://problem/3966973> Tiger 8A357: Binary Compatiblity: frequent Webstracto...
authorrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Feb 2005 21:20:53 +0000 (21:20 +0000)
committerrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Feb 2005 21:20:53 +0000 (21:20 +0000)
Webstractor.app was playing tricks to create thumbnails of
pages.  This caused the 'focusView' to be incorrect during
animated GIF frame rendering.

        Reviewed by Chris.

        * WebCoreSupport.subproj/WebImageRenderer.m:
        (-[WebImageRenderer _startOrContinueAnimationIfNecessary]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8600 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/ChangeLog
WebKit/WebCoreSupport.subproj/WebImageRenderer.m

index 36175cbf9ae84e35c5db2b0654dce20a704426ed..b5062dd690d9590729f32a8e43b9e67c55f01034 100644 (file)
@@ -1,3 +1,16 @@
+2005-02-16  Richard Williamson   <rjw@apple.com>
+
+       Fixed <rdar://problem/3966973> Tiger 8A357: Binary Compatiblity: frequent Webstractor.app crashes [WebImageData _nextFrame]
+
+       Webstractor.app was playing tricks to create thumbnails of
+       pages.  This caused the 'focusView' to be incorrect during
+       animated GIF frame rendering.
+
+        Reviewed by Chris.
+
+        * WebCoreSupport.subproj/WebImageRenderer.m:
+        (-[WebImageRenderer _startOrContinueAnimationIfNecessary]):
+
 2005-02-16  Vicki Murley  <vicki@apple.com>
 
         Reviewed by me, code change by Darin.
index c4f7f860aecbde02eb402fd8174a67ac824ed8d7..35443cea4fd4254e6841a18511fbfe1e8d26e0a9 100644 (file)
@@ -7,6 +7,8 @@
 #import <WebKit/WebAssertions.h>
 #import <WebKit/WebImageRendererFactory.h>
 #import <WebKit/WebGraphicsBridge.h>
+#import <WebKit/WebHTMLView.h>
+#import <WebKit/WebImageView.h>
 #import <WebKit/WebNSObjectExtras.h>
 
 #import <WebCore/WebCoreImageRenderer.h>
 
 - (void)_startOrContinueAnimationIfNecessary
 {
-    if ([imageData shouldAnimate] && [MIMEType isEqual:@"image/gif"]) {
-        [imageData addAnimatingRenderer:self inView:[NSView focusView]];
+    NSView *targetView = [NSView focusView];
+    
+    // Only animate if we're drawing into a WebHTMLView or WebImageView.  This fixes problems
+    // like <rdar://problem/3966973>, which describes a third party application that renders thumbnails of
+    // the page into a alternate view.
+    if (([targetView isKindOfClass:[WebHTMLView class]] || [targetView isKindOfClass:[WebImageView class]]) 
+           && [imageData shouldAnimate] && [MIMEType isEqual:@"image/gif"]) {
+        [imageData addAnimatingRenderer:self inView:targetView];
         [imageData animate];
     }
 }