Bug 78422

Summary: Convert svg/animations to use SMIL methods for driving the timeline
Product: WebKit Reporter: Nikolas Zimmermann <zimmermann>
Component: SVGAssignee: Nikolas Zimmermann <zimmermann>
Status: RESOLVED FIXED    
Severity: Normal CC: dglazkov, fishd, koivisto, krit, rakuco, tkent, webkit.review.bot, zherczeg, zimmermann
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 41761, 63396, 78219    
Attachments:
Description Flags
Patch
none
Follow-up patch
none
Cleanup patch
none
Cleanup patch - v2
none
Cleanup patch - v3 hausmann: review+

Description Nikolas Zimmermann 2012-02-11 14:28:40 PST
Convert svg/animations to use SMIL methods for driving the timeline.
This allows us to remove the home-brewn sampleSVGAnimationAtTime method from DRTs LayoutTestController, and the support code all around in SVGSMILElement & SMILTimeContainer.
Doing that, exposes two bugs in our SMIL implementation, that need to be resolved so that it works.
Comment 1 Nikolas Zimmermann 2012-02-11 15:31:28 PST
Created attachment 126652 [details]
Patch
Comment 2 WebKit Review Bot 2012-02-11 15:33:35 PST
Please wait for approval from fishd@chromium.org before submitting because this patch contains changes to the Chromium public API.
Comment 3 Darin Fisher (:fishd, Google) 2012-02-11 15:53:42 PST
Comment on attachment 126652 [details]
Patch

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

> Source/WebKit/chromium/public/WebFrame.h:-629
> -    virtual bool pauseSVGAnimation(const WebString& animationId,

Chromium WebKit API change looks good to me.
Comment 4 Nikolas Zimmermann 2012-02-12 04:59:32 PST
FYIL new-run-webkit-tests svg/animations --randomize-order --iterations=100
All 9000 tests ran as expected.
I don't see any flakiness anymore, even with -g.
Note that this patch also doesn't need any rebaselines, it's all cross platform.
Comment 5 Nikolas Zimmermann 2012-02-13 06:05:16 PST
CC'ing Dirk/Zoltan/Antti for review.
Comment 6 Eric Seidel (no email) 2012-02-13 11:22:36 PST
Comment on attachment 126652 [details]
Patch

Seems like we should be able to do this in smaller (more reviewable) pieces.
Comment 7 Dirk Schulze 2012-02-13 20:18:22 PST
Comment on attachment 126652 [details]
Patch

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

> Source/WebCore/ChangeLog:19
> +          via beginElement/endElement - get removed if the begin/endTImes list is updated. Why?

typo: s/endTImes/endTimes/

> Source/WebCore/ChangeLog:30
> +        - document.getElementsByTagName('animateMotion')[0], always returned 'object SVGElement', instead of

Normally this would be another bug report :)

> Source/WebCore/ChangeLog:32
> +          from SVGANimationElement were not available. Fix that by removing the last hacks from svgtags.in,

s/SVGANimationElement/SVGAnimationElement/

> Source/WebCore/ChangeLog:70
> +        * svg/svgtags.in: Enable animateMotion/hkern/mpath JS interfaces, which were not enabled, despite their IDLs existed.

Another bug report.. normally ;) Do you test them?

> LayoutTests/svg/animations/resources/SVGAnimationTestCase.js:77
> +    // We still have to name this function runRepaintTest(), as svg/dynamic-updates/

? where is repaintTest?
Comment 8 Nikolas Zimmermann 2012-02-14 00:27:36 PST
(In reply to comment #7)
> typo: s/endTImes/endTimes/
> 
> > Source/WebCore/ChangeLog:30
> > +        - document.getElementsByTagName('animateMotion')[0], always returned 'object SVGElement', instead of
> 
> Normally this would be another bug report :)
This is covered by animate-path-nested-transforms.js & animate-mpath-insert.js.

> s/SVGANimationElement/SVGAnimationElement/
Fixed.

> Another bug report.. normally ;) Do you test them?
See above, both covered by svg/animations/ tests already.

> 
> > LayoutTests/svg/animations/resources/SVGAnimationTestCase.js:77
> > +    // We still have to name this function runRepaintTest(), as svg/dynamic-updates/
Oh, that comment is outdated, will fix.
Comment 9 Nikolas Zimmermann 2012-02-14 00:36:03 PST
(In reply to comment #6)
> (From update of attachment 126652 [details])
> Seems like we should be able to do this in smaller (more reviewable) pieces.
Point taken - but I already discussed with Dirk that he'll review it as-is.
Comment 10 Nikolas Zimmermann 2012-02-14 00:42:12 PST
Committed r107682: <http://trac.webkit.org/changeset/107682>
Comment 11 Nikolas Zimmermann 2012-02-14 02:06:33 PST
Needs a follow-up change, for some last minute changes to lead to assertions in svg/animations/. Sorry.
Comment 12 Nikolas Zimmermann 2012-02-14 02:07:40 PST
Created attachment 126938 [details]
Follow-up patch
Comment 13 WebKit Review Bot 2012-02-14 02:11:29 PST
Attachment 126938 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/update-webkit']" exit_code: 9

Updating OpenSource
From git://git.webkit.org/WebKit
 + 6612fe4...3db9340 master     -> origin/master  (forced update)
Partial-rebuilding .git/svn/refs/remotes/origin/master/.rev_map.268f45cc-cd09-0410-ab3c-d52691b4dbfc ...
Currently at 107691 = 6612fe401de446ba8e6f5ae9e558e9f8593ff272
r107688 = 8a7f22a3d3816472d1f57c4f18232bbd60ff4597
r107689 = 818888131b08465aa4d43d5e865741d09553627e
r107690 = fe093cab606d262debc8805bb541892699e59265
r107691 = c38205f7c7b217af975be90407f3d5bc69157e8c
r107692 = 3db9340249163e9ff8eca4792746293bbc60277d
Done rebuilding .git/svn/refs/remotes/origin/master/.rev_map.268f45cc-cd09-0410-ab3c-d52691b4dbfc
First, rewinding head to replay your work on top of it...
Applying: [Mac][Win][WK2] Switch to RFC 6455 protocol for WebSockets
Using index info to reconstruct a base tree...
<stdin>:1578: trailing whitespace.
        
<stdin>:1647: trailing whitespace.
    
<stdin>:1657: trailing whitespace.
    
<stdin>:1672: trailing whitespace.
        return 0;        
<stdin>:1674: trailing whitespace.
    
warning: squelched 7 whitespace errors
warning: 12 lines add whitespace errors.
Falling back to patching base and 3-way merge...
warning: too many files (created: 168765 deleted: 3), skipping inexact rename detection
Auto-merging LayoutTests/ChangeLog
CONFLICT (content): Merge conflict in LayoutTests/ChangeLog
Auto-merging Source/WebCore/ChangeLog
CONFLICT (content): Merge conflict in Source/WebCore/ChangeLog
Failed to merge in the changes.
Patch failed at 0001 [Mac][Win][WK2] Switch to RFC 6455 protocol for WebSockets

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".

rebase refs/remotes/origin/master: command returned error: 1

Died at Tools/Scripts/update-webkit line 164.


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 14 Nikolas Zimmermann 2012-02-14 02:19:31 PST
Committed r107693: <http://trac.webkit.org/changeset/107693>
Comment 15 Nikolas Zimmermann 2012-02-14 04:10:27 PST
Reopening to attach new patch.
Comment 16 Nikolas Zimmermann 2012-02-14 04:10:35 PST
Created attachment 126955 [details]
Cleanup patch
Comment 17 WebKit Review Bot 2012-02-14 04:14:50 PST
Attachment 126955 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/update-webkit']" exit_code: 9

Updating OpenSource
First, rewinding head to replay your work on top of it...
Applying: [Mac][Win][WK2] Switch to RFC 6455 protocol for WebSockets
Using index info to reconstruct a base tree...
<stdin>:1578: trailing whitespace.
        
<stdin>:1647: trailing whitespace.
    
<stdin>:1657: trailing whitespace.
    
<stdin>:1672: trailing whitespace.
        return 0;        
<stdin>:1674: trailing whitespace.
    
warning: squelched 7 whitespace errors
warning: 12 lines add whitespace errors.
Falling back to patching base and 3-way merge...
warning: too many files (created: 168768 deleted: 3), skipping inexact rename detection
Auto-merging LayoutTests/ChangeLog
CONFLICT (content): Merge conflict in LayoutTests/ChangeLog
Auto-merging Source/WebCore/ChangeLog
Auto-merging Tools/ChangeLog
CONFLICT (content): Merge conflict in Tools/ChangeLog
Failed to merge in the changes.
Patch failed at 0001 [Mac][Win][WK2] Switch to RFC 6455 protocol for WebSockets

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".

rebase refs/remotes/origin/master: command returned error: 1

Died at Tools/Scripts/update-webkit line 164.


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 18 Nikolas Zimmermann 2012-02-14 04:15:33 PST
Comment on attachment 126955 [details]
Cleanup patch

The "cleanup patch" does some house-keeping, and updates chromium expectations.
Comment 19 WebKit Review Bot 2012-02-14 05:00:59 PST
Comment on attachment 126955 [details]
Cleanup patch

Attachment 126955 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/11518262

New failing tests:
svg/animations/animate-text-nested-transforms.html
Comment 20 Nikolas Zimmermann 2012-02-14 07:35:55 PST
Created attachment 126977 [details]
Cleanup patch - v2
Comment 21 WebKit Review Bot 2012-02-14 07:37:54 PST
Attachment 126977 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/update-webkit']" exit_code: 9

Updating OpenSource
First, rewinding head to replay your work on top of it...
Applying: [Mac][Win][WK2] Switch to RFC 6455 protocol for WebSockets
Using index info to reconstruct a base tree...
<stdin>:1578: trailing whitespace.
        
<stdin>:1647: trailing whitespace.
    
<stdin>:1657: trailing whitespace.
    
<stdin>:1672: trailing whitespace.
        return 0;        
<stdin>:1674: trailing whitespace.
    
warning: squelched 7 whitespace errors
warning: 12 lines add whitespace errors.
Falling back to patching base and 3-way merge...
warning: too many files (created: 168776 deleted: 3), skipping inexact rename detection
Auto-merging LayoutTests/ChangeLog
CONFLICT (content): Merge conflict in LayoutTests/ChangeLog
Auto-merging Source/WebCore/ChangeLog
CONFLICT (content): Merge conflict in Source/WebCore/ChangeLog
Auto-merging Source/WebKit2/ChangeLog
CONFLICT (content): Merge conflict in Source/WebKit2/ChangeLog
Auto-merging Tools/ChangeLog
CONFLICT (content): Merge conflict in Tools/ChangeLog
Failed to merge in the changes.
Patch failed at 0001 [Mac][Win][WK2] Switch to RFC 6455 protocol for WebSockets

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".

rebase refs/remotes/origin/master: command returned error: 1

Died at Tools/Scripts/update-webkit line 164.


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 22 WebKit Review Bot 2012-02-14 08:09:58 PST
Comment on attachment 126977 [details]
Cleanup patch - v2

Attachment 126977 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/11521280

New failing tests:
svg/animations/animate-text-nested-transforms.html
Comment 23 Nikolas Zimmermann 2012-02-14 11:23:53 PST
(In reply to comment #22)
> (From update of attachment 126977 [details])
> Attachment 126977 [details] did not pass chromium-ews (chromium-xvfb):
> Output: http://queues.webkit.org/results/11521280
> 
> New failing tests:
> svg/animations/animate-text-nested-transforms.html

Please ignore this failure for review, I'll skip it again, before landing, then check later on with the flakiness dashboard what's happening here. (The test is already marked as failing in trunk, I tried to revert it)
Comment 24 Dirk Schulze 2012-02-14 13:04:18 PST
Comment on attachment 126977 [details]
Cleanup patch - v2

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

What is that for a style problem?

> LayoutTests/ChangeLog:13
> +        to expect values like "199.98". Use "200" instead. That doesn't reduce the

Can there still be rounding issues between platforms?

> LayoutTests/ChangeLog:-400
> -        (g.setAttribute.rect.createSVGElement.rect.setAttribute.rect.setAttribute.rect.setAttribute.rect.setAttribute.rect.setAttribute.g.appendChild.animateMotion.createSVGElement.animateMotion.setAttribute.animateMotion.setAttribute.animateMotion.setAttribute.animateMotion.setAttribute.animateMotion.setAttribute.animateMotion.setAttribute.g.appendChild.rootSVGElement.appendChild.startSample):

What is that? Your change log is broken, or is it really a previous commit that caused that?

> LayoutTests/ChangeLog:-408
> -        (rootSVGElement.setAttribute.text.createSVGElement.text.setAttribute.text.textContent.string_appeared_here.text.setAttribute.animateMotion.createSVGElement.animateMotion.setAttribute.animateMotion.setAttribute.animateMotion.setAttribute.animateMotion.setAttribute.animateMotion.setAttribute.animateMotion.setAttribute.text.appendChild.rootSVGElement.appendChild.startSample):

Ditto.

> LayoutTests/svg/animations/script-tests/animate-path-nested-transforms.js:20
> +animateMotion.setAttribute("dur", "40s")

40s? Why not 4?

> LayoutTests/svg/animations/script-tests/animate-path-nested-transforms.js:41
> +        ["animation", 39.999, endSample]

Why not 3.999?

> LayoutTests/svg/animations/script-tests/animate-text-nested-transforms.js:13
> +animateMotion.setAttribute("dur", "40s")

Ditto.
Comment 25 Dirk Schulze 2012-02-14 13:05:23 PST
Ah, your ChangeLog seems indeed be broken, why does it work with the other bots?
Comment 26 Nikolas Zimmermann 2012-02-14 13:13:05 PST
(In reply to comment #24)
> (From update of attachment 126977 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=126977&action=review
> 
> What is that for a style problem?
Bot is wedged, see webkit-dev.

> 
> > LayoutTests/ChangeLog:13
> > +        to expect values like "199.98". Use "200" instead. That doesn't reduce the
> 
> Can there still be rounding issues between platforms?
I don't think so - you'll never know though.

> > LayoutTests/ChangeLog:-400
> > -        (g.setAttribute.rect.createSVGElement.rect.setAttribute.rect.setAttribute.rect.setAttribute.rect.setAttribute.rect.setAttribute.g.appendChild.animateMotion.createSVGElement.animateMotion.setAttribute.animateMotion.setAttribute.animateMotion.setAttribute.animateMotion.setAttribute.animateMotion.setAttribute.animateMotion.setAttribute.g.appendChild.rootSVGElement.appendChild.startSample):
> 
> What is that? Your change log is broken, or is it really a previous commit that caused that?
Well, prepare-ChangeLog is broken, I have to fix up the ChangeLog manually again.

> 
> > LayoutTests/ChangeLog:-408
> > -        (rootSVGElement.setAttribute.text.createSVGElement.text.setAttribute.text.textContent.string_appeared_here.text.setAttribute.animateMotion.createSVGElement.animateMotion.setAttribute.animateMotion.setAttribute.animateMotion.setAttribute.animateMotion.setAttribute.animateMotion.setAttribute.animateMotion.setAttribute.text.appendChild.rootSVGElement.appendChild.startSample):
> 
> Ditto.
Thanks.

> 
> > LayoutTests/svg/animations/script-tests/animate-path-nested-transforms.js:20
> > +animateMotion.setAttribute("dur", "40s")
> 
> 40s? Why not 4?
Ah, I talked with Rob about this on IRC. The animation runs so quick, that 0.001s may result in quite large differences from the start value (eg. rect beginning, x=50, animating to x=5000 in 1s). So I raised the duration - to make it slower. It doesn't matter at all for testing - it doesn't make the testcase slower.

> Why not 3.999?
See above.
Comment 27 Nikolas Zimmermann 2012-02-15 00:48:56 PST
Style bot is still wedged - I will upload a new version anyway to turn cr-linux ews green.
Comment 28 Nikolas Zimmermann 2012-02-15 00:49:20 PST
Created attachment 127127 [details]
Cleanup patch - v3
Comment 29 Simon Hausmann 2012-02-15 00:56:11 PST
Comment on attachment 127127 [details]
Cleanup patch - v3

rs=me
Comment 30 Nikolas Zimmermann 2012-02-15 01:00:16 PST
Comment on attachment 127127 [details]
Cleanup patch - v3

Thanks Simon, landed patch in r107791.