1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "mozilla/dom/DOMPoint.h"
8 #include "mozilla/dom/DOMPointBinding.h"
9 #include "mozilla/dom/BindingDeclarations.h"
10 #include "nsAutoPtr.h"
12 using namespace mozilla
;
13 using namespace mozilla::dom
;
15 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(DOMPoint
, mParent
)
17 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(DOMPoint
, AddRef
)
18 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(DOMPoint
, Release
)
20 already_AddRefed
<DOMPoint
>
21 DOMPoint::Constructor(const GlobalObject
& aGlobal
, const DOMPointInit
& aParams
,
24 nsRefPtr
<DOMPoint
> obj
=
25 new DOMPoint(aGlobal
.GetAsSupports(), aParams
.mX
, aParams
.mY
,
26 aParams
.mZ
, aParams
.mW
);
30 already_AddRefed
<DOMPoint
>
31 DOMPoint::Constructor(const GlobalObject
& aGlobal
, double aX
, double aY
,
32 double aZ
, double aW
, ErrorResult
& aRV
)
34 nsRefPtr
<DOMPoint
> obj
=
35 new DOMPoint(aGlobal
.GetAsSupports(), aX
, aY
, aZ
, aW
);
40 DOMPoint::WrapObject(JSContext
* aCx
)
42 return DOMPointBinding::Wrap(aCx
, this);