diff --git a/src/dom/document-cloner.ts b/src/dom/document-cloner.ts
index d520e01..4e644ce 100644
--- a/src/dom/document-cloner.ts
+++ b/src/dom/document-cloner.ts
@@ -132,8 +132,15 @@ export class DocumentCloner {
}
const clone = node.cloneNode(false) as T;
- if (isImageElement(clone) && clone.loading === 'lazy') {
- clone.loading = 'eager';
+ if (isImageElement(clone)) {
+ if (isImageElement(node) && node.currentSrc && node.currentSrc !== node.src) {
+ clone.src = node.currentSrc;
+ clone.srcset = '';
+ }
+
+ if (clone.loading === 'lazy') {
+ clone.loading = 'eager';
+ }
}
return clone;
diff --git a/tests/reftests/images/images.html b/tests/reftests/images/images.html
index e478316..acf3dd9 100644
--- a/tests/reftests/images/images.html
+++ b/tests/reftests/images/images.html
@@ -24,6 +24,9 @@
+
+
+