Currently, ImageResource is
- A part of Resource, because it is a subclass of Resource and highly involved into internals of Resource such as state control of Resource, and
- A part of Image, as a kind of a wrapper of blink::Image and the entry point of ImageResourceObserver.
This complicates the ImageResource and causes layering violation.
Also, ImageResource manages timings of Resource- and Image-related callbacks, which leads to timing dependencies between them, e.g. between ResourceLoader::didFinishLoading() and <img>'s onload.
This issue splits ImageResource into Image-part and Resource-part.
(design docs to be posted)
Currently, ImageResource is
- A part of Resource, because it is a subclass of Resource and highly involved into internals of Resource such as state control of Resource, and
- A part of Image, as a kind of a wrapper of blink::Image and the entry point of ImageResourceObserver.
This complicates the ImageResource and causes layering violation.
Also, ImageResource manages timings of Resource- and Image-related callbacks, which leads to timing dependencies between them, e.g. between ResourceLoader::didFinishLoading() and <img>'s onload.
This issue splits ImageResource into Image-part and Resource-part.
Design doc:
https://docs.google.com/document/d/1O-fB83mrE0B_V8gzXNqHgmRLCvstTB4MMi3RnVLr8bE/edit?usp=sharing
This blocks ImageLoader's EventSender removal and SVG image onload fix.
For them, we need to resolve timing dependencies around image's onload events, which I expect is easier after we split ImageResource.
Comment 1 by hirosh...@chromium.org
, Nov 22 2016