Bug 1259872 - Don't cull all layers under an opaque layer that covers the container if that layer has a scrolled clip. r?mattwoodrow
MozReview-Commit-ID: Abmm28HiLqR
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -4889,21 +4889,20 @@ ContainerState::PostprocessRetainedLayer
Maybe<ParentLayerIntRect> clipRect = e->mLayer->GetCombinedClipRect();
if (clipRect) {
clippedOpaque.AndWith(clipRect->ToUnknownRect());
}
if (e->mLayer->GetIsFixedPosition() && e->mLayer->GetScrolledClip()) {
// The clip can move asynchronously, so we can't rely on opaque parts
// staying in the same place.
clippedOpaque.SetEmpty();
+ } else if (e->mHideAllLayersBelow) {
+ hideAll = true;
}
data->mOpaqueRegion.Or(data->mOpaqueRegion, clippedOpaque);
- if (e->mHideAllLayersBelow) {
- hideAll = true;
- }
}
if (e->mLayer->GetType() == Layer::TYPE_READBACK) {
// ReadbackLayers need to accurately read what's behind them. So,
// we don't want to do any occlusion culling of layers behind them.
// Theoretically we could just punch out the ReadbackLayer's rectangle
// from all mOpaqueRegions, but that's probably not worth doing.
opaqueRegions.Clear();
rename from layout/reftests/async-scrolling/bg-fixed-child-no-culling-ref.html
rename to layout/reftests/async-scrolling/bg-fixed-child-no-culling-1-ref.html
rename from layout/reftests/async-scrolling/bg-fixed-child-no-culling.html
rename to layout/reftests/async-scrolling/bg-fixed-child-no-culling-1.html
new file mode 100644
--- /dev/null
+++ b/layout/reftests/async-scrolling/bg-fixed-child-no-culling-2-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE HTML>
+<html>
+<body style="overflow:hidden; margin:0;">
+ <div style="width: 200px; height: 100px; background: lime; margin-top: 200px;"></div>
+ </div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/async-scrolling/bg-fixed-child-no-culling-2.html
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML>
+<html reftest-async-scroll
+ reftest-displayport-x="0" reftest-displayport-y="0"
+ reftest-displayport-w="800" reftest-displayport-h="2000"
+ reftest-async-scroll-x="0" reftest-async-scroll-y="1000">
+<body style="overflow: hidden; height: 3000px; margin: 0;">
+ <div style="height: 1200px;
+ background: linear-gradient(white, white) top left fixed no-repeat;">
+ </div>
+ <div style="width: 200px; height: 100px; background: lime;"></div>
+</body>
+</html>
--- a/layout/reftests/async-scrolling/reftest.list
+++ b/layout/reftests/async-scrolling/reftest.list
@@ -2,17 +2,18 @@ skip-if(!asyncPan) == bg-fixed-1.html bg
skip-if(!asyncPan) == bg-fixed-cover-1.html bg-fixed-cover-1-ref.html
skip-if(!asyncPan) == bg-fixed-cover-2.html bg-fixed-cover-2-ref.html
skip-if(!asyncPan) == bg-fixed-cover-3.html bg-fixed-cover-3-ref.html
skip-if(!asyncPan) == bg-fixed-child.html bg-fixed-child-ref.html
skip-if(!asyncPan) == bg-fixed-child-clip-1.html bg-fixed-child-clip-ref.html
skip-if(!asyncPan) == bg-fixed-child-clip-2.html bg-fixed-child-clip-ref.html
fuzzy(1,246) fuzzy-if(skiaContent,2,160) fuzzy-if(browserIsRemote&&d2d,53,185) skip-if(!asyncPan) == bg-fixed-child-mask.html bg-fixed-child-mask-ref.html
skip-if(!asyncPan) == bg-fixed-in-opacity.html bg-fixed-in-opacity-ref.html
-skip-if(!asyncPan) == bg-fixed-child-no-culling.html bg-fixed-child-no-culling-ref.html
+skip-if(!asyncPan) == bg-fixed-child-no-culling-1.html bg-fixed-child-no-culling-1-ref.html
+skip-if(!asyncPan) == bg-fixed-child-no-culling-2.html bg-fixed-child-no-culling-2-ref.html
fuzzy-if(B2G,2,5366) fuzzy-if(Android,2,4000) fuzzy-if(browserIsRemote&&cocoaWidget,2,179524) fuzzy-if(browserIsRemote&&winWidget,1,74590) skip-if(!asyncPan) == bg-fixed-transformed-image.html bg-fixed-transformed-image-ref.html
skip-if(!asyncPan) == element-1.html element-1-ref.html
pref(layers.force-active,true) skip-if(!asyncPan) == iframe-1.html iframe-1-ref.html
skip-if(!asyncPan) == nested-1.html nested-1-ref.html
skip-if(!asyncPan) == nested-2.html nested-2-ref.html
skip-if(!asyncPan) == position-fixed-1.html position-fixed-1-ref.html
skip-if(!asyncPan) == position-fixed-2.html position-fixed-2-ref.html
skip-if(!asyncPan) == position-fixed-body.html position-fixed-body-ref.html