Issue 1032 in modpagespeed: ModPagespeedLazyloadImagesAfterOnload off should not load images in hidden divs.

18 views
Skip to first unread message

modpag...@googlecode.com

unread,
Dec 11, 2014, 2:48:22 PM12/11/14
to mod-pagesp...@googlegroups.com
Status: Accepted
Owner: jmaes...@google.com
Labels: Type-Defect Priority-Medium

New issue 1032 by jmaes...@google.com:
ModPagespeedLazyloadImagesAfterOnload off should not load images in hidden
divs.
https://code.google.com/p/modpagespeed/issues/detail?id=1032

Even though i have filter on

ModPagespeedEnableFilters lazyload_images

it loads images, which are inside hidden divs, in my case i hide some divs
for mobile view.

I have tried enabling this filter

ModPagespeedLazyloadImagesAfterOnload off

it stops loading images below the fold, but still loads images inside
hidden divs.

using pagespeed mod version 1.9.32.2-4321
server apache 2.2

NOTE: this will require revisions to lazyload.js in order to account for
hidden / visibility:none DOM elements. We may still load them – lazily –
after onload if the above option is On, but we should definitely leave them
alone if it's off.

Interesting question: What will happen if the visibility of the image
changes? We're catching onscroll, but is there some way for us to capture
the style change? If there is not, it may not be possible to do this
transformation correctly.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

modpag...@googlecode.com

unread,
Dec 11, 2014, 2:49:22 PM12/11/14
to mod-pagesp...@googlegroups.com
Updates:
Cc: dmit...@hyperlinksmedia.com

Comment #1 on issue 1032 by jmaes...@google.com:
ModPagespeedLazyloadImagesAfterOnload off should not load images in hidden
divs.
https://code.google.com/p/modpagespeed/issues/detail?id=1032

(No comment was entered for this change.)

modpag...@googlecode.com

unread,
Dec 11, 2014, 3:01:08 PM12/11/14
to mod-pagesp...@googlegroups.com

Comment #2 on issue 1032 by jmaes...@google.com:
ModPagespeedLazyloadImagesAfterOnload off should not load images in hidden
divs.
https://code.google.com/p/modpagespeed/issues/detail?id=1032

We will likely need to catch DOM mutation events for this to be safe:

http://stackoverflow.com/questions/10868104/can-you-have-a-javascript-hook-trigger-after-a-dom-elements-style-object-change

But it's not obvious that this is sufficient if the event is on (say) a
transitively containing div.

modpag...@googlecode.com

unread,
Apr 8, 2015, 2:07:25 PM4/8/15
to mod-pagesp...@googlegroups.com

Comment #3 on issue 1032 by jcro...@google.com:
ModPagespeedLazyloadImagesAfterOnload off should not load images in hidden
divs.
https://code.google.com/p/modpagespeed/issues/detail?id=1032

this issue has been migrated to github:
https://github.com/pagespeed/mod_pagespeed/issues/1032
Reply all
Reply to author
Forward
0 new messages