Closed Bug 418206 Opened 16 years ago Closed 16 years ago

Some SVG files that appear to hang Mozilla

Categories

(Core :: SVG, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jwatt, Assigned: jwatt)

References

()

Details

(Keywords: hang, testcase)

Attachments

(1 file, 1 obsolete file)

(In reply to comment #0)
> http://srufaculty.sru.edu/david.dailey/svg/newstuff/path5.svg

doesn't crash but script are very slow.
Its |svg| element specifies |viewBox="0,0,0,600"|.

http://www.w3.org/TR/SVG11/coords.html#ViewBoxAttribute says
> A negative value for <width> or <height> is an error (see Error processing). A value of zero disables rendering of the element.

but we renders that element as a huge box.
# Should I file a bug of this?
The viewBox issue is bug 385554 I think.

On top of that the testcase has the same problems as bug 374037. I.e. using appendChild rather than insertBefore.

The appendChild slowness is bug 233463. The testcases could be speeded up replacing appendChild by insertBefore and rewriting the loops to go backwards if necessary.

Also using (un)suspendRedraw in the javascript code would presumably help.
Actually, depending on how it's done, disabling rendering isn't enough. I think the main problem is that getCanvasTM returns bogus results and causes getBBox to return a huge rect. As a result the script iterates over a huge area, and hence the "hang". If it wasn't iterating over such a large area I think the other issues would have much, much less of an impact.
Depends on: 385554
Flags: blocking1.9?
Attached patch patch (obsolete) — Splinter Review
Assignee: nobody → jwatt
Status: NEW → ASSIGNED
Attachment #304490 - Flags: review?(longsonr)
Comment on attachment 304490 [details] [diff] [review]
patch

>-    NS_NewSVGRect(getter_AddRefs(vb), 0, 0, w, h);
>+  }
>+
>+  if (!vb || w < 0.0f || h < 0.0f) {
>+    NS_NewSVGRect(getter_AddRefs(vb), 0, 0, PR_MAX(w,0.0f), PR_MAX(h,0.0f));
>   }

Nit: space after commas.

>+    } else {
>+      NS_WARNING("we should propogate the fact that the viewBox is invalid");

That's not how you spell propagate ;-)

Note that this misspelling occurs 3 times within this patch.

r=longsonr with nits fixed.
Attachment #304490 - Flags: review?(longsonr) → review+
I should get an editor with a built-in spell checker. :-)
Attachment #304490 - Attachment is obsolete: true
Attachment #304500 - Flags: superreview?(roc)
Comment on attachment 304500 [details] [diff] [review]
patch addressing review comments

Can we have a mochitest for this?
Attachment #304500 - Flags: superreview?(roc) → superreview+
Comment on attachment 304500 [details] [diff] [review]
patch addressing review comments

A crashtest would probably be best. Possibly some a Tsvg test since this is really a massive perf hit.
Attachment #304500 - Flags: approval1.9?
Comment on attachment 304500 [details] [diff] [review]
patch addressing review comments

Please make sure to file those tests. a=beltzner
Attachment #304500 - Flags: approval1.9? → approval1.9+
Flags: blocking1.9?
Closing this to clean up bugzilla. Please file follow-on bugs for tests needed.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Please don't go around closing bugs and suggesting someone files something about file up work. Things will fall through the cracks. If you're going to file this, file the follow up bug first.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Filed bug 433063 for the tests.
Status: REOPENED → RESOLVED
Closed: 16 years ago16 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: