Bug 92025

Summary: SVG animation not working for elements inserted after parsing is finished
Product: WebKit Reporter: Florin Malita <fmalita>
Component: SVGAssignee: Florin Malita <fmalita>
Status: RESOLVED FIXED    
Severity: Normal CC: krit, pdr, schenney, stevebrooks000, webkit.review.bot, zimmermann
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Fill animation not working
none
Patch
none
Patch for landing
none
crawfish2_ganson.svg perftest run none

Description Florin Malita 2012-07-23 14:08:03 PDT
Created attachment 153859 [details]
Fill animation not working

Animation is activated from Document::implicitClose(), but deferred element insertion doesn't seem to hit that path.
Comment 1 Florin Malita 2012-08-01 10:16:39 PDT
Created attachment 155829 [details]
Patch
Comment 2 Nikolas Zimmermann 2012-08-01 11:04:06 PDT
Comment on attachment 155829 [details]
Patch

Looks sane, r=me.
Comment 3 Dirk Schulze 2012-08-01 11:05:22 PDT
Dicsussing this patch on IRC now. At least the layout test needs an update.
Comment 4 Dirk Schulze 2012-08-01 11:10:56 PDT
Comment on attachment 155829 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=155829&action=review

> LayoutTests/svg/animations/deferred-insertion.html:16
> +    if (window.layoutTestController)
> +        layoutTestController.waitUntilDone();

We discussed the patch online during your review Niko. I am fine with the patch as well, but window.layoutTestController needs to be replaced.
Comment 5 Florin Malita 2012-08-01 11:34:23 PDT
Created attachment 155847 [details]
Patch for landing
Comment 6 Florin Malita 2012-08-01 11:35:32 PDT
Thanks for reviewing this Niko & Dirk.
Comment 7 Nikolas Zimmermann 2012-08-01 12:52:08 PDT
(In reply to comment #4)
> We discussed the patch online during your review Niko. I am fine with the patch as well, but window.layoutTestController needs to be replaced.
Good catch!
Comment 8 WebKit Review Bot 2012-08-01 14:24:45 PDT
Comment on attachment 155847 [details]
Patch for landing

Clearing flags on attachment: 155847

Committed r124369: <http://trac.webkit.org/changeset/124369>
Comment 9 WebKit Review Bot 2012-08-01 14:24:49 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Philip Rogers 2012-08-02 13:50:46 PDT
I think this change may have introduced a performance regression:
http://webkit-perf.appspot.com/graph.html#tests=[[1610803,2001,173262]]&sel=none&displayrange=7&datatype=running

Pageload time went from 88ms to 92ms average. None of the boolean checks added in this patch are more than just local variable reads, so I don't know what's up.
Comment 11 Florin Malita 2012-08-03 09:41:29 PDT
(In reply to comment #10)
> I think this change may have introduced a performance regression:
> http://webkit-perf.appspot.com/graph.html#tests=[[1610803,2001,173262]]&sel=none&displayrange=7&datatype=running
> 
> Pageload time went from 88ms to 92ms average. None of the boolean checks added in this patch are more than just local variable reads, so I don't know what's up.

This seems unlikely not only because it's a lightweight test, but also because that code path is only hit on <svg> element insertion. And for this particular perftest, the conditional gets shortcut on the first test (document()->parsing() is true) as the SVG element is inserted during parsing.

Have you ruled out all the other changes in range?
Comment 12 Florin Malita 2012-08-03 09:51:52 PDT
Created attachment 156402 [details]
crawfish2_ganson.svg perftest run

I ran the perftest locally, see attached graph. First 40 runs are without this patch, last 40 with it - I cannot see a difference.