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 #ifndef nsDOMCSSRect_h_
9 #define nsDOMCSSRect_h_
11 #include "mozilla/Attributes.h"
12 #include "nsIDOMRect.h"
13 #include "nsAutoPtr.h"
14 #include "nsCycleCollectionParticipant.h"
15 #include "nsWrapperCache.h"
17 class nsROCSSPrimitiveValue
;
19 class nsDOMCSSRect
: public nsIDOMRect
,
23 nsDOMCSSRect(nsROCSSPrimitiveValue
* aTop
,
24 nsROCSSPrimitiveValue
* aRight
,
25 nsROCSSPrimitiveValue
* aBottom
,
26 nsROCSSPrimitiveValue
* aLeft
);
28 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
31 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMCSSRect
)
33 nsROCSSPrimitiveValue
* Top() const { return mTop
; }
34 nsROCSSPrimitiveValue
* Right() const { return mRight
; }
35 nsROCSSPrimitiveValue
* Bottom() const { return mBottom
; }
36 nsROCSSPrimitiveValue
* Left() const { return mLeft
; }
38 nsISupports
* GetParentObject() const { return nullptr; }
40 virtual JSObject
* WrapObject(JSContext
* cx
)
41 MOZ_OVERRIDE MOZ_FINAL
;
44 virtual ~nsDOMCSSRect(void);
47 nsRefPtr
<nsROCSSPrimitiveValue
> mTop
;
48 nsRefPtr
<nsROCSSPrimitiveValue
> mRight
;
49 nsRefPtr
<nsROCSSPrimitiveValue
> mBottom
;
50 nsRefPtr
<nsROCSSPrimitiveValue
> mLeft
;
53 #endif /* nsDOMCSSRect_h_ */