[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

zecke at webkit.org zecke at webkit.org
Thu Apr 8 02:18:30 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 4945dd36353cd5476aed74336915f58708e88782
Author: zecke at webkit.org <zecke at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Mar 10 10:46:08 2010 +0000

    [Qt] Non animated gifs are animated in QtWebKit
    
    https://bugs.webkit.org/show_bug.cgi?id=35955
    
    Properly map Qt animated and non-animated values to WebCore's
    understanding of animated and non-animated images. Currently
    we can not map anything to the cAnimationLoopNone value.
    
    * manual-tests/qt/qt-anim.gif: Added.
    * manual-tests/qt/qt-gif-test.html: Added.
    * manual-tests/qt/qt-noanim.gif: Added.
    * platform/graphics/qt/ImageDecoderQt.cpp:
    (WebCore::ImageDecoderQt::repetitionCount):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55774 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index c0b0da9..ef85445 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-03-10  Holger Hans Peter Freyther  <zecke at selfish.org>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Non animated gifs are animated in QtWebKit
+        https://bugs.webkit.org/show_bug.cgi?id=35955
+
+        Properly map Qt animated and non-animated values to WebCore's
+        understanding of animated and non-animated images. Currently
+        we can not map anything to the cAnimationLoopNone value.
+
+        * manual-tests/qt/qt-anim.gif: Added.
+        * manual-tests/qt/qt-gif-test.html: Added.
+        * manual-tests/qt/qt-noanim.gif: Added.
+        * platform/graphics/qt/ImageDecoderQt.cpp:
+        (WebCore::ImageDecoderQt::repetitionCount):
+
 2010-03-07  Holger Hans Peter Freyther  <zecke at selfish.org>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/manual-tests/qt/qt-anim.gif b/WebCore/manual-tests/qt/qt-anim.gif
new file mode 100644
index 0000000..8bca4a8
Binary files /dev/null and b/WebCore/manual-tests/qt/qt-anim.gif differ
diff --git a/WebCore/manual-tests/qt/qt-gif-test.html b/WebCore/manual-tests/qt/qt-gif-test.html
new file mode 100644
index 0000000..06505f4
--- /dev/null
+++ b/WebCore/manual-tests/qt/qt-gif-test.html
@@ -0,0 +1,12 @@
+<html>
+<body>
+<div>
+    <img src="qt-anim.gif">
+    <p>This should animate</p>
+</div>
+<div>
+    <img src="qt-noanim.gif">
+    <p>This should not animate and you should see a cross</p>
+</div
+</body>
+</html>
diff --git a/WebCore/manual-tests/qt/qt-noanim.gif b/WebCore/manual-tests/qt/qt-noanim.gif
new file mode 100644
index 0000000..b6a8540
Binary files /dev/null and b/WebCore/manual-tests/qt/qt-noanim.gif differ
diff --git a/WebCore/platform/graphics/qt/ImageDecoderQt.cpp b/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
index c98b252..5ce4378 100644
--- a/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
+++ b/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
@@ -115,8 +115,21 @@ size_t ImageDecoderQt::frameCount()
 
 int ImageDecoderQt::repetitionCount() const
 {
-    if (m_reader && m_reader->supportsAnimation())
-        m_repetitionCount = qMax(0, m_reader->loopCount());
+    if (m_reader && m_reader->supportsAnimation()) {
+        m_repetitionCount = m_reader->loopCount();
+
+        // Qt and WebCore have a incompatible understanding of
+        // the loop count and we can not completely map everything.
+        //  Qt   |   WebCore          | description
+        //  -1   |     0              | infinite animation
+        //   0   | cAnimationLoopOnce | show every frame once
+        //   n   |     n              | no idea if that is supported
+        //  n/a  | cAnimationNone     | show only the first frame
+        if (m_repetitionCount == -1)
+            m_repetitionCount = 0;
+        else if (m_repetitionCount == 0)
+            m_repetitionCount = cAnimationLoopOnce;
+    }
 
     return m_repetitionCount;
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list