[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 15:19:27 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 73d454385d30292175dbf3aab4d1a5d143ea8cc9
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Nov 1 02:04:27 2010 +0000
2010-10-31 Peter Kasting <pkasting at google.com>
Reviewed by Adam Barth.
Treat GIFs with no loop count as "loop once".
https://bugs.webkit.org/show_bug.cgi?id=47302
* fast/images/gif-loop-count-expected.checksum: Added.
* fast/images/gif-loop-count-expected.png: Added.
* fast/images/gif-loop-count-expected.txt: Added.
* fast/images/gif-loop-count.html: Added.
* fast/images/resources/gif-loop-count.gif: Added.
* fast/images/resources/gif-loop-count.png: Added.
2010-10-31 Peter Kasting <pkasting at google.com>
Reviewed by Adam Barth.
Treat GIFs with no loop count as "loop once".
https://bugs.webkit.org/show_bug.cgi?id=47302
Test: fast/images/gif-loop-count.html
* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::repetitionCount):
(WebCore::GIFImageDecoder::gifComplete):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71001 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index a55f18b..78aa73a 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2010-10-31 Peter Kasting <pkasting at google.com>
+
+ Reviewed by Adam Barth.
+
+ Treat GIFs with no loop count as "loop once".
+ https://bugs.webkit.org/show_bug.cgi?id=47302
+
+ * fast/images/gif-loop-count-expected.checksum: Added.
+ * fast/images/gif-loop-count-expected.png: Added.
+ * fast/images/gif-loop-count-expected.txt: Added.
+ * fast/images/gif-loop-count.html: Added.
+ * fast/images/resources/gif-loop-count.gif: Added.
+ * fast/images/resources/gif-loop-count.png: Added.
+
2010-10-31 James Simonsen <simonjam at chromium.org>
Reviewed by Andreas Kling.
diff --git a/LayoutTests/fast/images/gif-loop-count-expected.checksum b/LayoutTests/fast/images/gif-loop-count-expected.checksum
new file mode 100644
index 0000000..f21db04
--- /dev/null
+++ b/LayoutTests/fast/images/gif-loop-count-expected.checksum
@@ -0,0 +1 @@
+6325c91f25b7296777495c6abca523b7
\ No newline at end of file
diff --git a/LayoutTests/fast/images/gif-loop-count-expected.png b/LayoutTests/fast/images/gif-loop-count-expected.png
new file mode 100644
index 0000000..7cc1c04
Binary files /dev/null and b/LayoutTests/fast/images/gif-loop-count-expected.png differ
diff --git a/LayoutTests/fast/images/gif-loop-count-expected.txt b/LayoutTests/fast/images/gif-loop-count-expected.txt
new file mode 100644
index 0000000..c33489a
--- /dev/null
+++ b/LayoutTests/fast/images/gif-loop-count-expected.txt
@@ -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
+layer at (0,0) size 100x100
+ RenderImage {IMG} at (0,0) size 100x100
+layer at (0,0) size 100x100
+ RenderImage {IMG} at (0,0) size 100x100
diff --git a/LayoutTests/fast/images/gif-loop-count.html b/LayoutTests/fast/images/gif-loop-count.html
new file mode 100644
index 0000000..5ad3a63
--- /dev/null
+++ b/LayoutTests/fast/images/gif-loop-count.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<script>
+ function step2() {
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }
+ function step1() {
+ document.getElementById('replaceme').src = 'resources/gif-loop-count.gif';
+ setTimeout("step2()", 200);
+ }
+ function test() {
+ if (window.layoutTestController) {
+ layoutTestController.waitUntilDone();
+ }
+ setTimeout("step1()", 200);
+ }
+</script>
+</head>
+<body onload="test()">
+<img src="resources/gif-loop-count.gif" style="position:absolute;left:0;top:0">
+<img src="resources/gif-loop-count.png" id="replaceme" style="position:absolute;left:0;top:0">
+</body>
+</html>
diff --git a/LayoutTests/fast/images/resources/gif-loop-count.gif b/LayoutTests/fast/images/resources/gif-loop-count.gif
new file mode 100644
index 0000000..2b51a62
Binary files /dev/null and b/LayoutTests/fast/images/resources/gif-loop-count.gif differ
diff --git a/LayoutTests/fast/images/resources/gif-loop-count.png b/LayoutTests/fast/images/resources/gif-loop-count.png
new file mode 100644
index 0000000..7dc4842
Binary files /dev/null and b/LayoutTests/fast/images/resources/gif-loop-count.png differ
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8db8cdc..ebbd4a6 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-10-31 Peter Kasting <pkasting at google.com>
+
+ Reviewed by Adam Barth.
+
+ Treat GIFs with no loop count as "loop once".
+ https://bugs.webkit.org/show_bug.cgi?id=47302
+
+ Test: fast/images/gif-loop-count.html
+
+ * platform/image-decoders/gif/GIFImageDecoder.cpp:
+ (WebCore::GIFImageDecoder::repetitionCount):
+ (WebCore::GIFImageDecoder::gifComplete):
+
2010-10-31 No'am Rosenthal <noam.rosenthal at nokia.com>
Reviewed by Andreas Kling.
diff --git a/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp b/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
index 4797495..18cd903 100644
--- a/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
+++ b/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
@@ -96,21 +96,24 @@ int GIFImageDecoder::repetitionCount() const
// This value can arrive at any point in the image data stream. Most GIFs
// in the wild declare it near the beginning of the file, so it usually is
// set by the time we've decoded the size, but (depending on the GIF and the
- // packets sent back by the webserver) not always. Our caller is
- // responsible for waiting until image decoding has finished to ask this if
- // it needs an authoritative answer. In the meantime, we should default to
- // "loop once".
- if (m_reader) {
- // Added wrinkle: ImageSource::clear() may destroy the reader, making
- // the result from the reader _less_ authoritative on future calls. To
- // detect this, the reader returns cLoopCountNotSeen (-2) instead of
- // cAnimationLoopOnce (0) when its current incarnation hasn't actually
- // seen a loop count yet; in this case we return our previously-cached
- // value.
- const int repetitionCount = m_reader->loop_count;
- if (repetitionCount != cLoopCountNotSeen)
- m_repetitionCount = repetitionCount;
- }
+ // packets sent back by the webserver) not always. If the reader hasn't
+ // seen a loop count yet, it will return cLoopCountNotSeen, in which case we
+ // should default to looping once (the initial value for
+ // |m_repetitionCount|).
+ //
+ // There are two additional wrinkles here. First, ImageSource::clear() may
+ // destroy the reader, making the result from the reader _less_
+ // authoritative on future calls if the recreated reader hasn't seen the
+ // loop count. We don't need to special-case this because in this case the
+ // new reader will once again return cLoopCountNotSeen, and we won't
+ // overwrite the cached correct value.
+ //
+ // Second, a GIF might never set a loop count at all, in which case we
+ // should continue to treat it as a "loop once" animation. We don't need
+ // special code here either, because in this case we'll never change
+ // |m_repetitionCount| from its default value.
+ if (m_reader && (m_reader->loop_count != cLoopCountNotSeen))
+ m_repetitionCount = m_reader->loop_count;
return m_repetitionCount;
}
@@ -295,8 +298,10 @@ bool GIFImageDecoder::frameComplete(unsigned frameIndex, unsigned frameDuration,
void GIFImageDecoder::gifComplete()
{
- if (m_reader)
- m_repetitionCount = m_reader->loop_count;
+ // Cache the repetition count, which is now as authoritative as it's ever
+ // going to be.
+ repetitionCount();
+
m_reader.clear();
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list