Bug 828146. Ensure nsDisplayBackgroundImage::ComputeInvalidationRegion invalidates something for nsDisplayBackgroundImages which are themed. r=mattwoodrow
authorRobert O'Callahan <robert@ocallahan.org>
Fri, 01 Feb 2013 17:09:32 +1300
changeset 130425 d7f45e033103adeb610c600d3ef6cc34c70a6047
parent 130424 fa772ccdf19d995b446324e88b2c5b7383b90e94
child 130426 93a4d0995cba3b5a46c5b76d2c4c39d3f09b28dd
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs828146
milestone21.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 828146. Ensure nsDisplayBackgroundImage::ComputeInvalidationRegion invalidates something for nsDisplayBackgroundImages which are themed. r=mattwoodrow
layout/base/nsDisplayList.cpp
layout/reftests/bugs/828146-1-ref.html
layout/reftests/bugs/828146-1.html
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -2060,16 +2060,19 @@ nsDisplayBackgroundImage::IsVaryingRelat
   return aFrame->GetParent() &&
     (aFrame == mFrame ||
      nsLayoutUtils::IsProperAncestorFrame(aFrame, mFrame));
 }
 
 nsRect
 nsDisplayBackgroundImage::GetPositioningArea()
 {
+  if (mIsThemed) {
+    return nsRect(ToReferenceFrame(), mFrame->GetSize());
+  }
   if (!mBackgroundStyle) {
     return nsRect();
   }
   nsIFrame* attachedToFrame;
   return nsCSSRendering::ComputeBackgroundPositioningArea(
       mFrame->PresContext(), mFrame,
       nsRect(ToReferenceFrame(), mFrame->GetSize()),
       *mBackgroundStyle, mBackgroundStyle->mLayers[mLayer],
@@ -2133,17 +2136,17 @@ nsDisplayBackgroundImage::PaintInternal(
                                   flags, aClipRect, mLayer);
 
 }
 
 void nsDisplayBackgroundImage::ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder,
                                                          const nsDisplayItemGeometry* aGeometry,
                                                          nsRegion* aInvalidRegion)
 {
-  if (!mBackgroundStyle) {
+  if (!mIsThemed && !mBackgroundStyle) {
     return;
   }
 
   const nsDisplayBackgroundGeometry* geometry = static_cast<const nsDisplayBackgroundGeometry*>(aGeometry);
 
   bool snap;
   nsRect bounds = GetBounds(aBuilder, &snap);
   nsRect positioningArea = GetPositioningArea();
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/828146-1-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+<div style="width:100px; height:100px; position:relative; top:60px; -moz-appearance:button"></div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/828146-1.html
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML>
+<html class="reftest-wait">
+<body>
+<div id="b" style="width:100px; height:100px; position:relative; top:50px; -moz-appearance:button"></div>
+<script>
+var b = document.getElementById("b");
+function doTest() {
+  b.style.top = "60px";
+  document.documentElement.removeAttribute("class");
+}
+window.addEventListener("MozReftestInvalidate", doTest, false);
+</script>
+</body>
+</html>