Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Firefox 2 and SVG problems

4 views
Skip to first unread message

Andreas Neumann

unread,
Jul 15, 2006, 1:49:08 PM7/15/06
to
Hello,

I started testing Firefox 2.0b1 with SVG and ran into problems.

First problem is HTML/SVG communication.

As an example have a look at
http://www.carto.net/papers/svg/samples/canvas.shtml where there are
checkboxes in HTML that should toggle visibility in an SVG group. This
example runs fine in Firefox 1.5.x and also in Firefox 3 but has
problems in Firefox 2.

When I click on a checkbox below the map to toggle the visibility of an
svg group I get the following error message:

-----------------
Error: uncaught exception: [Exception... "Invalid pointer" nsresult:
"0x80004003 (NS_ERROR_INVALID_POINTER)" location: "JS frame ::
http://www.carto.net/papers/svg/samples/canvas.shtml :: toggle_layer ::
line 66" data: no]
-----------------

If I click it a second time it works fine. So there seems to be some
initialization problem when interacting between HTML and SVG for the
first time.

The js-code involved reads like the following:

--------------
function toggle_layer(checkbox, element_name){
//get a reference to the svg document and then to a group with
the given id
var svgobj =
document.embeds['printable_map'].getSVGDocument().getElementById(element_name);
if (!checkbox.checked){
// Hide layer.
svgobj.setAttributeNS(null,'visibility','hidden');
} else {
// Show layer.
svgobj.setAttributeNS(null,'visibility','visible');
}
}
---------------

I tested both on Windows and Macintosh with the same results.

==================

The second problem that I have is:
http://www.carto.net/williams/yosemite/

doesn't load at all in Firefox 2. It loaded fine in Firefox 1.5 and
loads in FF3 (with problems).

The CPU is always at 99% and memory bounces between 30 and 300MB up and
down but the page never loads. Finally, I have to kill the process to
make the machine usable again.

This fails on Windows XP. On MacOSX (PowerPC) I can start the Yosemite
mapping application. It loads very long and works very slow, but it
works. Unfortunately, the dynamically placed text elements don't show
up, but that might be a mac problem ...

Here is more information about my Windows system:

WinXP, SP2, Intel Pentium 4 CPU 2.26Ghz, 1GB Ram

Are other windows users more successful than I am for the Yosemite
mapping app?

====================

I can write a bug report on the first problem if it isn't yet known, but
for the second problem I don't know what to report. It's a complex
sample to debug.

Thanks for having a look at my problems,

All the best,
Andreas

Martin Honnen

unread,
Jul 15, 2006, 2:15:42 PM7/15/06
to
Andreas Neumann wrote:


> The CPU is always at 99% and memory bounces between 30 and 300MB up and
> down but the page never loads. Finally, I have to kill the process to
> make the machine usable again.

> I can write a bug report on the first problem if it isn't yet known, but
> for the second problem I don't know what to report.

If it hangs the browser and gets it to consume 99% of the CPU it is
worth reporting that as a bug. In particular if you say it worked
without problems with Firefox 1.5.


--

Martin Honnen
http://JavaScript.FAQTs.com/

Andreas Neumann

unread,
Jul 15, 2006, 2:20:16 PM7/15/06
to
>> I can write a bug report on the first problem if it isn't yet known,
>> but for the second problem I don't know what to report.
>
> If it hangs the browser and gets it to consume 99% of the CPU it is
> worth reporting that as a bug. In particular if you say it worked
> without problems with Firefox 1.5.

yes,

did you test that URL on your machine?
http://www.carto.net/williams/yosemite/ - does it load?

If yes, on what OS?

Thanks,
Andreas

Holger Will

unread,
Jul 16, 2006, 4:56:21 AM7/16/06
to
Hi Andreas

i tried http://www.carto.net/williams/yosemite/ with:

Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1b1) Gecko/20060710
Firefox/2.0b1

the first time i tried, the browsert hangs, but on a second try, i got
to loading elevation data... so while the elevation data was loading,
the browser freezes, after waiting a few minutes, when loading is done,
FireFox comes back to live, and the map is working fine.

cheers
Holger

Martin Honnen

unread,
Jul 16, 2006, 9:24:02 AM7/16/06
to
Andreas Neumann wrote:


> did you test that URL on your machine?

Not yesterday, but I have tested now on Windows XP with Mozilla/5.0
(Windows; U; Windows NT 5.1; en-US; rv:1.8.1b1) Gecko/20060714 BonEcho/2.0b1

No, it hangs the browser, getting the CPU usage up to 97-99% and having
the browser no longer react to menu/menubar use. I have to kill the
process in the task manager.

Martin Honnen

unread,
Jul 16, 2006, 10:13:08 AM7/16/06
to
Andreas Neumann wrote:


> First problem is HTML/SVG communication.
>
> As an example have a look at
> http://www.carto.net/papers/svg/samples/canvas.shtml where there are
> checkboxes in HTML that should toggle visibility in an SVG group. This
> example runs fine in Firefox 1.5.x and also in Firefox 3 but has
> problems in Firefox 2.
>
> When I click on a checkbox below the map to toggle the visibility of an
> svg group I get the following error message:
>
> -----------------
> Error: uncaught exception: [Exception... "Invalid pointer" nsresult:
> "0x80004003 (NS_ERROR_INVALID_POINTER)" location: "JS frame ::
> http://www.carto.net/papers/svg/samples/canvas.shtml :: toggle_layer ::
> line 66" data: no]
> -----------------
>
> If I click it a second time it works fine.

I see that too and made a reduced test case and filed
<https://bugzilla.mozilla.org/show_bug.cgi?id=344830>.

Andreas Neumann

unread,
Jul 17, 2006, 3:31:48 AM7/17/06
to
Thank you,

seems like there is already a patch by Boris.

Andreas

Andreas Neumann

unread,
Jul 17, 2006, 5:08:28 AM7/17/06
to
ok, I tracked down the problem a little bit.

There seems to be one function that slows down the loading extremely,
which is called onload. Its about my automatic text label placement
algorithm which is heavily based on .getBBox() - I assume that the
problem is somehow related to .getBBox() but still have to narrow the
problem down.

In this version http://www.carto.net/williams/yosemite/unstable/ the
label placement is initially deactivated (it is activate if one
activates the elevation layer). Without the label placement, the
application runs fine, with the label placement activated, it seems to
load 3-4 minutes, if it loads at all. I have to check the algorithm and
see if I can narrow down the problem. Maybe it hangs in a loop where I
didn't expect it to hang.

Andreas

0 new messages