Backout Bug 767779 to fix major image painting problems, r=backout
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Sat, 21 Jul 2012 14:03:29 +0300
changeset 100035 446b788ab99d048922bbd432bca73a9198b4e8b6
parent 100034 61835756b1cd2276a84fbaf04ef218b7c47bd407
child 100036 6f87c97307916c1c7d4d479da524113969450361
push id12307
push userryanvm@gmail.com
push dateSat, 21 Jul 2012 18:32:33 +0000
treeherdermozilla-inbound@defbe00ca091 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs767779
milestone17.0a1
first release with
nightly linux32
446b788ab99d / 17.0a1 / 20120721041038 / files
nightly linux64
446b788ab99d / 17.0a1 / 20120721041038 / files
nightly mac
446b788ab99d / 17.0a1 / 20120721041038 / files
nightly win32
446b788ab99d / 17.0a1 / 20120721041038 / files
nightly win64
446b788ab99d / 17.0a1 / 20120721041038 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backout Bug 767779 to fix major image painting problems, r=backout
image/src/RasterImage.cpp
image/test/mochitest/Makefile.in
image/test/mochitest/animated-gif_trailing-garbage.gif
image/test/mochitest/bug767779.sjs
image/test/mochitest/test_bug767779.html
--- a/image/src/RasterImage.cpp
+++ b/image/src/RasterImage.cpp
@@ -1446,26 +1446,20 @@ RasterImage::AddSourceData(const char *a
 
   // We should not call this if we're already finished adding source data
   NS_ABORT_IF_FALSE(!mHasSourceData, "Calling AddSourceData() after calling "
                                      "sourceDataComplete()!");
 
   // This call should come straight from necko - no reentrancy allowed
   NS_ABORT_IF_FALSE(!mInDecoder, "Re-entrant call to AddSourceData!");
 
-  // The decoder is not accepting data, we shouldn't be getting it, but it could
-  // be extra garbage data at the end of a file.
-  if (!mDecoder || mDecoder->GetDecodeDone()) {
-    return NS_OK;
-  }
-
   // Starting a new part's frames, let's clean up before we add any
   // This needs to happen just before we start getting EnsureFrame() call(s),
   // so that there's no gap for anything to miss us.
-  if (mMultipart && mBytesDecoded == 0) {
+  if (mBytesDecoded == 0) {
     // Our previous state may have been animated, so let's clean up
     if (mAnimating) {
       StopAnimation();
       mAnimating = false;
     }
     mAnimationFinished = false;
     if (mAnim) {
       delete mAnim;
--- a/image/test/mochitest/Makefile.in
+++ b/image/test/mochitest/Makefile.in
@@ -7,17 +7,16 @@ DEPTH		= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir  = image/test/mochitest
 
 include $(DEPTH)/config/autoconf.mk
 
 MOCHITEST_FILES =   imgutils.js \
-                animationPolling.js \
                 lime100x100.svg \
                 test_bug399925.html \
                 bug399925.gif \
                 schrep.png \
                 bug468160.sjs \
                 test_bug468160.html \
                 red.png \
                 test_bug466586.html \
@@ -53,19 +52,16 @@ MOCHITEST_FILES =   imgutils.js \
                 bug552605.sjs \
                 bug671906-iframe.html \
                 bug671906.sjs \
                 test_bug671906.html \
                 test_bug733553.html \
                 bug733553-iframe.html \
                 bug733553.sjs \
                 animated-gif2.gif \
-                test_bug767779.html \
-                bug767779.sjs \
-                animated-gif_trailing-garbage.gif \
 		test_error_events.html \
 		error-early.png \
 		test_drawDiscardedImage.html \
                 $(NULL)
 
 # Tests disabled due to intermittent orange
 # test_bug435296.html disabled - See bug 578591
 # test_bug478398.html disabled - See bug 579139
deleted file mode 100644
index 02f4de2e31f379d9c6fac2324065a1980ab8e49c..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/image/test/mochitest/bug767779.sjs
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-var timer = Components.classes["@mozilla.org/timer;1"];
-var partTimer = timer.createInstance(Components.interfaces.nsITimer);
-
-function getFileAsInputStream(aFilename) {
-  var file = Components.classes["@mozilla.org/file/directory_service;1"]
-             .getService(Components.interfaces.nsIProperties)
-             .get("CurWorkD", Components.interfaces.nsIFile);
-
-  file.append("tests");
-  file.append("image");
-  file.append("test");
-  file.append("mochitest");
-  file.append(aFilename);
-
-  var fileStream = Components.classes['@mozilla.org/network/file-input-stream;1']
-                   .createInstance(Components.interfaces.nsIFileInputStream);
-  fileStream.init(file, 1, 0, false);
-  return fileStream;
-}
-
-function handleRequest(request, response)
-{
-  response.setHeader("Content-Type", "image/gif", false);
-  response.setHeader("Cache-Control", "no-cache", false);
-  response.setStatusLine(request.httpVersion, 200, "OK");
-  // We're sending data off in a delayed fashion
-  response.processAsync();
-  var inputStream = getFileAsInputStream("animated-gif_trailing-garbage.gif");
-  var available = inputStream.available(); // = 4029 bytes
-  // Send the good data at once
-  response.bodyOutputStream.writeFrom(inputStream, 285);
-  sendParts(inputStream, response);
-}
-
-function sendParts(inputStream, response) {
-  // 3744 left, send in 8 chunks of 468 each
-  partTimer.initWithCallback(getSendNextPart(inputStream, response), 500,
-                             Components.interfaces.nsITimer.TYPE_ONE_SHOT);
-}
-
-function getSendNextPart(inputStream, response) {
-  return function () {
-    response.bodyOutputStream.writeFrom(inputStream, 468);
-    if (!inputStream.available()) {
-      inputStream.close();
-      response.finish();
-    } else {
-      sendParts(inputStream, response);
-    }
-  };
-}
-
deleted file mode 100644
--- a/image/test/mochitest/test_bug767779.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=767779
--->
-<head>
-  <title>Test for Bug 767779</title>
-  <script type="application/javascript" src="/MochiKit/MochiKit.js"></script>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="application/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script>
-  <script type="application/javascript" src="imgutils.js"></script>
-  <script type="application/javascript" src="animationPolling.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=767779">Mozilla Bug 767779</a>
-<p id="display"></p>
-<pre id="test">
-<script type="application/javascript">
-const FAILURE_TIMEOUT = 30000; // Fail early after 30 seconds
-
-function main()
-{
-  // referenceDiv's size and color correspond to the last frame of the GIF
-  var animTest = new AnimationTest(20, FAILURE_TIMEOUT, 'referenceDiv',
-                                   'animatedGif', 'debug');
-  animTest.beginTest();
-}
-
-window.onload = main;
-</script>
-</pre>
-<div id="content"> <!-- style="display: none" -->
-  <div id="referenceDiv" style="height: 40px; width: 40px;
-                                display: none; background: #18ff00;"></div>
-  <div id="animatedImage">
-    <img id="animatedGif" src="bug767779.sjs" style="display: none;"/>
-      <div id="text-descr"></div>
-  </div>
-  <div id="debug" style="display:none">
-  </div>
-</div>
-</body>
-</html>