Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(common): execute checks when image is already loaded
With this commit, we're now able to perform checks even when the image has already been loaded (e.g., from the browser cache), and its `load` event would never be triggered. We utilize the [complete](https://html.spec.whatwg.org/#dom-img-complete) property, as specified, which indicates that the image state is fully available when the user agent has retrieved all the image data. This approach effectively triggers checks, as we no longer solely rely on the `load` event and consider that the image may already be loaded. Additionally, it helps prevent memory leaks in development mode, as `load` and `error` event listeners will still be attached to the image element.
- Loading branch information