Created attachment 398848 [details]
Minimal test case
To reproduce: Open the attached template-img-srcset.html file in Safari on a 2x DPR or higher display.
Expected: Both images load the same URL.
Actual: The first image loads the correct URL. The second image (cloned from a <template>) incorrectly loads the first URL from its srcset.
Created attachment 398849 [details]
Screenshot of test case
Created attachment 398853 [details]
Does not occur in Firefox or Chrome (top). Does occur in Safari and Safari Technology Preview (bottom).
I am able to reproduce this bug in Safari Technology Preview 152 and Safari 15.6.1 on macOS 12.5.1 using attached test case and it shows "2x" and "1x" while all other browsers show "2x" and "2x".
Weirdly. on iOS 15.6.1 on iPhone 13 Pro Max, it shows "3x" and "1x". Just wanted to share latest testing results. Thanks!
Pull request: https://github.com/WebKit/WebKit/pull/3864
Based on a Twitter conversation, I've opened bug 244815. This seems very similar.
*** Bug 244815 has been marked as a duplicate of this bug. ***
Pull request: https://github.com/WebKit/WebKit/pull/4228
Committed 254361@main (ebdff21ed516): <https://commits.webkit.org/254361@main>
Reviewed commits have been landed. Closing PR #4228 and removing active labels.