Bug 819915 - Fix IsSingleFixedPositionImage to actually check if we only have a single image. r=roc
authorMatt Woodrow <mwoodrow@mozilla.com>
Mon, 17 Dec 2012 17:30:57 +1300
changeset 125345 9d6e95e7785580d4b3756ecbfa4c18725e9791cb
parent 125344 8d66bb18b4a309ead5506630fa8c44c9553065a9
child 125346 82d45d6f8964c7d095c2e19d226fc9b25ed5850a
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs819915
milestone20.0a1
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 819915 - Fix IsSingleFixedPositionImage to actually check if we only have a single image. r=roc
layout/base/nsDisplayList.cpp
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -1728,16 +1728,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;