Bumping manifests a=b2g-bump
[gecko.git] / layout / style / nsDOMCSSRect.cpp
blob0691665a2ed3c06a4690c34b344fde7d1b34d1e2
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 /* DOM object representing rectangle values in DOM computed style */
8 #include "mozilla/dom/RectBinding.h"
9 #include "nsROCSSPrimitiveValue.h"
10 #include "nsDOMCSSRect.h"
12 using namespace mozilla;
14 nsDOMCSSRect::nsDOMCSSRect(nsROCSSPrimitiveValue* aTop,
15 nsROCSSPrimitiveValue* aRight,
16 nsROCSSPrimitiveValue* aBottom,
17 nsROCSSPrimitiveValue* aLeft)
18 : mTop(aTop), mRight(aRight), mBottom(aBottom), mLeft(aLeft)
22 nsDOMCSSRect::~nsDOMCSSRect(void)
26 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMCSSRect)
27 NS_INTERFACE_MAP_ENTRY(nsIDOMRect)
28 NS_INTERFACE_MAP_ENTRY(nsISupports)
29 NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
30 NS_INTERFACE_MAP_END
32 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMCSSRect)
33 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMCSSRect)
35 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(nsDOMCSSRect, mTop, mBottom, mLeft, mRight)
37 JSObject*
38 nsDOMCSSRect::WrapObject(JSContext* cx)
40 return dom::RectBinding::Wrap(cx, this);
43 NS_IMETHODIMP
44 nsDOMCSSRect::GetTop(nsIDOMCSSPrimitiveValue** aTop)
46 NS_ENSURE_TRUE(mTop, NS_ERROR_NOT_INITIALIZED);
47 *aTop = mTop;
48 NS_ADDREF(*aTop);
49 return NS_OK;
52 NS_IMETHODIMP
53 nsDOMCSSRect::GetRight(nsIDOMCSSPrimitiveValue** aRight)
55 NS_ENSURE_TRUE(mRight, NS_ERROR_NOT_INITIALIZED);
56 *aRight = mRight;
57 NS_ADDREF(*aRight);
58 return NS_OK;
61 NS_IMETHODIMP
62 nsDOMCSSRect::GetBottom(nsIDOMCSSPrimitiveValue** aBottom)
64 NS_ENSURE_TRUE(mBottom, NS_ERROR_NOT_INITIALIZED);
65 *aBottom = mBottom;
66 NS_ADDREF(*aBottom);
67 return NS_OK;
70 NS_IMETHODIMP
71 nsDOMCSSRect::GetLeft(nsIDOMCSSPrimitiveValue** aLeft)
73 NS_ENSURE_TRUE(mLeft, NS_ERROR_NOT_INITIALIZED);
74 *aLeft = mLeft;
75 NS_ADDREF(*aLeft);
76 return NS_OK;