Bug 1655413 [wpt PR 24763] - Make CSP default-src without 'unsafe-eval' block eval...
[gecko.git] / dom / flex / FlexItemValues.h
blobbb152d9542d61469af7abbeb634e1268a16c5cb6
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_FlexItemValues_h
8 #define mozilla_dom_FlexItemValues_h
10 #include "mozilla/dom/FlexBinding.h"
11 #include "nsISupports.h"
12 #include "nsWrapperCache.h"
14 struct ComputedFlexItemInfo;
16 namespace mozilla {
17 namespace dom {
19 class FlexLineValues;
21 class FlexItemValues : public nsISupports, public nsWrapperCache {
22 public:
23 explicit FlexItemValues(FlexLineValues* aParent,
24 const ComputedFlexItemInfo* aItem);
26 protected:
27 virtual ~FlexItemValues() = default;
29 public:
30 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
31 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FlexItemValues)
33 virtual JSObject* WrapObject(JSContext* aCx,
34 JS::Handle<JSObject*> aGivenProto) override;
35 FlexLineValues* GetParentObject() { return mParent; }
37 nsINode* GetNode() const;
38 DOMRectReadOnly* FrameRect() const;
39 double MainBaseSize() const;
40 double MainDeltaSize() const;
41 double MainMinSize() const;
42 double MainMaxSize() const;
43 double CrossMinSize() const;
44 double CrossMaxSize() const;
45 FlexItemClampState ClampState() const;
47 protected:
48 RefPtr<FlexLineValues> mParent;
49 RefPtr<nsINode> mNode;
50 RefPtr<DOMRectReadOnly> mFrameRect;
52 // These sizes are all CSS pixel units.
53 double mMainBaseSize;
54 double mMainDeltaSize;
55 double mMainMinSize;
56 double mMainMaxSize;
57 double mCrossMinSize;
58 double mCrossMaxSize;
59 FlexItemClampState mClampState;
62 } // namespace dom
63 } // namespace mozilla
65 #endif /* mozilla_dom_FlexItemValues_h */