Bug 1419021 - Part 1: Invalidate display items when we get a size for decoded images since this can change the display items we build. r=tnikkel

This breaks rendering when we try do a sync decode paint since we might not have created the nsDisplayImage/nsDisplayBackgroundImage yet (or cached the empty size) and so we never get to the actual paint call.
This commit is contained in:
Matt Woodrow 2017-12-14 17:37:56 -06:00
Родитель cd85ab8af7
Коммит 1571d5e823
2 изменённых файлов: 16 добавлений и 0 удалений

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

@ -583,6 +583,8 @@ nsImageFrame::OnSizeAvailable(imgIRequest* aRequest, imgIContainer* aImage)
intrinsicSizeChanged = true;
}
MarkNeedsDisplayItemRebuild();
if (intrinsicSizeChanged && (mState & IMAGE_GOTINITIALREFLOW)) {
// Now we need to reflow if we have an unconstrained size and have
// already gotten the initial reflow

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

@ -451,6 +451,20 @@ ImageLoader::OnSizeAvailable(imgIRequest* aRequest, imgIContainer* aImage)
aImage->SetAnimationMode(presContext->ImageAnimationMode());
FrameSet* frameSet = nullptr;
if (!mRequestToFrameMap.Get(aRequest, &frameSet)) {
return NS_OK;
}
FrameSet::size_type length = frameSet->Length();
for (FrameSet::size_type i = 0; i < length; i++) {
nsIFrame* frame = frameSet->ElementAt(i);
if (frame->StyleVisibility()->IsVisible()) {
frame->MarkNeedsDisplayItemRebuild();
}
}
return NS_OK;
}