Bug 852055 - Pass an EventTarget argument to Document.createTouch in WebIDL r=bz

This commit is contained in:
David Zbarsky 2013-04-19 00:48:03 -04:00
parent 25f835929b
commit 0204cf180b
3 changed files with 6 additions and 10 deletions

View File

@ -2091,7 +2091,7 @@ public:
nsISupports* aResult, mozilla::ErrorResult& rv);
// Touch event handlers already on nsINode
already_AddRefed<nsIDOMTouch>
CreateTouch(nsIDOMWindow* aView, nsISupports* aTarget,
CreateTouch(nsIDOMWindow* aView, mozilla::dom::EventTarget* aTarget,
int32_t aIdentifier, int32_t aPageX, int32_t aPageY,
int32_t aScreenX, int32_t aScreenY, int32_t aClientX,
int32_t aClientY, int32_t aRadiusX, int32_t aRadiusY,

View File

@ -9163,7 +9163,8 @@ nsDocument::CreateTouch(nsIDOMWindow* aView,
float aForce,
nsIDOMTouch** aRetVal)
{
*aRetVal = nsIDocument::CreateTouch(aView, aTarget, aIdentifier, aPageX,
nsCOMPtr<EventTarget> target = do_QueryInterface(aTarget);
*aRetVal = nsIDocument::CreateTouch(aView, target, aIdentifier, aPageX,
aPageY, aScreenX, aScreenY, aClientX,
aClientY, aRadiusX, aRadiusY,
aRotationAngle, aForce).get();
@ -9172,7 +9173,7 @@ nsDocument::CreateTouch(nsIDOMWindow* aView,
already_AddRefed<nsIDOMTouch>
nsIDocument::CreateTouch(nsIDOMWindow* aView,
nsISupports* aTarget,
EventTarget* aTarget,
int32_t aIdentifier,
int32_t aPageX, int32_t aPageY,
int32_t aScreenX, int32_t aScreenY,
@ -9181,8 +9182,7 @@ nsIDocument::CreateTouch(nsIDOMWindow* aView,
float aRotationAngle,
float aForce)
{
nsCOMPtr<EventTarget> target = do_QueryInterface(aTarget);
nsCOMPtr<nsIDOMTouch> touch = new Touch(target,
nsCOMPtr<nsIDOMTouch> touch = new Touch(aTarget,
aIdentifier,
aPageX, aPageY,
aScreenX, aScreenY,

View File

@ -292,11 +292,7 @@ partial interface Document {
// from our xpidl for now.
[Creator, Func="nsGenericHTMLElement::TouchEventsEnabled"]
Touch createTouch(optional Window? view = null,
// Nasty hack, because we can't do EventTarget arguments yet
// (they would need to be non-castable, but trying to do
// XPConnect unwrapping with nsDOMEventTargetHelper fails).
// optional EventTarget? target = null,
optional nsISupports? target = null,
optional EventTarget? target = null,
optional long identifier = 0,
optional long pageX = 0,
optional long pageY = 0,