Bug 1421825 - Fix crash and re-enable crashtest. r=jrmuizel

In some cases we get a gecko display list that looks like this:

WrapList with asr(<A>, <B>)
  Item with asr (<B>) and clipchain(<something> [A])

In this case, we would initialize the WebRenderLayerScrollData for the
nested item using a stop-at ancestor of A (because that was the leafmost
ASR from the containing WrapList) but the item itself has an ASR of B,
which is an ancestor of A. So when walking up from B we'd never hit the
stop-at ancestor, and so we'd end up duplicating metrics from the
containing WRLSD onto the nested WRLSD. This generated an assertion
failure in the APZ code.

This patch detects this scenario and skips adding metrics on the nested
WRLSD. This produces an APZ tree equivalent to what the non-WebRender
path would produce.

MozReview-Commit-ID: 8eo6pzXXKBd

--HG--
extra : rebase_source : 0581c54c4d9fa6ca08249e42b306c7155022bec7
This commit is contained in:
Kartikaya Gupta 2018-07-10 09:37:40 -04:00
Родитель 81556be6b8
Коммит 11b43679d8
2 изменённых файлов: 12 добавлений и 4 удалений

Просмотреть файл

@ -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<size_t> 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

Просмотреть файл

@ -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