Bug 1120149 - Add a hack to resolve an AWSY regression in Gecko 36. r=tn, a=sledru
authorSeth Fowler <seth@mozilla.com>
Wed, 21 Jan 2015 17:36:20 -0800
changeset 243676 7422906b1a32
parent 243675 274a8354e230
child 243677 484b4f09fa9f
push id4432
push userryanvm@gmail.com
push date2015-02-04 15:12 +0000
treeherdermozilla-beta@7422906b1a32 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstn, sledru
bugs1120149
milestone36.0
Bug 1120149 - Add a hack to resolve an AWSY regression in Gecko 36. r=tn, a=sledru
image/src/ProgressTracker.cpp
--- a/image/src/ProgressTracker.cpp
+++ b/image/src/ProgressTracker.cpp
@@ -355,16 +355,25 @@ ProgressTracker::SyncNotifyProgress(Prog
   MOZ_ASSERT(NS_IsMainThread(), "Use mObservers on main thread only");
 
   // Don't unblock onload if we're not blocked.
   Progress progress = Difference(aProgress);
   if (!((mProgress | progress) & FLAG_ONLOAD_BLOCKED)) {
     progress &= ~FLAG_ONLOAD_UNBLOCKED;
   }
 
+  // XXX(seth): Hack to work around the fact that some observers have bugs and
+  // need to get onload blocking notifications multiple times. We should fix
+  // those observers and remove this.
+  if ((aProgress & FLAG_DECODE_COMPLETE) &&
+      (mProgress & FLAG_ONLOAD_BLOCKED) &&
+      (mProgress & FLAG_ONLOAD_UNBLOCKED)) {
+    progress |= FLAG_ONLOAD_BLOCKED | FLAG_ONLOAD_UNBLOCKED;
+  }
+
   // Apply the changes.
   mProgress |= progress;
 
   CheckProgressConsistency(mProgress);
 
   // Send notifications.
   SyncNotifyInternal(mObservers, !!mImage, progress, aInvalidRect);