Bug 276431 Patch 9: Handle kFullImageSpaceRect in imgIContainerObserver::OnFrameChanged impls. r=roc a=blocking
authorDaniel Holbert <dholbert@cs.stanford.edu>
Wed, 08 Sep 2010 13:40:39 -0700
changeset 52214 bf93d8c0a86996cbd0a4ade004c217aa8ebcd9e2
parent 52213 2ef2faec3e3006bab993641d5a154d1b5464f670
child 52215 6eb8d33411ab394b179171ec14ef4c1eccae0757
push id15573
push userdholbert@mozilla.com
push dateWed, 08 Sep 2010 20:57:52 +0000
treeherdermozilla-central@ec53c1b41f3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, blocking
bugs276431
milestone2.0b6pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 276431 Patch 9: Handle kFullImageSpaceRect in imgIContainerObserver::OnFrameChanged impls. r=roc a=blocking
layout/base/nsImageLoader.cpp
layout/generic/nsImageFrame.cpp
--- a/layout/base/nsImageLoader.cpp
+++ b/layout/base/nsImageLoader.cpp
@@ -198,18 +198,20 @@ NS_IMETHODIMP nsImageLoader::FrameChange
 {
   if (!mFrame)
     return NS_ERROR_FAILURE;
 
   if (!mRequest) {
     // We're in the middle of a paint anyway
     return NS_OK;
   }
-  
-  nsRect r = aDirtyRect->ToAppUnits(nsPresContext::AppUnitsPerCSSPixel());
+
+  nsRect r = (*aDirtyRect == mozilla::imagelib::kFullImageSpaceRect) ?
+    nsRect(nsPoint(0, 0), mFrame->GetSize()) :
+    aDirtyRect->ToAppUnits(nsPresContext::AppUnitsPerCSSPixel());
 
   DoRedraw(&r);
 
   return NS_OK;
 }
 
 void
 nsImageLoader::DoReflow()
--- a/layout/generic/nsImageFrame.cpp
+++ b/layout/generic/nsImageFrame.cpp
@@ -654,18 +654,20 @@ nsImageFrame::FrameChanged(imgIContainer
   if (!GetStyleVisibility()->IsVisible()) {
     return NS_OK;
   }
 
   if (IsPendingLoad(aContainer)) {
     // We don't care about it
     return NS_OK;
   }
-  
-  nsRect r = SourceRectToDest(*aDirtyRect);
+
+  nsRect r = (*aDirtyRect == mozilla::imagelib::kFullImageSpaceRect) ?
+    GetInnerArea() :
+    SourceRectToDest(*aDirtyRect);
 
   // Update border+content to account for image change
   Invalidate(r);
   return NS_OK;
 }
 
 void
 nsImageFrame::EnsureIntrinsicSizeAndRatio(nsPresContext* aPresContext)