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:
Hiroyuki Ikezoe
2020-02-15 08:45:27 +00:00
parent 639555d28e
commit 45077c0f66
9 changed files with 94 additions and 15 deletions

View File

@@ -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);
}
}