Description
Version
2.6.11
Reproduction link
https://codepen.io/CaseJnr/pen/VwvWbPE
Steps to reproduce
-
Open the codepen link in safari
-
Inspect the element
-
Reduce the view width below 900px and refresh the page
-
You will notice that both the red and blue image is requested.
-
Comment out the vue instance and refresh the page.
-
You will notice only the red image is requested (as expected).
What is expected?
Only the required picture resource is requested.
What is actually happening?
Both of the pictures resources are requested, causing redundant downloads.
In Safari, adding a vue instance to any page will cause redundant picture sources to be requested. The picture element will behave correctly if the vue instance is removed.
E.g.
<picture>
<source media="(max-width: 900px)" srcset="small.jpg">
<img src="large.jpg" alt="">
</picture>
By default, only the small.jpg should be requested when the view width is below 900px. However, if a vue instance is added to the page, then both the small.jpg and large.jpg are requested.
The mobile inspector shows the small.jpg request initiator as the page (expected). The large.jpg initiator is actually the vue instance.