Backout f10e28d82786 for mochitest orange on a CLOSED TREE
authorDavid Zbarsky <dzbarsky@gmail.com>
Mon, 29 Jul 2013 21:11:38 -0700
changeset 140505 9726efc4c4a837d64cd4187285b16fe0bfc750a4
parent 140504 74a36d1b28164719f9ad98dcacf503e9cebbf8f6
child 140506 ed763ce970e9f113b350591fafbb80151ce290b2
push id1970
push userryanvm@gmail.com
push dateTue, 30 Jul 2013 17:12:32 +0000
treeherderfx-team@72240998c094 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone25.0a1
backs outf10e28d8278658c8d3fa14caa87427376dbb1403
Backout f10e28d82786 for mochitest orange on a CLOSED TREE
content/events/src/nsDOMTouchEvent.cpp
content/events/src/nsDOMTouchEvent.h
dom/interfaces/events/nsIDOMTouchEvent.idl
--- a/content/events/src/nsDOMTouchEvent.cpp
+++ b/content/events/src/nsDOMTouchEvent.cpp
@@ -15,16 +15,17 @@
 using namespace mozilla;
 using namespace mozilla::dom;
 
 // TouchList
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMTouchList)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
+  NS_INTERFACE_MAP_ENTRY(nsIDOMTouchList)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_2(nsDOMTouchList, mParent, mPoints)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMTouchList)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMTouchList)
 
 /* virtual */ JSObject*
@@ -34,16 +35,37 @@ nsDOMTouchList::WrapObject(JSContext* aC
 }
 
 /* static */ bool
 nsDOMTouchList::PrefEnabled()
 {
   return nsDOMTouchEvent::PrefEnabled();
 }
 
+NS_IMETHODIMP
+nsDOMTouchList::GetLength(uint32_t* aLength)
+{
+  *aLength = Length();
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+nsDOMTouchList::Item(uint32_t aIndex, nsIDOMTouch** aRetVal)
+{
+  NS_IF_ADDREF(*aRetVal = Item(aIndex));
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+nsDOMTouchList::IdentifiedTouch(int32_t aIdentifier, nsIDOMTouch** aRetVal)
+{
+  NS_IF_ADDREF(*aRetVal = IdentifiedTouch(aIdentifier));
+  return NS_OK;
+}
+
 Touch*
 nsDOMTouchList::IdentifiedTouch(int32_t aIdentifier) const
 {
   for (uint32_t i = 0; i < mPoints.Length(); ++i) {
     Touch* point = mPoints[i];
     if (point && point->Identifier() == aIdentifier) {
       return point;
     }
--- a/content/events/src/nsDOMTouchEvent.h
+++ b/content/events/src/nsDOMTouchEvent.h
@@ -1,31 +1,33 @@
 /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
 /* 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/. */
 #ifndef nsDOMTouchEvent_h_
 #define nsDOMTouchEvent_h_
 
 #include "nsDOMUIEvent.h"
+#include "nsIDOMTouchEvent.h"
 #include "nsString.h"
 #include "nsTArray.h"
 #include "mozilla/Attributes.h"
 #include "nsJSEnvironment.h"
 #include "mozilla/dom/TouchEventBinding.h"
 #include "nsWrapperCache.h"
 
-class nsDOMTouchList MOZ_FINAL : public nsISupports
+class nsDOMTouchList MOZ_FINAL : public nsIDOMTouchList
                                , public nsWrapperCache
 {
   typedef mozilla::dom::Touch Touch;
 
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMTouchList)
+  NS_DECL_NSIDOMTOUCHLIST
 
   nsDOMTouchList(nsISupports* aParent)
     : mParent(aParent)
   {
     SetIsDOMBinding();
     nsJSContext::LikelyShortLivingObjectCreated();
   }
   nsDOMTouchList(nsISupports* aParent,
--- a/dom/interfaces/events/nsIDOMTouchEvent.idl
+++ b/dom/interfaces/events/nsIDOMTouchEvent.idl
@@ -33,16 +33,23 @@ interface nsIDOMTouch : nsISupports {
     mozilla::dom::EventTarget *GetTarget() { return mTarget; }
     void SetTarget(mozilla::dom::EventTarget *target) { mTarget = target; }
     nsIntPoint mRefPoint;
     bool mChanged;
     uint32_t mMessage;
   %}
 };
 
+[scriptable, builtinclass, uuid(60706eb7-d50d-4379-b01c-e78e6af84213)]
+interface nsIDOMTouchList : nsISupports {
+  readonly attribute unsigned long length;
+  nsIDOMTouch item(in unsigned long index);
+  nsIDOMTouch identifiedTouch(in long identifier);
+};
+
 [scriptable, uuid(6d5484f7-92ac-45f8-9388-39b5bad055ce)]
 interface nsITouchEventReceiver : nsISupports {
   [implicit_jscontext] attribute jsval           ontouchstart;
   [implicit_jscontext] attribute jsval           ontouchend;
   [implicit_jscontext] attribute jsval           ontouchmove;
   [implicit_jscontext] attribute jsval           ontouchenter;
   [implicit_jscontext] attribute jsval           ontouchleave;
   [implicit_jscontext] attribute jsval           ontouchcancel;