Bug 847599 - Paris binding for TransitionEvent, r=Ms2ger

--HG--
extra : rebase_source : 0540a60c6a6d3ac1bef6df399e3feb7040f92a26
This commit is contained in:
Olli Pettay 2013-03-14 23:16:13 +02:00
parent be6e8cf113
commit 488fc5e798
5 changed files with 55 additions and 1 deletions

View File

@ -24,6 +24,7 @@ nsDOMTransitionEvent::nsDOMTransitionEvent(mozilla::dom::EventTarget* aOwner,
mEventIsInternal = true;
mEvent->time = PR_Now();
}
SetIsDOMBinding();
}
nsDOMTransitionEvent::~nsDOMTransitionEvent()
@ -54,7 +55,7 @@ nsDOMTransitionEvent::GetPropertyName(nsAString & aPropertyName)
NS_IMETHODIMP
nsDOMTransitionEvent::GetElapsedTime(float *aElapsedTime)
{
*aElapsedTime = TransitionEvent()->elapsedTime;
*aElapsedTime = ElapsedTime();
return NS_OK;
}

View File

@ -8,6 +8,7 @@
#include "nsDOMEvent.h"
#include "nsIDOMTransitionEvent.h"
#include "nsString.h"
#include "mozilla/dom/TransitionEventBinding.h"
class nsTransitionEvent;
@ -24,6 +25,29 @@ public:
NS_FORWARD_TO_NSDOMEVENT
NS_DECL_NSIDOMTRANSITIONEVENT
virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope)
{
return mozilla::dom::TransitionEventBinding::Wrap(aCx, aScope, this);
}
// xpidl implementation
// GetPropertyName(nsAString& aPropertyName)
float ElapsedTime()
{
return TransitionEvent()->elapsedTime;
}
void InitTransitionEvent(const nsAString& aType,
bool aCanBubble,
bool aCancelable,
const nsAString& aPropertyName,
float aElapsedTime,
mozilla::ErrorResult& aRv)
{
aRv = InitTransitionEvent(aType, aCanBubble, aCancelable, aPropertyName,
aElapsedTime);
}
private:
nsTransitionEvent* TransitionEvent() {
NS_ABORT_IF_FALSE(mEvent->eventStructType == NS_TRANSITION_EVENT,

View File

@ -875,6 +875,10 @@ DOMInterfaces = {
'wrapperCache': False
},
'TransitionEvent': {
'nativeType': 'nsDOMTransitionEvent',
},
'TreeWalker': {
'wrapperCache': False,
'resultNotAddRefed': [ 'root', 'currentNode' ],

View File

@ -0,0 +1,24 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Transition events are defined in:
* http://www.w3.org/TR/css3-transitions/#transition-events-
* http://dev.w3.org/csswg/css3-transitions/#transition-events-
*
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
* liability, trademark and document use rules apply.
*/
interface TransitionEvent : Event {
readonly attribute DOMString propertyName;
readonly attribute float elapsedTime;
[Throws]
void initTransitionEvent(DOMString aType,
boolean aCanBubble,
boolean aCancelable,
DOMString aPropertyName,
float aElapsedTime);
};

View File

@ -231,6 +231,7 @@ webidl_files = \
TextDecoder.webidl \
TextEncoder.webidl \
TimeRanges.webidl \
TransitionEvent.webidl \
TreeWalker.webidl \
UIEvent.webidl \
URL.webidl \