Backed out 3 changesets (bug 1426386) for R2 failing in /layout/reftests/position-sticky/transformed-2.html on Windows on a CLOSED TREE
authorMargareta Eliza Balazs <ebalazs@mozilla.com>
Tue, 16 Jan 2018 22:57:00 +0200
changeset 721258 929bf53b16fb1e01acdcdfcb740ee4ce73eb2fda
parent 721257 2ea467872d7fcd3dbb31fcf881e4147b6dd6bebe
child 721259 916232f502fe334c45b3806dc1da41adbc4b22c6
push id95774
push usernalexander@mozilla.com
push dateTue, 16 Jan 2018 23:22:40 +0000
bugs1426386
milestone59.0a1
backs out4416e585cf770d8d94128d7d2b159502a219971e
1e675415a7a09fbc10145c51176c87e5b78451df
5402e62aaa710dd7cc2808717017306dd8dcf425
Backed out 3 changesets (bug 1426386) for R2 failing in /layout/reftests/position-sticky/transformed-2.html on Windows on a CLOSED TREE Backed out changeset 4416e585cf77 (bug 1426386) Backed out changeset 1e675415a7a0 (bug 1426386) Backed out changeset 5402e62aaa71 (bug 1426386)
gfx/layers/wr/StackingContextHelper.cpp
gfx/layers/wr/StackingContextHelper.h
layout/painting/nsDisplayList.cpp
layout/painting/nsDisplayList.h
layout/reftests/bugs/reftest.list
layout/reftests/position-sticky/reftest.list
layout/reftests/position-sticky/transformed-1-ref.html
layout/reftests/position-sticky/transformed-1.html
layout/reftests/position-sticky/transformed-2-ref.html
layout/reftests/position-sticky/transformed-2.html
--- a/gfx/layers/wr/StackingContextHelper.cpp
+++ b/gfx/layers/wr/StackingContextHelper.cpp
@@ -17,17 +17,16 @@ StackingContextHelper::StackingContextHe
   , mScale(1.0f, 1.0f)
 {
   // mOrigin remains at 0,0
 }
 
 StackingContextHelper::StackingContextHelper(const StackingContextHelper& aParentSC,
                                              wr::DisplayListBuilder& aBuilder,
                                              const nsTArray<wr::WrFilterOp>& aFilters,
-                                             const LayoutDeviceRect& aBounds,
                                              const gfx::Matrix4x4* aBoundTransform,
                                              const wr::WrAnimationProperty* aAnimation,
                                              float* aOpacityPtr,
                                              gfx::Matrix4x4* aTransformPtr,
                                              gfx::Matrix4x4* aPerspectivePtr,
                                              const gfx::CompositionOp& aMixBlendMode,
                                              bool aBackfaceVisible,
                                              bool aIsPreserve3D)
@@ -40,17 +39,17 @@ StackingContextHelper::StackingContextHe
 
   // Compute scale for fallback rendering.
   gfx::Matrix transform2d;
   if (aBoundTransform && aBoundTransform->CanDraw2D(&transform2d)) {
     mInheritedTransform = transform2d * aParentSC.mInheritedTransform;
     mScale = mInheritedTransform.ScaleFactors(true);
   }
 
-  mBuilder->PushStackingContext(wr::ToLayoutRect(aBounds),
+  mBuilder->PushStackingContext(wr::LayoutRect(),
                                 aAnimation,
                                 aOpacityPtr,
                                 aTransformPtr,
                                 aIsPreserve3D ? wr::TransformStyle::Preserve3D : wr::TransformStyle::Flat,
                                 aPerspectivePtr,
                                 wr::ToMixBlendMode(aMixBlendMode),
                                 aFilters,
                                 aBackfaceVisible);
--- a/gfx/layers/wr/StackingContextHelper.h
+++ b/gfx/layers/wr/StackingContextHelper.h
@@ -25,17 +25,16 @@ namespace layers {
  * some of the coordinate space transformations needed.
  */
 class MOZ_RAII StackingContextHelper
 {
 public:
   StackingContextHelper(const StackingContextHelper& aParentSC,
                         wr::DisplayListBuilder& aBuilder,
                         const nsTArray<wr::WrFilterOp>& aFilters = nsTArray<wr::WrFilterOp>(),
-                        const LayoutDeviceRect& aBounds = LayoutDeviceRect(),
                         const gfx::Matrix4x4* aBoundTransform = nullptr,
                         const wr::WrAnimationProperty* aAnimation = nullptr,
                         float* aOpacityPtr = nullptr,
                         gfx::Matrix4x4* aTransformPtr = nullptr,
                         gfx::Matrix4x4* aPerspectivePtr = nullptr,
                         const gfx::CompositionOp& aMixBlendMode = gfx::CompositionOp::OP_OVER,
                         bool aBackfaceVisible = true,
                         bool aIsPreserve3D = false);
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -605,18 +605,17 @@ AddAnimationForProperty(nsIFrame* aFrame
       static_cast<uint8_t>(segment.mToComposite);
     animSegment->sampleFn() = ToTimingFunction(segment.mTimingFunction);
   }
 }
 
 static void
 AddAnimationsForProperty(nsIFrame* aFrame, nsDisplayListBuilder* aBuilder,
                          nsDisplayItem* aItem, nsCSSPropertyID aProperty,
-                         AnimationInfo& aAnimationInfo, bool aPending,
-                         bool aIsForWebRender)
+                         AnimationInfo& aAnimationInfo, bool aPending)
 {
   if (aPending) {
     aAnimationInfo.ClearAnimationsForNextTransaction();
   } else {
     aAnimationInfo.ClearAnimations();
   }
 
   // Update the animation generation on the layer. We need to do this before
@@ -663,21 +662,17 @@ AddAnimationsForProperty(nsIFrame* aFram
     int32_t devPixelsToAppUnits = aFrame->PresContext()->AppUnitsPerDevPixel();
     float scale = devPixelsToAppUnits;
     Point3D offsetToTransformOrigin =
       nsDisplayTransform::GetDeltaToTransformOrigin(aFrame, scale, &bounds);
     nsPoint origin;
     float scaleX = 1.0f;
     float scaleY = 1.0f;
     bool hasPerspectiveParent = false;
-    if (aIsForWebRender) {
-      // leave origin empty, because we are sending it separately on the stacking
-      // context that we are pushing to WR, and WR will automatically include
-      // it when picking up the animated transform values
-    } else if (aItem) {
+    if (aItem) {
       // This branch is for display items to leverage the cache of
       // nsDisplayListBuilder.
       origin = aItem->ToReferenceFrame();
     } else {
       // This branch is running for restyling.
       // Animations are animated at the coordination of the reference
       // frame outside, not the given frame itself.  The given frame
       // is also reference frame too, so the parent's reference frame
@@ -845,17 +840,17 @@ nsDisplayListBuilder::AddAnimationsAndTr
   if (!(backend == layers::LayersBackend::LAYERS_CLIENT ||
         backend == layers::LayersBackend::LAYERS_WR)) {
     return;
   }
 
   bool pending = !aBuilder;
   AnimationInfo& animationInfo = aLayer->GetAnimationInfo();
   AddAnimationsForProperty(aFrame, aBuilder, aItem, aProperty,
-                           animationInfo, pending, false);
+                           animationInfo, pending);
   animationInfo.TransferMutatedFlagToLayer(aLayer);
 }
 
 nsDisplayItem*
 nsDisplayListBuilder::MergeItems(nsTArray<nsDisplayItem*>& aMergedItems)
 {
   // For merging, we create a temporary item by cloning the last item of the
   // mergeable items list. This ensures that the temporary item will have the
@@ -6668,17 +6663,17 @@ nsDisplayOpacity::CreateWebRenderCommand
                                           nsDisplayListBuilder* aDisplayListBuilder)
 {
   float* opacityForSC = &mOpacity;
 
   RefPtr<WebRenderAnimationData> animationData = aManager->CommandBuilder().CreateOrRecycleWebRenderUserData<WebRenderAnimationData>(this);
   AnimationInfo& animationInfo = animationData->GetAnimationInfo();
   AddAnimationsForProperty(Frame(), aDisplayListBuilder,
                            this, eCSSProperty_opacity,
-                           animationInfo, false, true);
+                           animationInfo, false);
   animationInfo.StartPendingAnimations(aManager->GetAnimationReadyTime());
 
   // Note that animationsId can be 0 (uninitialized in AnimationInfo) if there
   // are no active animations.
   uint64_t animationsId = animationInfo.GetCompositorAnimationsId();
   wr::WrAnimationProperty prop;
 
   if (!animationInfo.GetAnimations().IsEmpty()) {
@@ -6694,17 +6689,17 @@ nsDisplayOpacity::CreateWebRenderCommand
     aManager->WrBridge()->AddWebRenderParentCommand(anim);
     aManager->AddActiveCompositorAnimationId(animationsId);
   } else if (animationsId) {
     aManager->AddCompositorAnimationsIdForDiscard(animationsId);
     animationsId = 0;
   }
 
   nsTArray<mozilla::wr::WrFilterOp> filters;
-  StackingContextHelper sc(aSc, aBuilder, filters, LayoutDeviceRect(), nullptr,
+  StackingContextHelper sc(aSc, aBuilder, filters, nullptr,
                            animationsId ? &prop : nullptr,
                            opacityForSC);
 
   aManager->CommandBuilder().CreateWebRenderCommandsFromDisplayList(&mList,
                                                                     aDisplayListBuilder,
                                                                     sc,
                                                                     aBuilder,
                                                                     aResources);
@@ -6748,19 +6743,18 @@ nsDisplayBlendMode::GetLayerState(nsDisp
 bool
 nsDisplayBlendMode::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilder,
                                             mozilla::wr::IpcResourceUpdateQueue& aResources,
                                             const StackingContextHelper& aSc,
                                             mozilla::layers::WebRenderLayerManager* aManager,
                                             nsDisplayListBuilder* aDisplayListBuilder)
 {
   nsTArray<mozilla::wr::WrFilterOp> filters;
-  StackingContextHelper sc(aSc, aBuilder, filters, LayoutDeviceRect(), nullptr,
-                           0, nullptr, nullptr, nullptr,
-                           nsCSSRendering::GetGFXBlendMode(mBlendMode));
+  StackingContextHelper sc(aSc, aBuilder, filters, nullptr, 0, nullptr, nullptr,
+                           nullptr, nsCSSRendering::GetGFXBlendMode(mBlendMode));
 
   return nsDisplayWrapList::CreateWebRenderCommands(aBuilder,aResources, sc,
                                                     aManager, aDisplayListBuilder);
 }
 
 // nsDisplayBlendMode uses layers for rendering
 already_AddRefed<Layer>
 nsDisplayBlendMode::BuildLayer(nsDisplayListBuilder* aBuilder,
@@ -7002,17 +6996,17 @@ nsDisplayOwnLayer::CreateWebRenderComman
   mWrAnimationId = animationInfo.GetCompositorAnimationsId();
 
 
   wr::WrAnimationProperty prop;
   prop.id = mWrAnimationId;
   prop.effect_type = wr::WrAnimationType::Transform;
 
   StackingContextHelper sc(aSc, aBuilder, nsTArray<wr::WrFilterOp>(),
-                           LayoutDeviceRect(), nullptr, &prop);
+                           nullptr, &prop);
 
   nsDisplayWrapList::CreateWebRenderCommands(aBuilder, aResources, sc,
                                              aManager, aDisplayListBuilder);
   return true;
 }
 
 bool
 nsDisplayOwnLayer::UpdateScrollData(mozilla::layers::WebRenderScrollData* aData,
@@ -8419,28 +8413,19 @@ nsDisplayTransform::GetTransform() const
         GetResultingTransformMatrix(mFrame, ToReferenceFrame(),
                                     scale, INCLUDE_PERSPECTIVE|OFFSET_BY_ORIGIN);
     }
   }
   return mTransform;
 }
 
 Matrix4x4
-nsDisplayTransform::GetTransformForRendering(LayoutDevicePoint* aOutOrigin)
+nsDisplayTransform::GetTransformForRendering()
 {
   if (!mFrame->HasPerspective() || mTransformGetter || mIsTransformSeparator) {
-    if (!mTransformGetter && !mIsTransformSeparator && aOutOrigin) {
-      // If aOutOrigin is provided, put the offset to origin into it, because
-      // we need to keep it separate for webrender. The combination of
-      // *aOutOrigin and the returned matrix here should always be equivalent
-      // to what GetTransform() would have returned.
-      float scale = mFrame->PresContext()->AppUnitsPerDevPixel();
-      *aOutOrigin = LayoutDevicePoint::FromAppUnits(ToReferenceFrame(), scale);
-      return GetResultingTransformMatrix(mFrame, nsPoint(0, 0), scale, INCLUDE_PERSPECTIVE);
-    }
     return GetTransform();
   }
   MOZ_ASSERT(!mTransformGetter);
 
   float scale = mFrame->PresContext()->AppUnitsPerDevPixel();
   // Don't include perspective transform, or the offset to origin, since
   // nsDisplayPerspective will handle both of those.
   return GetResultingTransformMatrix(mFrame, ToReferenceFrame(), scale, 0);
@@ -8486,38 +8471,31 @@ nsDisplayTransform::ShouldBuildLayerEven
 
 bool
 nsDisplayTransform::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilder,
                                             mozilla::wr::IpcResourceUpdateQueue& aResources,
                                             const StackingContextHelper& aSc,
                                             WebRenderLayerManager* aManager,
                                             nsDisplayListBuilder* aDisplayListBuilder)
 {
-  // We want to make sure we don't pollute the transform property in the WR
-  // stacking context by including the position of this frame (relative to the
-  // parent reference frame). We need to keep those separate; the position of
-  // this frame goes into the stacking context bounds while the transform goes
-  // into the transform.
-  LayoutDevicePoint position;
-  Matrix4x4 newTransformMatrix = GetTransformForRendering(&position);
-
+  Matrix4x4 newTransformMatrix = GetTransformForRendering();
   gfx::Matrix4x4* transformForSC = &newTransformMatrix;
   if (newTransformMatrix.IsIdentity()) {
     // If the transform is an identity transform, strip it out so that WR
     // doesn't turn this stacking context into a reference frame, as it
     // affects positioning. Bug 1345577 tracks a better fix.
     transformForSC = nullptr;
   }
 
   RefPtr<WebRenderAnimationData> animationData = aManager->CommandBuilder().CreateOrRecycleWebRenderUserData<WebRenderAnimationData>(this);
 
   AnimationInfo& animationInfo = animationData->GetAnimationInfo();
   AddAnimationsForProperty(Frame(), aDisplayListBuilder,
                            this, eCSSProperty_transform,
-                           animationInfo, false, true);
+                           animationInfo, false);
   animationInfo.StartPendingAnimations(aManager->GetAnimationReadyTime());
 
   // Note that animationsId can be 0 (uninitialized in AnimationInfo) if there
   // are no active animations.
   uint64_t animationsId = animationInfo.GetCompositorAnimationsId();
   wr::WrAnimationProperty prop;
   if (!animationInfo.GetAnimations().IsEmpty()) {
     // Update transfrom as nullptr in stacking context if there exists
@@ -8541,17 +8519,16 @@ nsDisplayTransform::CreateWebRenderComma
     aManager->AddCompositorAnimationsIdForDiscard(animationsId);
     animationsId = 0;
   }
 
   nsTArray<mozilla::wr::WrFilterOp> filters;
   StackingContextHelper sc(aSc,
                            aBuilder,
                            filters,
-                           LayoutDeviceRect(position, LayoutDeviceSize()),
                            &newTransformMatrix,
                            animationsId ? &prop : nullptr,
                            nullptr,
                            transformForSC,
                            nullptr,
                            gfx::CompositionOp::OP_OVER,
                            !BackfaceIsHidden(),
                            mFrame->Extend3DContext() && !mNoExtendContext);
@@ -9166,17 +9143,16 @@ nsDisplayPerspective::CreateWebRenderCom
                         0);
 
   gfx::Matrix4x4 transformForSC = gfx::Matrix4x4::Translation(roundedOrigin);
 
   nsTArray<mozilla::wr::WrFilterOp> filters;
   StackingContextHelper sc(aSc,
                            aBuilder,
                            filters,
-                           LayoutDeviceRect(),
                            nullptr,
                            0,
                            nullptr,
                            &transformForSC,
                            &perspectiveMatrix,
                            gfx::CompositionOp::OP_OVER,
                            !BackfaceIsHidden(),
                            true);
@@ -9941,18 +9917,17 @@ nsDisplayFilter::CreateWebRenderCommands
         break;
       }
       default:
         return false;
     }
   }
 
   float opacity = mFrame->StyleEffects()->mOpacity;
-  StackingContextHelper sc(aSc, aBuilder, wrFilters, LayoutDeviceRect(), nullptr,
-                           0, opacity != 1.0f && mHandleOpacity ? &opacity : nullptr);
+  StackingContextHelper sc(aSc, aBuilder, wrFilters, nullptr, 0, opacity != 1.0f && mHandleOpacity ? &opacity : nullptr);
 
   nsDisplaySVGEffects::CreateWebRenderCommands(aBuilder, aResources, sc, aManager, aDisplayListBuilder);
   return true;
 }
 
 #ifdef MOZ_DUMP_PAINTING
 void
 nsDisplayFilter::PrintEffects(nsACString& aTo)
--- a/layout/painting/nsDisplayList.h
+++ b/layout/painting/nsDisplayList.h
@@ -6150,17 +6150,17 @@ public:
 
   /**
    * We include the perspective matrix from our containing block for the
    * purposes of visibility calculations, but we exclude it from the transform
    * we set on the layer (for rendering), since there will be an
    * nsDisplayPerspective created for that.
    */
   const Matrix4x4& GetTransform() const;
-  Matrix4x4 GetTransformForRendering(mozilla::LayoutDevicePoint* aOutOrigin = nullptr);
+  Matrix4x4 GetTransformForRendering();
 
   /**
    * Return the transform that is aggregation of all transform on the
    * preserves3d chain.
    */
   const Matrix4x4& GetAccumulatedPreserved3DTransform(nsDisplayListBuilder* aBuilder);
 
   float GetHitDepthAtPoint(nsDisplayListBuilder* aBuilder, const nsPoint& aPoint);
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -1856,17 +1856,17 @@ pref(layout.css.moz-document.content.ena
 == 1059498-1.html 1059498-1-ref.html
 == 1059498-2.html 1059498-1-ref.html
 == 1059498-3.html 1059498-1-ref.html
 == 1062108-1.html 1062108-1-ref.html
 == 1062792-1.html 1062792-1-ref.html
 == 1062963-floatmanager-reflow.html 1062963-floatmanager-reflow-ref.html
 test-pref(dom.webcomponents.shadowdom.enabled,true) == 1066554-1.html 1066554-1-ref.html
 == 1069716-1.html 1069716-1-ref.html
-== 1078262-1.html about:blank
+fails-if(webrender) == 1078262-1.html about:blank
 test-pref(layout.testing.overlay-scrollbars.always-visible,false) == 1081072-1.html 1081072-1-ref.html
 == 1081185-1.html 1081185-1-ref.html
 == 1097437-1.html 1097437-1-ref.html
 == 1103258-1.html 1103258-1-ref.html # assertion crash test with layers culling test
 == 1105137-1.html 1105137-1-ref.html
 fuzzy-if(d2d,36,304) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)&&d2d,127,701) == 1116480-1-fakeitalic-overflow.html 1116480-1-fakeitalic-overflow-ref.html
 == 1111753-1.html about:blank
 == 1114526-1.html 1114526-1-ref.html
--- a/layout/reftests/position-sticky/reftest.list
+++ b/layout/reftests/position-sticky/reftest.list
@@ -44,10 +44,8 @@ skip-if(!asyncPan) == inline-4.html inli
 fails == column-contain-1a.html column-contain-1-ref.html
 == column-contain-1b.html column-contain-1-ref.html
 == column-contain-2.html column-contain-2-ref.html
 == block-in-inline-1.html block-in-inline-1-ref.html
 fuzzy-if(skiaContent,1,22) fuzzy-if(winWidget&&!layersGPUAccelerated,116,1320) fuzzy-if(Android,8,1533) == block-in-inline-2.html block-in-inline-2-ref.html
 fuzzy-if(Android,8,630) fuzzy-if(OSX,1,11) fuzzy-if(skiaContent,1,220) fuzzy-if(winWidget&&!layersGPUAccelerated,116,1320) == block-in-inline-3.html block-in-inline-3-ref.html
 == block-in-inline-continuations.html block-in-inline-continuations-ref.html
 == iframe-1.html iframe-1-ref.html
-== transformed-1.html transformed-1-ref.html
-fuzzy-if(Android,2,4) == transformed-2.html transformed-2-ref.html
deleted file mode 100644
--- a/layout/reftests/position-sticky/transformed-1-ref.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<!DOCTYPE html>
-<html style="margin: 0">
-  <body style="margin: 0">
-    <div style="height: 70px; background-color: blue"></div>
-    <div style="height: 2000px;">
-        <div style="margin-top: 50px; width: 100px; height: 100px; background-color: green"></div>
-    </div>
-</html>
deleted file mode 100644
--- a/layout/reftests/position-sticky/transformed-1.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<!DOCTYPE html>
-<html style="margin: 0">
-  <body style="margin: 0">
-    <div style="height: 70px; background-color: blue"></div>
-    <div style="height: 2000px; transform: translateY(50px)">
-        <div style="position:sticky; top: 70px; width: 100px; height: 100px; background-color: green"></div>
-    </div>
-</html>
deleted file mode 100644
--- a/layout/reftests/position-sticky/transformed-2-ref.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE html>
-<html style="margin: 0" class="reftest-wait">
-  <body style="margin: 0">
-    <div style="height: 70px; background-color: blue"></div>
-    <div style="height: 1950px;">
-        <div style="margin-top: 100px; width: 100px; height: 100px; background-color: green"></div>
-    </div>
-  <script>
-    addEventListener('load', function() {
-      document.scrollingElement.scrollTop = 50;
-      document.documentElement.classList.remove('reftest-wait');
-    }, false);
-  </script>
-</html>
deleted file mode 100644
--- a/layout/reftests/position-sticky/transformed-2.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<!DOCTYPE html>
-<html style="margin: 0" reftest-async-scroll reftest-async-scroll-y="50">
-  <body style="margin: 0">
-    <div style="height: 70px; background-color: blue"></div>
-    <div style="height: 2000px; transform: translateY(50px)">
-        <div style="position:sticky; top: 70px; width: 100px; height: 100px; background-color: green"></div>
-    </div>
-</html>