Closed Bug 348296 Opened 18 years ago Closed 18 years ago

Nested <svg:svg> takes exponentially long to render

Categories

(Core :: SVG, defect)

PowerPC
macOS
defect
Not set
critical

Tracking

()

RESOLVED FIXED

People

(Reporter: jruderman, Assigned: tor)

Details

(Keywords: hang, testcase)

Attachments

(3 files)

Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.9a1) Gecko/20060806 Minefield/3.0a1

This testcase shows that nested <svg:svg> elements take exponentially long to render.  For example, 12 nested <svg:svg> elements make Firefox hang for about 12 seconds.

Nesting level -> time

9  ->   457 ms
10 ->  1444 ms
11 ->  3728 ms
12 -> 11983 ms
Attached file testcase
There's a small typo in the testcase that causes us problems - "viewbox" instead of "viewBox".
Attached file problematic call cycle
Assignee: general → tor
Status: NEW → ASSIGNED
Attached patch remove loopingSplinter Review
Remove cause of looping.

Seems to pass testing of modifying the hierarchy.
Attachment #233292 - Flags: review?(roc)
Why didn't you make it an SVG image? :-)
Why didn't you make it an SVG image? :-)

Can you explain to me what's really going on here?
(In reply to comment #5)
> Why didn't you make it an SVG image? :-)

kcachegrind exports PS, and given the low quality of that versus the in-program version I didn't feel it merited much further work.
(In reply to comment #6)
> Can you explain to me what's really going on here?

The initial update of a <svg:svg> element calls UpdateCoordCtx(),
which through SetParentCoordCtx() updates the viewbox rectangle in
this case because the "viewBox" attribute is not set.  This triggers a
notification to the frame (NotifyViewportChange()), which calls
NotifyCanvasTMChanged() on the children to invalidate the cached
transformation matrix.  This method called UpdateCoordCtx(), causing
the loop to repeat on the children.

Checked in.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
See also bug 408147 -- a similar static testcase hangs trunk.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: