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
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
)
38 nsDOMCSSRect::WrapObject(JSContext
* cx
)
40 return dom::RectBinding::Wrap(cx
, this);
44 nsDOMCSSRect::GetTop(nsIDOMCSSPrimitiveValue
** aTop
)
46 NS_ENSURE_TRUE(mTop
, NS_ERROR_NOT_INITIALIZED
);
53 nsDOMCSSRect::GetRight(nsIDOMCSSPrimitiveValue
** aRight
)
55 NS_ENSURE_TRUE(mRight
, NS_ERROR_NOT_INITIALIZED
);
62 nsDOMCSSRect::GetBottom(nsIDOMCSSPrimitiveValue
** aBottom
)
64 NS_ENSURE_TRUE(mBottom
, NS_ERROR_NOT_INITIALIZED
);
71 nsDOMCSSRect::GetLeft(nsIDOMCSSPrimitiveValue
** aLeft
)
73 NS_ENSURE_TRUE(mLeft
, NS_ERROR_NOT_INITIALIZED
);