Bug 1612649 - Call UpdateImageState in SetDeferredLoad to start with not broken state for lazy load images. r=emilio
So that we can generate nsImageFrame for lazy load image elements in the first place. Differential Revision: https://phabricator.services.mozilla.com/D61942
This commit is contained in:
@@ -106,6 +106,7 @@ nsImageLoadingContent::nsImageLoadingContent()
|
||||
mSuppressed(false),
|
||||
mNewRequestsWillNeedAnimationReset(false),
|
||||
mUseUrgentStartForChannel(false),
|
||||
mLazyLoading(false),
|
||||
mStateChangerDepth(0),
|
||||
mCurrentRequestRegistered(false),
|
||||
mPendingRequestRegistered(false),
|
||||
@@ -1303,9 +1304,12 @@ void nsImageLoadingContent::UpdateImageState(bool aNotify) {
|
||||
} else if (mImageBlockingStatus == nsIContentPolicy::REJECT_TYPE) {
|
||||
mUserDisabled = true;
|
||||
} else if (!mCurrentRequest) {
|
||||
// No current request means error, since we weren't disabled or suppressed
|
||||
mBroken = true;
|
||||
RejectDecodePromises(NS_ERROR_DOM_IMAGE_BROKEN);
|
||||
if (!mLazyLoading) {
|
||||
// In case of non-lazy loading, no current request means error, since we
|
||||
// weren't disabled or suppressed
|
||||
mBroken = true;
|
||||
RejectDecodePromises(NS_ERROR_DOM_IMAGE_BROKEN);
|
||||
}
|
||||
} else {
|
||||
uint32_t currentLoadStatus;
|
||||
nsresult rv = mCurrentRequest->GetImageStatus(¤tLoadStatus);
|
||||
|
||||
Reference in New Issue
Block a user