New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lazyload_images triggers a JavaScript error on Internet Explorer 8 #442

Closed
GoogleCodeExporter opened this Issue Apr 6, 2015 · 6 comments

Comments

Projects
None yet
1 participant
@GoogleCodeExporter

GoogleCodeExporter commented Apr 6, 2015

What steps will reproduce the problem?
1. enable lazyload_images filter
2. load url with internet explorer 8
3. "Stack overflow: 0" error is triggered

What is the expected output? What do you see instead?
URL should load normally with images being lazy loaded

What version of the product are you using (please check X-Mod-Pagespeed
header)?

0.10.21.2

On what operating system?

CentOS 5 / 2.6.18-164.11.1.el5PAE

Which version of Apache?

2.2.3

Which MPM?

prefork

URL of broken page:

http://www.aramisauto.com

Original issue reported on code.google.com by tristan....@aramisauto.com on 22 May 2012 at 8:11

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Nikhil can you take a look?  Is this fixed already?

Original comment by jmara...@google.com on 24 May 2012 at 7:06

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

This seems to be fixed at head.

Original comment by nikhilma...@google.com on 25 May 2012 at 8:14

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Original comment by jmara...@google.com on 25 May 2012 at 1:02

  • Changed state: Fixed
  • Added labels: Milestone-v22, release-note
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Hi, I'm wondering how did you fixed that?

I created https://github.com/fasterize/lazyload and fixed this as well, it was 
a callstack loop trhough the onload event:

img loads with data:uris : load event
=>src change for real src : load event
=>load event loop

In fact the bug was present under all browsers but IE restricts call stack to 
11 or so of the same function.

So I only had to onload=null as soon as I registered the image within the 
lazyloader.

How did the pagespeed team fixed this?

Also I have a fix for IE6/7 to handle data:uris, see 
https://github.com/fasterize/lazyload

Thanks.

Original comment by woua...@gmail.com on 2 Jun 2012 at 10:12

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

The bug was a conflict between two compiled JS libraries, which stepped on each 
others shortened variables.  The problem was resolved (I think) by 
function(){...} isolation.

I looked your github page -- thanks for the mention and also for alerting us of 
our mistake.

You are implying that the lazyload filter will break pages when viewed on 
IE6/7; is that right?   If so we should open a new bug and resolve either by 
blacklisting this filter for ie6/ie7 or sharing your technique.

Original comment by jmara...@google.com on 2 Jun 2012 at 11:45

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Hi,

I wonder if this: 
http://code.google.com/p/modpagespeed/source/diff?spec=svn1465&r=1465&format=sid
e&path=/trunk/src/net/instaweb/rewriter/lazyload_images.js#sc_svn1384_156

wasn't the easy fix that did it for you. Using a setTimeout might reduce the 
error case.

What you should really do is nullify the onload event as soon as you received 
it as seen here: 
https://github.com/fasterize/lazyload/commit/d1bddf3207f9b873df65d7e46de9eceeabc
7690e#L0R96

As for IE6/7 they do not support data:uris url and you'll not receive any 
onload event on them. I used onerror as a dirty fix.

Original comment by woua...@gmail.com on 3 Jun 2012 at 12:38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment