Bug 1471671 - Avoid crash with WebRender when the scroll metadata is unavailable. r=kats

We are seeing crash reports in the wild where there is no scroll
metadata available for an ASR for a display item and its clip. It
appears that in the non-WR path, it skips such items, so we should
probably do the same thing with WebRender. If the scrolling ends up
being wrong, hopefully a reproducible use case will make its way to use
to further debug, as the crash reports have not yielded anything to date.

Differential Revision: https://phabricator.services.mozilla.com/D9699
This commit is contained in:
Andrew Osmond 2018-10-24 13:45:39 -04:00
Родитель f14b341517
Коммит 3370375e1c
1 изменённых файлов: 5 добавлений и 2 удалений

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

@ -292,9 +292,12 @@ ClipManager::DefineScrollLayers(const ActiveScrolledRoot* aASR,
Maybe<ScrollMetadata> metadata = aASR->mScrollableFrame->ComputeScrollMetadata(
mManager, aItem->ReferenceFrame(), Nothing(), nullptr);
MOZ_ASSERT(metadata);
FrameMetrics& metrics = metadata->GetMetrics();
if (!metadata) {
MOZ_ASSERT_UNREACHABLE("Expected scroll metadata to be available!");
return ancestorScrollId;
}
FrameMetrics& metrics = metadata->GetMetrics();
if (!metrics.IsScrollable()) {
// This item is a scrolling no-op, skip over it in the ASR chain.
return ancestorScrollId;