Skip to content

Commit 171fa30

Browse files
committed
tune
1 parent 6acd2b6 commit 171fa30

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

packages/svelte/src/internal/client/dom/elements/attributes.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ export function set_attribute(element, attribute, value) {
3939
attributes[attribute] = element.getAttribute(attribute);
4040

4141
if (attribute === 'src' || attribute === 'href' || attribute === 'srcset') {
42-
if (attribute === 'src' && /** @type {HTMLImageElement} */ (element).loading !== 'lazy') {
43-
check_src_in_dev_hydration(element, attribute, value);
44-
}
45-
4642
// If we reset these attributes, they would result in another network request, which we want to avoid.
4743
// We assume they are the same between client and server as checking if they are equal is expensive
4844
// (we can't just compare the strings as they can be different between client and server but result in the
@@ -345,7 +341,7 @@ export function handle_lazy_img(element) {
345341
// the loading and src after the img element has been appended to the document.
346342
// Otherwise the lazy behaviour will not work due to our cloneNode heuristic for
347343
// templates.
348-
if (element.loading === 'lazy') {
344+
if (!hydrating && element.loading === 'lazy') {
349345
var src = element.src;
350346
element.removeAttribute('loading');
351347
element.removeAttribute('src');

0 commit comments

Comments
 (0)