|
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/. */ |
|
5 |
|
6 /* DOM object representing rectangle values in DOM computed style */ |
|
7 |
|
8 #ifndef nsDOMCSSRect_h_ |
|
9 #define nsDOMCSSRect_h_ |
|
10 |
|
11 #include "mozilla/Attributes.h" |
|
12 #include "nsIDOMRect.h" |
|
13 #include "nsAutoPtr.h" |
|
14 #include "nsCycleCollectionParticipant.h" |
|
15 #include "nsWrapperCache.h" |
|
16 |
|
17 class nsROCSSPrimitiveValue; |
|
18 |
|
19 class nsDOMCSSRect : public nsIDOMRect, |
|
20 public nsWrapperCache |
|
21 { |
|
22 public: |
|
23 nsDOMCSSRect(nsROCSSPrimitiveValue* aTop, |
|
24 nsROCSSPrimitiveValue* aRight, |
|
25 nsROCSSPrimitiveValue* aBottom, |
|
26 nsROCSSPrimitiveValue* aLeft); |
|
27 virtual ~nsDOMCSSRect(void); |
|
28 |
|
29 NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
|
30 NS_DECL_NSIDOMRECT |
|
31 |
|
32 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMCSSRect) |
|
33 |
|
34 nsROCSSPrimitiveValue* Top() const { return mTop; } |
|
35 nsROCSSPrimitiveValue* Right() const { return mRight; } |
|
36 nsROCSSPrimitiveValue* Bottom() const { return mBottom; } |
|
37 nsROCSSPrimitiveValue* Left() const { return mLeft; } |
|
38 |
|
39 nsISupports* GetParentObject() const { return nullptr; } |
|
40 |
|
41 virtual JSObject* WrapObject(JSContext* cx) |
|
42 MOZ_OVERRIDE MOZ_FINAL; |
|
43 |
|
44 private: |
|
45 nsRefPtr<nsROCSSPrimitiveValue> mTop; |
|
46 nsRefPtr<nsROCSSPrimitiveValue> mRight; |
|
47 nsRefPtr<nsROCSSPrimitiveValue> mBottom; |
|
48 nsRefPtr<nsROCSSPrimitiveValue> mLeft; |
|
49 }; |
|
50 |
|
51 #endif /* nsDOMCSSRect_h_ */ |