Closed
Bug 708169
Opened 13 years ago
Closed 13 years ago
Report deprecated mozRequestAnimationFrame usage (no-arguments style) to console
Categories
(Core :: DOM: Core & HTML, defect, P2)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla11
People
(Reporter: emk, Assigned: bzbarsky)
References
Details
Attachments
(2 files)
3.44 KB,
patch
|
Details | Diff | Splinter Review | |
4.56 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
Users may wonder why MozBeforePaint events suddenly stopped to work.
Deprecation messages will help to spot the problem promptly.
Assignee | ||
Comment 2•13 years ago
|
||
Actually, if you call requestAnimationFrame with no arguments it'll just throw. But I can add a warning for cases when it's called with an explicit null.
Assignee | ||
Comment 3•13 years ago
|
||
Although of course those cases will throw too. So is the warning really useful at that point? Any attempt to do the old broken thing will throw....
Assignee | ||
Comment 4•13 years ago
|
||
Reporter | ||
Comment 5•13 years ago
|
||
I'm going to add similar warnings in bug 701787 because I thought the message "A parameter or an operation is not supported by the underlying object." was too generic. Is there a way to customize messages of Exceptions?
Assignee | ||
Comment 6•13 years ago
|
||
Yes, but it's moderately painful (e.g. requires you to define a new nsresult and the associated stringification).
Do you think the "not enough arguments" exception for the case when null is not passed explicitly is good enough?
Reporter | ||
Comment 7•13 years ago
|
||
(In reply to Boris Zbarsky (:bz) from comment #6)
> Do you think the "not enough arguments" exception for the case when null is
> not passed explicitly is good enough?
I heard an Extension developer said so.
http://piro.sakura.ne.jp/latest/blosxom/webtech/javascript/2011-12-02_requestanimationframe.htm (Sorry, Japanese)
Reporter | ||
Comment 8•13 years ago
|
||
> (e.g. requires you to define a new nsresult
I have to use NS_ERROR_DOM_INVALID_ACCESS_ERR because it's required by the spec.
Reporter | ||
Comment 9•13 years ago
|
||
Also, exception messages will not help if it is swallowed by
> try { ... } catch (e) {}
idiom (I know it is a bad practice, but sometimes it is used).
Comment 10•13 years ago
|
||
On my case: I actually got an error message like "invalid argument error" for window.mozRequestAnimationFrame() (with no callback), so, at first I tried to give a dummy function (like "function() {}") for the method. Then I got no error message in the console, so I thought that the problem was gone. But, my codes still didn't work, and I realized that my event listener never listened the MozBeforePaint event. I think the problem could be fixed easily if the error console said like "mozRequestAnimationFrame() with no argument and MozBeforePaint event are deprecated." (If "Firefox 11 for developers" including this topic was there, it will helped me.)
I don't know how many people actually use the deprecated usage. If only few people use it (I think it maybe true), I agree that helpful error message is not required.
Assignee | ||
Comment 11•13 years ago
|
||
> I heard an Extension developer said so.
Said that it _is_ good enough, or that it's not?
> If "Firefox 11 for developers" including this topic was there, it will helped me.
It'll get there, I promise!
> I don't know how many people actually use the deprecated usage.
I did look into that before removing it. See bug 704171 comment 1.
I obviously can't add a warning for the dummy function case.... Adding a warning for the case of not enough arguments would be very painful, actually. :(
Assignee | ||
Comment 12•13 years ago
|
||
> It'll get there, I promise!
I just added something for a start.
Reporter | ||
Comment 13•13 years ago
|
||
(In reply to Boris Zbarsky (:bz) from comment #11)
> Said that it _is_ good enough, or that it's not?
Ah, is not.
> I did look into that before removing it. See bug 704171 comment 1.
Deprecation warnings will also help for Web authors. Bug 704171 is blocked by some Tech Evang bugs.
> I obviously can't add a warning for the dummy function case.... Adding a
> warning for the case of not enough arguments would be very painful,
> actually. :(
I don't think the warning is required for the dummy function case. If the warning explained that the "MozBeforePaint" event had gone, he would have noticed the cause before adding the dummy function.
Assignee | ||
Comment 14•13 years ago
|
||
Yeah. I haven't thought of a good way to add a warning for the not enough arguments case yet. It'd have to be hacked into quickstubs somehow....
Comment 15•13 years ago
|
||
Or make the argument optional in IDL and warn/throw if it isn't supplied?
Assignee | ||
Comment 16•13 years ago
|
||
Hmm. Yeah, I suppose I could go back to doing that for a release or two. OK.
Reporter | ||
Comment 17•13 years ago
|
||
The spec has been changed.
http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/RequestAnimationFrame/Overview.html#cancelAnimationFrame
Reporter | ||
Comment 18•13 years ago
|
||
Sorry, wrong bug.
Assignee | ||
Comment 19•13 years ago
|
||
Attachment #581898 -
Flags: review?(roc)
Assignee | ||
Updated•13 years ago
|
Priority: -- → P2
Whiteboard: [need review]
Attachment #581898 -
Flags: review?(roc) → review+
Assignee | ||
Comment 20•13 years ago
|
||
Flags: in-testsuite?
Whiteboard: [need review]
Target Milestone: --- → mozilla11
Comment 21•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•