Sign in to follow this  
excelsystems

Infinite Loop In Certain Cases

Recommended Posts

In my application content of the page which contains Fusion Chart is reloaded multiple times with AJAX request, so chart is regenerated several times which at some point causes infinite loop ONLY IE 7.

I've tracked down problem to the code of the function "global.normalizeCSSDimension" and particularly:

--

 

 

if (w.match(/^\s*\d*\.?\d*\%\s*$/) && !w.match(/^\s*0\%\s*$/) &&

container.offsetWidth === 0) {

while ((p = container.offsetParent)) {

if (p.offsetWidth > 0) {

w = (p.offsetWidth * parseFloat(w.match(/\d*/)[0]) / 100).toString();

break;

}

}

}

 

if (h.match(/^\s*\d*\.?\d*\%\s*$/) && !h.match(/^\s*0\%\s*$/) &&

container.offsetHeight <= 20) {

while ((p = container.offsetParent)) {

if (p.offsetHeight > 0) {

h = (p.offsetHeight * parseFloat(h.match(/\d*/)[0]) / 100).toString();

break;

}

}

}

--

 

The problem is that offsetHeight and offsetWidth can be 0 at the very beginning which will cause these loop never end.

I've fixed it by modifying code like this:

--

 

if (w.match(/^\s*\d*\.?\d*\%\s*$/) && !w.match(/^\s*0\%\s*$/) &&

container.offsetWidth === 0) {

if ((p = container.offsetParent) && p.offsetWidth > 0) {

w = (p.offsetWidth * parseFloat(w.match(/\d*/)[0]) / 100).toString();

}

}

 

if (h.match(/^\s*\d*\.?\d*\%\s*$/) && !h.match(/^\s*0\%\s*$/) &&

container.offsetHeight <= 20) {

if ((p = container.offsetParent) && p.offsetHeight > 0) {

h = (p.offsetHeight * parseFloat(h.match(/\d*/)[0]) / 100).toString();

}

}

--

it would be great if this issue will be fixed in the next versions of Fusion Charts

Edited by excelsystems

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi,

 

In what FusionCharts version you are facing this issue? please mention the version details.

 

Also, can you paste your sample code here?

Share this post


Link to post
Share on other sites

@version fusioncharts/3.2.3-sr1.5347 but it also does not work in 3.2.1

 

Unfortunately I do not have example because it is a part of a huge system, but original code looks dangerous and I happen to hit the case when it fails.

Share this post


Link to post
Share on other sites
Guest Sumedh

@version fusioncharts/3.2.3-sr1.5347 but it also does not work in 3.2.1

 

Unfortunately I do not have example because it is a part of a huge system, but original code looks dangerous and I happen to hit the case when it fails.

 

Hi,

 

We have released a new version of FusionCharts XT i.e., FusionCharts XT v3.2.2 Service Release 4 on 6th August, 2012.

 

Being a service release version it has many bug fixes and enhancements.

 

Could you please try using this version? and let us know if you are still replicating.

Share this post


Link to post
Share on other sites

Hi,

 

We have released a new version of FusionCharts XT i.e., FusionCharts XT v3.2.2 Service Release 4 on 6th August, 2012.

 

Being a service release version it has many bug fixes and enhancements.

 

Could you please try using this version? and let us know if you are still replicating.

 

 

Hi Sumedh,

 

I can confirm that the bug is not fixed.

I use FusionCharts version:

 

@version fusioncharts/3.2.3-sr1.5347

 

Thanks,

Andrew

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this