1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "mozilla/dom/PaintRequest.h"
9 #include "mozilla/dom/PaintRequestBinding.h"
10 #include "mozilla/dom/PaintRequestListBinding.h"
11 #include "mozilla/dom/DOMRect.h"
13 namespace mozilla::dom
{
15 /******************************************************************************
16 * mozilla::dom::PaintRequest
17 *****************************************************************************/
19 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(PaintRequest
, mParent
)
21 NS_INTERFACE_TABLE_HEAD(PaintRequest
)
22 NS_WRAPPERCACHE_INTERFACE_TABLE_ENTRY
23 NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(PaintRequest
)
26 NS_IMPL_CYCLE_COLLECTING_ADDREF(PaintRequest
)
27 NS_IMPL_CYCLE_COLLECTING_RELEASE(PaintRequest
)
30 JSObject
* PaintRequest::WrapObject(JSContext
* aCx
,
31 JS::Handle
<JSObject
*> aGivenProto
) {
32 return PaintRequest_Binding::Wrap(aCx
, this, aGivenProto
);
35 already_AddRefed
<DOMRect
> PaintRequest::ClientRect() {
36 RefPtr
<DOMRect
> clientRect
= new DOMRect(this);
37 clientRect
->SetLayoutRect(mRequest
);
38 return clientRect
.forget();
41 /******************************************************************************
42 * mozilla::dom::PaintRequestList
43 *****************************************************************************/
45 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(PaintRequestList
, mParent
)
47 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(PaintRequestList
)
48 NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
49 NS_INTERFACE_MAP_ENTRY(nsISupports
)
52 NS_IMPL_CYCLE_COLLECTING_ADDREF(PaintRequestList
)
53 NS_IMPL_CYCLE_COLLECTING_RELEASE(PaintRequestList
)
55 JSObject
* PaintRequestList::WrapObject(JSContext
* aCx
,
56 JS::Handle
<JSObject
*> aGivenProto
) {
57 return PaintRequestList_Binding::Wrap(aCx
, this, aGivenProto
);
60 } // namespace mozilla::dom