Merge mozilla-central to mozilla-inbound
authorEd Morley <emorley@mozilla.com>
Wed, 22 Aug 2012 10:37:32 +0100
changeset 105055 eb0deea718b3184c1056587a77612baa70721a4a
parent 105054 d51a3bf72b9c549903868a998783bf3ba3f69130 (current diff)
parent 104975 4d59eb5ac2c6fd6c71762637647dabf9cad25dc0 (diff)
child 105056 e8bf3b589c2d88707b9e58bb2a1a6d5050c42326
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
milestone17.0a1
Merge mozilla-central to mozilla-inbound
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1653,28 +1653,28 @@ var gBrowserInit = {
     var disabledItems = ['Browser:SavePage',
                          'Browser:SendLink', 'cmd_pageSetup', 'cmd_print', 'cmd_find', 'cmd_findAgain',
                          'viewToolbarsMenu', 'viewSidebarMenuMenu', 'Browser:Reload',
                          'viewFullZoomMenu', 'pageStyleMenu', 'charsetMenu', 'View:PageSource', 'View:FullScreen',
                          'viewHistorySidebar', 'Browser:AddBookmarkAs', 'Browser:BookmarkAllTabs',
                          'View:PageInfo', 'Tasks:InspectPage', 'Browser:ToggleTabView', 'Browser:ToggleAddonBar'];
     var element;
 
-  for (let disabledItem of disabledItems) {
-    element = document.getElementById(disabledItem);
+    for (let disabledItem of disabledItems) {
+      element = document.getElementById(disabledItem);
       if (element)
         element.setAttribute("disabled", "true");
     }
 
     // If no windows are active (i.e. we're the hidden window), disable the close, minimize
     // and zoom menu commands as well
     if (window.location.href == "chrome://browser/content/hiddenWindow.xul") {
       var hiddenWindowDisabledItems = ['cmd_close', 'minimizeWindow', 'zoomWindow'];
-    for (let hiddenWindowDisabledItem of hiddenWindowDisabledItems) {
-      element = document.getElementById(hiddenWindowDisabledItem);
+      for (let hiddenWindowDisabledItem of hiddenWindowDisabledItems) {
+        element = document.getElementById(hiddenWindowDisabledItem);
         if (element)
           element.setAttribute("disabled", "true");
       }
 
       // also hide the window-list separator
       element = document.getElementById("sep-window-list");
       element.setAttribute("hidden", "true");
 
--- a/layout/style/ImageLoader.cpp
+++ b/layout/style/ImageLoader.cpp
@@ -71,16 +71,23 @@ ImageLoader::AssociateRequestToFrame(img
     NS_ASSERTION(frameSet, "This should never be null!");
   }
 
   if (!frameSet) {
     nsAutoPtr<FrameSet> newFrameSet(new FrameSet());
 
     mRequestToFrameMap.Put(aRequest, newFrameSet);
     frameSet = newFrameSet.forget();
+
+    nsPresContext* presContext = GetPresContext();
+    if (presContext) {
+      nsLayoutUtils::RegisterImageRequestIfAnimated(presContext,
+                                                    aRequest,
+                                                    nullptr);
+    }
   }
 
   RequestSet* requestSet = nullptr;
   if (mFrameToRequestMap.Get(aFrame, &requestSet)) {
     NS_ASSERTION(requestSet, "This should never be null");
   }
 
   if (!requestSet) {
@@ -360,22 +367,25 @@ ImageLoader::OnStartContainer(imgIReques
   aImage->SetAnimationMode(presContext->ImageAnimationMode());
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 ImageLoader::OnImageIsAnimated(imgIRequest* aRequest)
 {
-  // NB: Don't ignore this when cloning, it's our only chance to register
-  // the request with the refresh driver.
   if (!mDocument) {
     return NS_OK;
   }
 
+  FrameSet* frameSet = nullptr;
+  if (!mRequestToFrameMap.Get(aRequest, &frameSet)) {
+    return NS_OK;
+  }
+
   // Register with the refresh driver now that we are aware that
   // we are animated.
   nsPresContext* presContext = GetPresContext();
   if (presContext) {
     nsLayoutUtils::RegisterImageRequest(presContext,
                                         aRequest,
                                         nullptr);
   }