diff --git a/content/base/public/nsIDocument.h b/content/base/public/nsIDocument.h index 64b58f5721b..50fc873d4fa 100644 --- a/content/base/public/nsIDocument.h +++ b/content/base/public/nsIDocument.h @@ -2091,7 +2091,7 @@ public: nsISupports* aResult, mozilla::ErrorResult& rv); // Touch event handlers already on nsINode already_AddRefed - 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, diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 3da7613c291..c3cec880713 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -9163,7 +9163,8 @@ nsDocument::CreateTouch(nsIDOMWindow* aView, float aForce, nsIDOMTouch** aRetVal) { - *aRetVal = nsIDocument::CreateTouch(aView, aTarget, aIdentifier, aPageX, + nsCOMPtr 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 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 target = do_QueryInterface(aTarget); - nsCOMPtr touch = new Touch(target, + nsCOMPtr touch = new Touch(aTarget, aIdentifier, aPageX, aPageY, aScreenX, aScreenY, diff --git a/dom/webidl/Document.webidl b/dom/webidl/Document.webidl index d1176c06c94..e4736e4d4b3 100644 --- a/dom/webidl/Document.webidl +++ b/dom/webidl/Document.webidl @@ -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,