Open Bug 1611387 Opened 4 years ago Updated 2 years ago

Show the image loading state when mouse is hovering over the image src attribute

Categories

(DevTools :: Inspector, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: hiro, Unassigned)

References

(Blocks 1 open bug)

Details

Currently when mouse is hovering over the image src attribute and the image in question hasn't finished loading, the tooltip says "Could not load the image". For lazy-loading images it would be nice to show some messages representing that the image hasn't loaded due to lazy-loading or some thing like that.

For information:

Lazy-loading spec is spread out in various part of HTML spec, see the first comment in https://github.com/whatwg/html/pull/3752.

Also, determining what state an image is in at any given point in time is probably going to be non trivial. Having access to some helper that tells us whether the image is set to lazily load and what state it currently is in sounds like something we should do.
From Hiro:

exposing this nsImageLoadingContent::ImageState might be sufficient, but I am not 100% sure. It's a DOM world. :slightly_smiling_face: I am not familiar with. https://searchfox.org/mozilla-central/rev/f98dad153b59a985efd4505912588d4651033395/dom/base/nsImageLoadingContent.h#131

Today I realized that the tooltip will never be updated once after it was created. For example, given on a slow network connection, after DOM tree was generated but images are still being loaded, at the moment, the tooltip says "Could not load the image" and after the load has finished, the tooltip is still "Could not load the image". As of now, this is not a big problem, but with lazy-load images it will be more noticeable. We should probably listen "load" event once we create the tooltip and update it once after the image has finished loading.

Depends on: 1615303
No longer depends on: lazyload
Blocks: 1615303
No longer depends on: 1615303
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.