Closed Bug 847589 Opened 10 years ago Closed 10 years ago

Paris binding for AnimationEvent

Categories

(Core :: DOM: Events, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: smaug, Assigned: smaug)

References

Details

Attachments

(2 files, 2 obsolete files)

      No description provided.
Blocks: 776864
Attached patch patch (obsolete) — Splinter Review
https://tbpl.mozilla.org/?tree=Try&rev=47d6748852ed
Assignee: nobody → bugs
Blocks: 848293
Comment on attachment 721388 [details] [diff] [review]
patch

Bug 848293 is a followup.
Attachment #721388 - Flags: review?(Ms2ger)
Comment on attachment 721388 [details] [diff] [review]
patch

Review of attachment 721388 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/events/src/nsDOMAnimationEvent.h
@@ +27,5 @@
>  
> +  virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope,
> +                               bool* aTriedToWrap)
> +  {
> +    return mozilla::dom::AnimationEventBinding::Wrap(aCx, aScope, this,

I'd prefer moving this into the .cpp, and not including *Binding.h in the header.

@@ +30,5 @@
> +  {
> +    return mozilla::dom::AnimationEventBinding::Wrap(aCx, aScope, this,
> +                                                     aTriedToWrap);
> +  }
> +

Please add a comment that you're using the XPCOM GetAnimationName.

@@ +33,5 @@
> +  }
> +
> +  float ElapsedTime()
> +  {
> +    return AnimationEvent()->elapsedTime;

Make XPCOM GetElapsedTime call this to make sure they don't get out of sync.
(In reply to :Ms2ger from comment #3)

> ::: content/events/src/nsDOMAnimationEvent.h
> @@ +27,5 @@
> >  
> > +  virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope,
> > +                               bool* aTriedToWrap)
> > +  {
> > +    return mozilla::dom::AnimationEventBinding::Wrap(aCx, aScope, this,
> 
> I'd prefer moving this into the .cpp, and not including *Binding.h in the
> header.
Why exactly. Especially once we have ctor support, including Binding.h just makes the code a tiny bit simpler.
The header for this kind of event classes is inherited only by the .cpp file and *Binding.cpp so
it really shouldn't matter whether #include is in .h, and having it in .h is just simpler.
Attached patch v2 (obsolete) — Splinter Review
Attachment #721388 - Attachment is obsolete: true
Attachment #721388 - Flags: review?(Ms2ger)
Attachment #723112 - Flags: review?(Ms2ger)
Attached patch patchSplinter Review
Attachment #723112 - Attachment is obsolete: true
Attachment #723112 - Flags: review?(Ms2ger)
Attachment #723114 - Flags: review?(Ms2ger)
Comment on attachment 723114 [details] [diff] [review]
patch

Review of attachment 723114 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/events/src/nsDOMAnimationEvent.h
@@ +28,5 @@
> +  virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope,
> +                               bool* aTriedToWrap)
> +  {
> +    return mozilla::dom::AnimationEventBinding::Wrap(aCx, aScope, this,
> +                                                     aTriedToWrap);

aTriedToWrap is gone now
Attachment #723114 - Flags: review?(Ms2ger) → review+
Attached patch patchSplinter Review
https://hg.mozilla.org/mozilla-central/rev/c3a84e883c3d
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.