Bug 99116 - [RequestAnimationFrame] Remove vendor prefix
Summary: [RequestAnimationFrame] Remove vendor prefix
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: James Simonsen
URL:
Keywords: WebExposed
Depends on:
Blocks:
 
Reported: 2012-10-11 16:32 PDT by James Simonsen
Modified: 2012-10-12 17:06 PDT (History)
8 users (show)

See Also:


Attachments
Patch (23.09 KB, patch)
2012-10-11 16:33 PDT, James Simonsen
no flags Details | Formatted Diff | Diff
Patch (23.50 KB, patch)
2012-10-12 10:40 PDT, James Simonsen
no flags Details | Formatted Diff | Diff
Patch (24.14 KB, patch)
2012-10-12 11:54 PDT, James Simonsen
no flags Details | Formatted Diff | Diff
Patch for landing (24.22 KB, patch)
2012-10-12 12:09 PDT, James Simonsen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Simonsen 2012-10-11 16:32:20 PDT
[RequestAnimationFrame] Remove vendor prefix
Comment 1 James Simonsen 2012-10-11 16:33:08 PDT
Created attachment 168312 [details]
Patch
Comment 2 James Robinson 2012-10-11 16:36:50 PDT
Comment on attachment 168312 [details]
Patch

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

R=me

> Source/WebCore/page/DOMWindow.idl:218
>          // WebKit animation extensions, being standardized in the WebPerf WG

probably worth updating this comment
Comment 3 Adam Barth 2012-10-11 16:38:08 PDT
Comment on attachment 168312 [details]
Patch

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

> Source/WebCore/page/DOMWindow.idl:-221
> -        long webkitRequestAnimationFrame(in [Callback] RequestAnimationFrameCallback callback);
> -        void webkitCancelAnimationFrame(in long id);
> -        void webkitCancelRequestAnimationFrame(in long id); // This is a deprecated alias for webkitCancelAnimationFrame(). Remove this when removing vendor prefix.

Do we want to expose both sets of APIs for a while?
Comment 4 Adam Barth 2012-10-11 16:39:46 PDT
Comment on attachment 168312 [details]
Patch

This patch seems a bit aggressive for this API.  Have we measured the usage of the prefixed versions?  Will this patch break sites?
Comment 5 Adam Barth 2012-10-11 16:40:35 PDT
IMHO, we should expose both versions for a while and use V8MeasureAs to measure how quickly web sites are transitioning from the prefixed to the unprefixed versions.
Comment 6 Adam Barth 2012-10-11 16:43:38 PDT
See http://lists.webkit.org/pipermail/webkit-dev/2012-September/022239.html for instructions about how to use V8MeasureAs and FeatureObserver.
Comment 7 James Simonsen 2012-10-11 16:54:38 PDT
There were a couple of reasons for making the transition.

1. Everyone else is already (or in the process of) shipping unprefixed.
2. We've changed our semantics to match the spec. So the old webkit* functions aren't compatible.
3. The major toolkits I checked already use the unprefixed version.
Comment 8 Adam Barth 2012-10-11 16:58:09 PDT
Would you be willing to email webkit-dev with this information?  Different folks in the community have different risk tolerances for these sorts of changes, and it's better to talk things through so that folks don't feel railroaded in one direction or another.

Here's a wiki page we wrote up based on previous discussions of similar changes:

https://trac.webkit.org/wiki/DeprecatingFeatures
Comment 9 James Simonsen 2012-10-12 10:40:02 PDT
Created attachment 168445 [details]
Patch
Comment 10 Adam Barth 2012-10-12 11:36:54 PDT
Comment on attachment 168445 [details]
Patch

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

> Source/WebCore/page/DOMWindow.h:270
> +        void webkitCancelAnimationFrame(int id) { cancelAnimationFrame(id); }
> +        void webkitCancelRequestAnimationFrame(int id) { cancelAnimationFrame(id); }

You can just use ImplementedAs in the IDL rather than having these stub functions here.

> Source/WebCore/page/DOMWindow.idl:216
> +    // W3C Web Performance WG Request Animation Frame standard.

I would skip this comment.  It's not adding any information.

> Source/WebCore/page/DOMWindow.idl:221
> +    long requestAnimationFrame(in [Callback] RequestAnimationFrameCallback callback);
> +    void cancelAnimationFrame(in long id);
>      long webkitRequestAnimationFrame(in [Callback] RequestAnimationFrameCallback callback);
>      void webkitCancelAnimationFrame(in long id);
>      void webkitCancelRequestAnimationFrame(in long id); // This is a deprecated alias for webkitCancelAnimationFrame(). Remove this when removing vendor prefix.

Please add V8MeasureAs attributes so that we can measure how often the prefixed versions are used.  That way we'll know have more information about when we can remove them.
Comment 11 James Simonsen 2012-10-12 11:54:00 PDT
Created attachment 168457 [details]
Patch
Comment 12 Adam Barth 2012-10-12 12:02:00 PDT
Comment on attachment 168457 [details]
Patch

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

> Source/WebCore/page/DOMWindow.idl:220
> +    long requestAnimationFrame(in [Callback] RequestAnimationFrameCallback callback);
> +    void cancelAnimationFrame(in long id);
> +    [ImplementedAs=requestAnimationFrame, V8MeasureAs=PrefixedRequestAnimationFrame] long webkitRequestAnimationFrame(in [Callback] RequestAnimationFrameCallback callback);
> +    [ImplementedAs=cancelAnimationFrame] void webkitCancelAnimationFrame(in long id);
> +    [ImplementedAs=cancelAnimationFrame] void webkitCancelRequestAnimationFrame(in long id); // This is a deprecated alias for webkitCancelAnimationFrame(). Remove this when removing vendor prefix.

Should we measure the unprefixed one as well, so we can compare, like we do for IndexedDB?
Comment 13 James Simonsen 2012-10-12 12:09:33 PDT
Created attachment 168460 [details]
Patch for landing
Comment 14 WebKit Review Bot 2012-10-12 12:48:38 PDT
Comment on attachment 168460 [details]
Patch for landing

Clearing flags on attachment: 168460

Committed r131214: <http://trac.webkit.org/changeset/131214>
Comment 15 WebKit Review Bot 2012-10-12 12:48:41 PDT
All reviewed patches have been landed.  Closing bug.
Comment 16 Pablo Flouret 2012-10-12 14:52:30 PDT
Breaks gtk? http://queues.webkit.org/results/14267238
Comment 17 Adam Barth 2012-10-12 14:58:00 PDT
Sounds like the CPP bindings need to understand ImplementedAs.

DerivedSources/webkit/WebKitDOMDOMWindow.cpp: In function 'void webkit_dom_dom_window_webkit_cancel_animation_frame(WebKitDOMDOMWindow*, glong)':
DerivedSources/webkit/WebKitDOMDOMWindow.cpp:1116:11: error: 'class WebCore::DOMWindow' has no member named 'webkitCancelAnimationFrame'
DerivedSources/webkit/WebKitDOMDOMWindow.cpp: In function 'void webkit_dom_dom_window_webkit_cancel_request_animation_frame(WebKitDOMDOMWindow*, glong)':
DerivedSources/webkit/WebKitDOMDOMWindow.cpp:1125:11: error: 'class WebCore::DOMWindow' has no member named 'webkitCancelRequestAnimationFrame'
Comment 18 James Simonsen 2012-10-12 15:53:28 PDT
(In reply to comment #17)
> Sounds like the CPP bindings need to understand ImplementedAs.

Is someone going to do that or should I go back to the old way of forwarding?
Comment 19 Pablo Flouret 2012-10-12 15:54:24 PDT
(In reply to comment #18)
> (In reply to comment #17)
> > Sounds like the CPP bindings need to understand ImplementedAs.
> 
> Is someone going to do that or should I go back to the old way of forwarding?

I have a patch almost ready. Filed bug 99214.
Comment 20 Simon Fraser (smfr) 2012-10-12 16:59:58 PDT
The changelog and commit message don't say if the prefixed version was retained. Consensus on webkit-dev was to keep both prefixed and unprefixed.
Comment 21 Simon Fraser (smfr) 2012-10-12 17:01:43 PDT
This patch should have been r- because of the lack of details in the changlog.
Comment 22 Adam Barth 2012-10-12 17:06:35 PDT
> This patch should have been r- because of the lack of details in the changlog.

Thanks for the reminder.  I was somewhat distracted today with other disasters.  The code in the patch should be correct, however.