Bug 819915 - Fix IsSingleFixedPositionImage to actually check if we only have a single image. r=roc, a=bajaj
authorMatt Woodrow <mwoodrow@mozilla.com>
Mon, 17 Dec 2012 17:30:57 +1300
changeset 118953 9c021b033da63caa9cb3a6521ddaf7aa029efbc0
parent 118952 1f02f40898ef0d42a7e563cf5d49b8f67003a931
child 118954 ebd0a5d75d45a3d7e0ff9dd8bf6b397158b6c3e2
push id3001
push userryanvm@gmail.com
push dateTue, 18 Dec 2012 22:05:56 +0000
treeherdermozilla-aurora@63a5fb585e84 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, bajaj
bugs819915
milestone19.0a2
Bug 819915 - Fix IsSingleFixedPositionImage to actually check if we only have a single image. r=roc, a=bajaj
layout/base/nsDisplayList.cpp
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -1696,16 +1696,19 @@ static bool RoundedRectContainsRect(cons
 bool
 nsDisplayBackgroundImage::IsSingleFixedPositionImage(nsDisplayListBuilder* aBuilder,
                                                      const nsRect& aClipRect,
                                                      gfxRect* aDestRect)
 {
   if (mIsThemed || !mBackgroundStyle)
     return false;
 
+  if (mBackgroundStyle->mLayers.Length() != 1)
+    return false;
+
   nsPresContext* presContext = mFrame->PresContext();
   uint32_t flags = aBuilder->GetBackgroundPaintFlags();
   nsRect borderArea = nsRect(ToReferenceFrame(), mFrame->GetSize());
   const nsStyleBackground::Layer &layer = mBackgroundStyle->mLayers[mLayer];
 
   if (layer.mAttachment != NS_STYLE_BG_ATTACHMENT_FIXED)
     return false;