diff --git a/gfx/layers/wr/WebRenderScrollData.cpp b/gfx/layers/wr/WebRenderScrollData.cpp index bb4f53d8f4ab..6d4e167fa524 100644 --- a/gfx/layers/wr/WebRenderScrollData.cpp +++ b/gfx/layers/wr/WebRenderScrollData.cpp @@ -50,9 +50,16 @@ WebRenderLayerScrollData::Initialize(WebRenderScrollData& aOwner, MOZ_ASSERT(aItem); aItem->UpdateScrollData(&aOwner, this); - for (const ActiveScrolledRoot* asr = aItem->GetActiveScrolledRoot(); - asr && asr != aStopAtAsr; - asr = asr->mParent) { + + const ActiveScrolledRoot* asr = aItem->GetActiveScrolledRoot(); + if (ActiveScrolledRoot::IsAncestor(asr, aStopAtAsr)) { + // If the item's ASR is an ancestor of the stop-at ASR, then we don't need + // any more metrics information because we'll end up duplicating what the + // ancestor WebRenderLayerScrollData already has. + asr = nullptr; + } + + while (asr && asr != aStopAtAsr) { MOZ_ASSERT(aOwner.GetManager()); FrameMetrics::ViewID scrollId = asr->GetViewId(); if (Maybe index = aOwner.HasMetadataFor(scrollId)) { @@ -65,6 +72,7 @@ WebRenderLayerScrollData::Initialize(WebRenderScrollData& aOwner, MOZ_ASSERT(metadata->GetMetrics().GetScrollId() == scrollId); mScrollIds.AppendElement(aOwner.AddMetadata(metadata.ref())); } + asr = asr->mParent; } // aAncestorTransform, if present, is the transform from an ancestor diff --git a/layout/painting/crashtests/crashtests.list b/layout/painting/crashtests/crashtests.list index e5648aa75008..d29f414a0022 100644 --- a/layout/painting/crashtests/crashtests.list +++ b/layout/painting/crashtests/crashtests.list @@ -8,7 +8,7 @@ load 1418722-1.html load 1419917.html load 1425271-1.html load 1428906-1.html -skip-if(webrender) load 1430589-1.html # bug 1421825 for webrender +load 1430589-1.html load 1454105-1.html load 1455944-1.html load 1465305-1.html