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:
@@ -114,7 +114,6 @@ HTMLImageElement::HTMLImageElement(
|
||||
: nsGenericHTMLElement(std::move(aNodeInfo)),
|
||||
mForm(nullptr),
|
||||
mInDocResponsiveContent(false),
|
||||
mLazyLoading(false),
|
||||
mCurrentDensity(1.0) {
|
||||
// We start out broken
|
||||
AddStatesSilently(NS_EVENT_STATE_BROKEN);
|
||||
@@ -1267,6 +1266,7 @@ void HTMLImageElement::SetLazyLoading() {
|
||||
OwnerDoc()->GetLazyLoadImageObserver()) {
|
||||
lazyLoadObserver->Observe(*this);
|
||||
mLazyLoading = true;
|
||||
UpdateImageState(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user