2009-01-02 Simon Fraser <simon.fraser@apple.com>
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 3 Jan 2009 01:06:11 +0000 (01:06 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 3 Jan 2009 01:06:11 +0000 (01:06 +0000)
        Reviewed by Darin Adler

        https://bugs.webkit.org/show_bug.cgi?id=23082

        Fix GIF animation by ensuring that the signature of
        startAnimation() in the base class matches the method in BitmapImage.

        Test: fast/backgrounds/animated-gif-as-background.html

        * platform/graphics/Image.h:
        (WebCore::Image::startAnimation):

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

LayoutTests/ChangeLog
LayoutTests/fast/backgrounds/animated-gif-as-background.html [new file with mode: 0644]
LayoutTests/fast/backgrounds/resources/red-green-animated.gif [new file with mode: 0644]
LayoutTests/platform/mac/fast/backgrounds/animated-gif-as-background-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/backgrounds/animated-gif-as-background-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/backgrounds/animated-gif-as-background-expected.txt [new file with mode: 0644]
WebCore/ChangeLog
WebCore/platform/graphics/Image.h

index 46efadc..28c209a 100644 (file)
 
         Reviewed by Darin Adler
 
+        https://bugs.webkit.org/show_bug.cgi?id=23082
+
+        Testcase for animated GIF used as CSS background.
+        
+        * fast/backgrounds/animated-gif-as-background.html: Added.
+        * fast/backgrounds/resources/red-green-animated.gif: Added.
+        * platform/mac/fast/backgrounds/animated-gif-as-background-expected.checksum: Added.
+        * platform/mac/fast/backgrounds/animated-gif-as-background-expected.png: Added.
+        * platform/mac/fast/backgrounds/animated-gif-as-background-expected.txt: Added.
+
+2009-01-02  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Darin Adler
+
         https://bugs.webkit.org/show_bug.cgi?id=22981
 
         Add tests for animated svg-as-image, animated svg-as-background,
diff --git a/LayoutTests/fast/backgrounds/animated-gif-as-background.html b/LayoutTests/fast/backgrounds/animated-gif-as-background.html
new file mode 100644 (file)
index 0000000..eb88c24
--- /dev/null
@@ -0,0 +1,31 @@
+<html>
+<head>
+  <style type="text/css" media="screen">
+    div {
+      background: blue;
+      background-image: url('resources/red-green-animated.gif');
+      height: 200px;
+      width: 200px;
+    }
+  </style>
+  <script type="text/javascript" charset="utf-8">
+    if (window.layoutTestController)
+      layoutTestController.waitUntilDone();
+    
+    function pageLoaded() 
+    {
+      window.setTimeout(function() {
+        if (window.layoutTestController)
+          layoutTestController.notifyDone();
+      }, 200);    // Red frame of GIF has 100ms duration
+    }
+
+    window.addEventListener('load', pageLoaded, false);
+  </script>
+  </script>
+</head>
+<body>
+  <p>Div background should animate between red and green. DRT should snapshot when it is green.</p>
+  <div></div>
+</body>
+</html>
diff --git a/LayoutTests/fast/backgrounds/resources/red-green-animated.gif b/LayoutTests/fast/backgrounds/resources/red-green-animated.gif
new file mode 100644 (file)
index 0000000..dd09e4e
Binary files /dev/null and b/LayoutTests/fast/backgrounds/resources/red-green-animated.gif differ
diff --git a/LayoutTests/platform/mac/fast/backgrounds/animated-gif-as-background-expected.checksum b/LayoutTests/platform/mac/fast/backgrounds/animated-gif-as-background-expected.checksum
new file mode 100644 (file)
index 0000000..54f49f0
--- /dev/null
@@ -0,0 +1 @@
+4cb5e68d9e7b429f0028893848ebee3b
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/backgrounds/animated-gif-as-background-expected.png b/LayoutTests/platform/mac/fast/backgrounds/animated-gif-as-background-expected.png
new file mode 100644 (file)
index 0000000..935340e
Binary files /dev/null and b/LayoutTests/platform/mac/fast/backgrounds/animated-gif-as-background-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/backgrounds/animated-gif-as-background-expected.txt b/LayoutTests/platform/mac/fast/backgrounds/animated-gif-as-background-expected.txt
new file mode 100644 (file)
index 0000000..2980ade
--- /dev/null
@@ -0,0 +1,9 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 603x18
+          text run at (0,0) width 603: "Div background should animate between red and green. DRT should snapshot when it is green."
+      RenderBlock {DIV} at (0,34) size 200x200 [bgcolor=#0000FF]
index d7265b5..21e8102 100644 (file)
@@ -1,3 +1,17 @@
+2009-01-02  Simon Fraser  <simon.fraser@apple.com>
+
+        Reviewed by Darin Adler
+
+        https://bugs.webkit.org/show_bug.cgi?id=23082
+        
+        Fix GIF animation by ensuring that the signature of
+        startAnimation() in the base class matches the method in BitmapImage.
+        
+        Test: fast/backgrounds/animated-gif-as-background.html
+
+        * platform/graphics/Image.h:
+        (WebCore::Image::startAnimation):
+
 2009-01-02  David Smith  <catfish.man@gmail.com>
 
         Reviewed by Darin Adler.
index 0735dde..876f27c 100644 (file)
@@ -159,7 +159,7 @@ protected:
     virtual bool mayFillWithSolidColor() const { return false; }
     virtual Color solidColor() const { return Color(); }
     
-    virtual void startAnimation() { }
+    virtual void startAnimation(bool catchUpIfNecessary = true) { }
     
     virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform,
                              const FloatPoint& phase, CompositeOperator, const FloatRect& destRect);