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

[Float][Fizz][Fiber] support imagesrcset and imagesizes for ReactDOM.preload() #26940

Merged
merged 1 commit into from Jun 15, 2023

Commits on Jun 15, 2023

  1. extends image preloading to accept imagesrcset and imagesizes to hand…

    …le cases where srcset and sizes are used over src. Normally we key off an href however in the case of responsive images it is possible that no src attribute is desired. Right now this happens most prominently with Safari which does understand srcset for the img tag but not for the link preload tag. Because of this it can be detrimental to preload with a fallback src since Safari will end up downloading the wrong image 100% of the time.
    
    The solution to this is to allow the user to omit the href if they provide imagesrcset (and optionally) imagesizes. Effectively the key for image preloads will become the union of src (href), imagesrcset, and imagesizes.
    gnoff committed Jun 15, 2023
    Configuration menu
    Copy the full SHA
    2ac8183 View commit details
    Browse the repository at this point in the history