| Summary: | cloneNode in safari waste network resources if the node includes an img tag in a picture tag | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Muka <nakazato.muka> | ||||||
| Component: | DOM | Assignee: | Nobody <webkit-unassigned> | ||||||
| Status: | REOPENED --- | ||||||||
| Severity: | Normal | CC: | karlcow, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | BrowserCompat, InRadar | ||||||
| Version: | Safari 16 | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Attachments: |
|
||||||||
*** This bug has been marked as a duplicate of bug 61452 *** (In reply to Alexey Proskuryakov from comment #1) > > *** This bug has been marked as a duplicate of bug 61452 *** I think that this bug is not duplicate of bug 61452. bug 61452 says " document.documentElement.cloneNode(true) causes resources to be downloaded again". This bug report says that cloneNode(true) causes network requests(i.e., images in img tags in picture tag) that would normally never occur. Created attachment 468696 [details]
testcase.html
The test
Created attachment 468697 [details]
rendering in safari, firefox, chrome
Safari reloads the resource
while other browsers ignore.
|
When cloneNode(true) is executed on a node including an img tag included in a picture tag, the source written in an img tag will be loaded, in spite of a source tag above. This behavior doesn't occur on chrome. The code below is minimal example. <!DOCTYPE html> <html> <body> <picture id="photo"> <source srcset="./photo.webp" type="image/webp"> <img src="./photo.jpg" alt="photo"> </picture> <div id="container"></div> <script> const photo = document.getElementById("photo"); const clonedPhoto =photo.cloneNode(true); document.getElementById('container').appendChild(clonedPhoto); </script> </body> </html> This is a bug? Versions: OS: Apple M1 13.4.1 (c)(22F770820d)(※This behavior occurs on iPhone, too.) Safari: 16.5.2 (18615.2.9.11.10)