Bug 1120149 - Add a hack to resolve an AWSY regression in Gecko 37 and 38. r=tn, a=sledru
authorSeth Fowler <seth@mozilla.com>
Wed, 21 Jan 2015 17:36:20 -0800
changeset 249390 8c1be585ca75bf7b8b20a543178199c2cd0fc544
parent 249389 6f8463429d9480789ebe15d1997ec00bf596d30f
child 249391 2555aadca9a481a59fa362fd21d0ae98e3cf9b72
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstn, sledru
bugs1120149
milestone37.0a2
Bug 1120149 - Add a hack to resolve an AWSY regression in Gecko 37 and 38. 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);