Bug 1153694 - Don't let nsDisplayFixedPosition cause unnecessary layerization around itself. r=mattwoodrow
authorMarkus Stange <mstange@themasta.com>
Thu, 02 Jun 2016 20:55:02 -0400
changeset 341300 0ed35b7de211096b16b599544b6a215689240bfe
parent 341299 bb39628ebe69337f45a7f044aef247583e0ff220
child 341301 b28d1c65f0a1bfe2e1fab40d85368382f9e6a5b9
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1153694
milestone49.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 1153694 - Don't let nsDisplayFixedPosition cause unnecessary layerization around itself. r=mattwoodrow MozReview-Commit-ID: 66q3PkOdvTe
layout/base/FrameLayerBuilder.cpp
layout/reftests/layers/layerize-over-fixed-bg-1.html
layout/reftests/layers/reftest.list
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -4000,16 +4000,20 @@ ContainerState::ProcessDisplayItems(nsDi
         // clip we care about is the overflow:hidden clip on the scrollbar.
         mPaintedLayerDataTree.AddingOwnLayer(animatedGeometryRoot->mParentAGR,
                                              clipPtr,
                                              uniformColorPtr);
       } else if (prerenderedTransform) {
         mPaintedLayerDataTree.AddingOwnLayer(animatedGeometryRoot,
                                              clipPtr,
                                              uniformColorPtr);
+      } else if (!clipMovesWithLayer) {
+        mPaintedLayerDataTree.AddingOwnLayer(animatedGeometryRootForClip,
+                                             clipPtr,
+                                             uniformColorPtr);
       } else {
         // Using itemVisibleRect here isn't perfect. itemVisibleRect can be
         // larger or smaller than the potential bounds of item's contents in
         // animatedGeometryRoot: It's too large if there's a clipped display
         // port somewhere among item's contents (see bug 1147673), and it can
         // be too small if the contents can move, because it only looks at the
         // contents' current bounds and doesn't anticipate any animations.
         // Time will tell whether this is good enough, or whether we need to do
new file mode 100644
--- /dev/null
+++ b/layout/reftests/layers/layerize-over-fixed-bg-1.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html lang="en">
+<meta charset="utf-8">
+<title>The fixed background should not cause .inner to move to a different layer than .outer</title>
+
+<style>
+
+body {
+  margin: 0;
+  height: 3000px;
+}
+
+.outer {
+  border: 1px solid black;
+  margin: 10px;
+}
+
+.outer > div {
+  margin: 10px;
+}
+
+.fixed-bg {
+  height: 100px;
+  background-image: linear-gradient(lime, lime);
+  background-attachment: fixed;
+}
+
+.inner {
+  border: 1px solid blue;
+  padding: 20px;
+}
+
+</style>
+
+<div class="outer" reftest-assigned-layer="page-background">
+  <!-- .inner and .fixed-bg do not overlap, so .inner should be merged into
+       the same layer as .outer. -->
+  <div class="fixed-bg"></div>
+  <div class="inner" reftest-assigned-layer="page-background"></div>
+</div>
--- a/layout/reftests/layers/reftest.list
+++ b/layout/reftests/layers/reftest.list
@@ -16,8 +16,9 @@ skip-if(!asyncPan) != pull-background-di
 skip-if(!asyncPan) != pull-background-displayport-2.html about:blank
 skip-if(!asyncPan) != pull-background-displayport-3.html about:blank # fails with non-overlay scrollbars and event regions due to bug 1148515
 skip-if(!asyncPan) != pull-background-displayport-4.html about:blank # fails with non-overlay scrollbars and event regions due to bug 1148515
 skip-if(!asyncPan) != pull-background-displayport-5.html about:blank
 skip-if(!asyncPan) != pull-background-displayport-6.html about:blank # fails with non-overlay scrollbars and event regions due to bug 1148515
 fuzzy(2,30150) == opacity-blending.html opacity-blending-ref.html
 fuzzy(16,5) == mask-layer-transform.html mask-layer-transform-ref.html
 fuzzy-if(gtkWidget,1,17) == forced-bg-color-outside-visible-region.html forced-bg-color-outside-visible-region-ref.html
+!= layerize-over-fixed-bg-1.html about:blank