Commit 34d673af authored by Chris Lord's avatar Chris Lord
Browse files

Bug 753742 - Force layer build on scroll frames with a displayport. r=tn

Force building layers for all scroll frames that have a displayport set.
This fixes gfx/layers/ipc/CompositorParent mistakenly using FrameMetrics from
incorrect frames, due to the root scroll frame not having a layer.
parent fe4f9334
Loading
Loading
Loading
Loading
+16 −11
Original line number Diff line number Diff line
@@ -2302,17 +2302,22 @@ nsGfxScrollFrameInner::BuildDisplayList(nsDisplayListBuilder* aBuilder,
  NS_ENSURE_SUCCESS(rv, rv);

  // Since making new layers is expensive, only use nsDisplayScrollLayer
  // if the area is scrollable and there's a displayport (or we're the content
  // process).
  // if the area is scrollable and we're the content process.
  // When a displayport is being used, force building of a layer so that
  // CompositorParent can always find the scrollable layer for the root content
  // document.
  if (usingDisplayport) {
    mShouldBuildLayer = true;
  } else {
    nsRect scrollRange = GetScrollRange();
    ScrollbarStyles styles = GetScrollbarStylesFromFrame();
    mShouldBuildLayer =
       (styles.mHorizontal != NS_STYLE_OVERFLOW_HIDDEN ||
        styles.mVertical != NS_STYLE_OVERFLOW_HIDDEN) &&
     (usingDisplayport ||
       (XRE_GetProcessType() == GeckoProcessType_Content &&
        (scrollRange.width > 0 || scrollRange.height > 0) &&
       (!mIsRoot || !mOuter->PresContext()->IsRootContentDocument())));
        (!mIsRoot || !mOuter->PresContext()->IsRootContentDocument()));
  }

  nsRect clip;
  nscoord radii[8];