Backout b43b3d14ea16 for mochitest failures on CLOSED TREE

This commit is contained in:
David Zbarsky 2013-07-29 22:46:45 -07:00
parent 976615cfaa
commit fdbb43c394
6 changed files with 116 additions and 22 deletions

View File

@ -108,7 +108,15 @@ NS_IMPL_CYCLE_COLLECTION_INHERITED_3(nsDOMTouchEvent, nsDOMUIEvent,
mTargetTouches,
mChangedTouches)
void
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMTouchEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMTouchEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMUIEvent)
NS_IMPL_ADDREF_INHERITED(nsDOMTouchEvent, nsDOMUIEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMTouchEvent, nsDOMUIEvent)
NS_IMETHODIMP
nsDOMTouchEvent::InitTouchEvent(const nsAString& aType,
bool aCanBubble,
bool aCancelable,
@ -118,25 +126,31 @@ nsDOMTouchEvent::InitTouchEvent(const nsAString& aType,
bool aAltKey,
bool aShiftKey,
bool aMetaKey,
nsDOMTouchList* aTouches,
nsDOMTouchList* aTargetTouches,
nsDOMTouchList* aChangedTouches,
mozilla::ErrorResult& aRv)
nsIDOMTouchList* aTouches,
nsIDOMTouchList* aTargetTouches,
nsIDOMTouchList* aChangedTouches)
{
aRv = nsDOMUIEvent::InitUIEvent(aType,
nsresult rv = nsDOMUIEvent::InitUIEvent(aType,
aCanBubble,
aCancelable,
aView,
aDetail);
if (aRv.Failed()) {
return;
}
NS_ENSURE_SUCCESS(rv, rv);
static_cast<nsInputEvent*>(mEvent)->InitBasicModifiers(aCtrlKey, aAltKey,
aShiftKey, aMetaKey);
mTouches = aTouches;
mTargetTouches = aTargetTouches;
mChangedTouches = aChangedTouches;
mTouches = static_cast<nsDOMTouchList*>(aTouches);
mTargetTouches = static_cast<nsDOMTouchList*>(aTargetTouches);
mChangedTouches = static_cast<nsDOMTouchList*>(aChangedTouches);
return NS_OK;
}
NS_IMETHODIMP
nsDOMTouchEvent::GetTouches(nsIDOMTouchList** aTouches)
{
NS_ENSURE_ARG_POINTER(aTouches);
NS_ADDREF(*aTouches = Touches());
return NS_OK;
}
nsDOMTouchList*
@ -161,6 +175,14 @@ nsDOMTouchEvent::Touches()
return mTouches;
}
NS_IMETHODIMP
nsDOMTouchEvent::GetTargetTouches(nsIDOMTouchList** aTargetTouches)
{
NS_ENSURE_ARG_POINTER(aTargetTouches);
NS_ADDREF(*aTargetTouches = TargetTouches());
return NS_OK;
}
nsDOMTouchList*
nsDOMTouchEvent::TargetTouches()
{
@ -183,6 +205,14 @@ nsDOMTouchEvent::TargetTouches()
return mTargetTouches;
}
NS_IMETHODIMP
nsDOMTouchEvent::GetChangedTouches(nsIDOMTouchList** aChangedTouches)
{
NS_ENSURE_ARG_POINTER(aChangedTouches);
NS_ADDREF(*aChangedTouches = ChangedTouches());
return NS_OK;
}
nsDOMTouchList*
nsDOMTouchEvent::ChangedTouches()
{
@ -200,6 +230,34 @@ nsDOMTouchEvent::ChangedTouches()
return mChangedTouches;
}
NS_IMETHODIMP
nsDOMTouchEvent::GetAltKey(bool* aAltKey)
{
*aAltKey = AltKey();
return NS_OK;
}
NS_IMETHODIMP
nsDOMTouchEvent::GetMetaKey(bool* aMetaKey)
{
*aMetaKey = MetaKey();
return NS_OK;
}
NS_IMETHODIMP
nsDOMTouchEvent::GetCtrlKey(bool* aCtrlKey)
{
*aCtrlKey = CtrlKey();
return NS_OK;
}
NS_IMETHODIMP
nsDOMTouchEvent::GetShiftKey(bool* aShiftKey)
{
*aShiftKey = ShiftKey();
return NS_OK;
}
#ifdef XP_WIN
namespace mozilla {
namespace widget {

View File

@ -77,14 +77,19 @@ protected:
nsTArray< nsRefPtr<Touch> > mPoints;
};
class nsDOMTouchEvent : public nsDOMUIEvent
class nsDOMTouchEvent : public nsDOMUIEvent,
public nsIDOMTouchEvent
{
public:
nsDOMTouchEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext, nsTouchEvent* aEvent);
virtual ~nsDOMTouchEvent();
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsDOMTouchEvent, nsDOMUIEvent)
NS_DECL_NSIDOMTOUCHEVENT
NS_FORWARD_TO_NSDOMUIEVENT
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
@ -125,10 +130,15 @@ public:
bool aAltKey,
bool aShiftKey,
bool aMetaKey,
nsDOMTouchList* aTouches,
nsDOMTouchList* aTargetTouches,
nsDOMTouchList* aChangedTouches,
mozilla::ErrorResult& aRv);
nsIDOMTouchList* aTouches,
nsIDOMTouchList* aTargetTouches,
nsIDOMTouchList* aChangedTouches,
mozilla::ErrorResult& aRv)
{
aRv = InitTouchEvent(aType, aCanBubble, aCancelable, aView, aDetail,
aCtrlKey, aAltKey, aShiftKey, aMetaKey,
aTouches, aTargetTouches, aChangedTouches);
}
static bool PrefEnabled();
protected:

View File

@ -20,6 +20,7 @@
#include "nsRefreshDriver.h"
#include "nsDOMTouchEvent.h"
#include "mozilla/dom/Touch.h"
#include "nsIDOMTouchEvent.h"
#include "nsObjectLoadingContent.h"
#include "nsFrame.h"

View File

@ -54,6 +54,7 @@
#include "nsFrameMessageManager.h"
#include "mozilla/LinkedList.h"
#include "mozilla/TimeStamp.h"
#include "nsIDOMTouchEvent.h"
#include "nsIInlineEventHandlers.h"
#include "nsWrapperCacheInlines.h"
#include "nsIIdleObserver.h"

View File

@ -45,6 +45,29 @@ interface nsIDOMTouchList : nsISupports {
nsIDOMTouch identifiedTouch(in long identifier);
};
[scriptable, builtinclass, uuid(9a043d55-f59e-4790-8fc7-1fab1c727732)]
interface nsIDOMTouchEvent : nsIDOMUIEvent {
readonly attribute nsIDOMTouchList touches;
readonly attribute nsIDOMTouchList targetTouches;
readonly attribute nsIDOMTouchList changedTouches;
readonly attribute boolean altKey;
readonly attribute boolean metaKey;
readonly attribute boolean ctrlKey;
readonly attribute boolean shiftKey;
void initTouchEvent(in DOMString type,
in boolean canBubble,
in boolean cancelable,
in nsIDOMWindow view,
in long detail,
in boolean ctrlKey,
in boolean altKey,
in boolean shiftKey,
in boolean metaKey,
in nsIDOMTouchList touches,
in nsIDOMTouchList targetTouches,
in nsIDOMTouchList changedTouches);
};
[scriptable, uuid(6d5484f7-92ac-45f8-9388-39b5bad055ce)]
interface nsITouchEventReceiver : nsISupports {
[implicit_jscontext] attribute jsval ontouchstart;

View File

@ -20,6 +20,7 @@
#include "nsIDOMMouseEvent.h"
#include "nsIDOMWheelEvent.h"
#include "nsIDOMDataTransfer.h"
#include "nsIDOMTouchEvent.h"
#include "nsWeakPtr.h"
#include "nsIWidget.h"
#include "nsTArray.h"