Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the image data of a partially-available image #10808

Open
emilio opened this issue Nov 29, 2024 · 0 comments
Open

Update the image data of a partially-available image #10808

emilio opened this issue Nov 29, 2024 · 0 comments

Comments

@emilio
Copy link
Contributor

emilio commented Nov 29, 2024

What is the issue with the HTML Standard?

https://html.spec.whatwg.org/multipage/images.html#updating-the-image-data has:

  1. If urlString is the same as the current request's current URL and current request's state is partially available, then abort the image request for the pending request, queue an element task on the DOM manipulation task source given the img element to restart the animation if restart animation is set, and return.

I don't think browsers implement this (Firefox definitely doesn't). I think this is both very hard to test, and inconsistent with other mutations. That'd cause things like img.srcset = img.srcset trigger a load event or not depending on whether it was partially available.

That condition would make more sense, IMO, if it also included fully available images. Firefox does have a code-path for some mutations where we don't reload the source if the effective source hasn't changed (e.g. when re-evaluating sources as a consequence of a window resize). Is that the intention?

In any case, even with that tweak that doesn't quite match current browser behavior (though I think it'd be nice if we could make that change). E.g., changing a sizes attribute, or adding a <source> that doesn't change the URI currently fires a load event consistently, which is rather unfortunate and I think we should try to avoid if we can...

https://bug1934222.bmoattachments.org/attachment.cgi?id=9440726 has a test-case.

cc @zcorpan @tnikkel @annevk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant