1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/style/nsDOMCSSRect.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,51 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +/* DOM object representing rectangle values in DOM computed style */ 1.10 + 1.11 +#ifndef nsDOMCSSRect_h_ 1.12 +#define nsDOMCSSRect_h_ 1.13 + 1.14 +#include "mozilla/Attributes.h" 1.15 +#include "nsIDOMRect.h" 1.16 +#include "nsAutoPtr.h" 1.17 +#include "nsCycleCollectionParticipant.h" 1.18 +#include "nsWrapperCache.h" 1.19 + 1.20 +class nsROCSSPrimitiveValue; 1.21 + 1.22 +class nsDOMCSSRect : public nsIDOMRect, 1.23 + public nsWrapperCache 1.24 +{ 1.25 +public: 1.26 + nsDOMCSSRect(nsROCSSPrimitiveValue* aTop, 1.27 + nsROCSSPrimitiveValue* aRight, 1.28 + nsROCSSPrimitiveValue* aBottom, 1.29 + nsROCSSPrimitiveValue* aLeft); 1.30 + virtual ~nsDOMCSSRect(void); 1.31 + 1.32 + NS_DECL_CYCLE_COLLECTING_ISUPPORTS 1.33 + NS_DECL_NSIDOMRECT 1.34 + 1.35 + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMCSSRect) 1.36 + 1.37 + nsROCSSPrimitiveValue* Top() const { return mTop; } 1.38 + nsROCSSPrimitiveValue* Right() const { return mRight; } 1.39 + nsROCSSPrimitiveValue* Bottom() const { return mBottom; } 1.40 + nsROCSSPrimitiveValue* Left() const { return mLeft; } 1.41 + 1.42 + nsISupports* GetParentObject() const { return nullptr; } 1.43 + 1.44 + virtual JSObject* WrapObject(JSContext* cx) 1.45 + MOZ_OVERRIDE MOZ_FINAL; 1.46 + 1.47 +private: 1.48 + nsRefPtr<nsROCSSPrimitiveValue> mTop; 1.49 + nsRefPtr<nsROCSSPrimitiveValue> mRight; 1.50 + nsRefPtr<nsROCSSPrimitiveValue> mBottom; 1.51 + nsRefPtr<nsROCSSPrimitiveValue> mLeft; 1.52 +}; 1.53 + 1.54 +#endif /* nsDOMCSSRect_h_ */