tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

FlexItemValues.h (1841B)


      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/. */
      6 
      7 #ifndef mozilla_dom_FlexItemValues_h
      8 #define mozilla_dom_FlexItemValues_h
      9 
     10 #include "mozilla/dom/FlexBinding.h"
     11 #include "nsISupports.h"
     12 #include "nsWrapperCache.h"
     13 
     14 struct ComputedFlexItemInfo;
     15 
     16 class nsINode;
     17 
     18 namespace mozilla::dom {
     19 
     20 class DOMRectReadOnly;
     21 
     22 class FlexLineValues;
     23 
     24 class FlexItemValues : public nsISupports, public nsWrapperCache {
     25 public:
     26  explicit FlexItemValues(FlexLineValues* aParent,
     27                          const ComputedFlexItemInfo* aItem);
     28 
     29 protected:
     30  virtual ~FlexItemValues() = default;
     31 
     32 public:
     33  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     34  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(FlexItemValues)
     35 
     36  virtual JSObject* WrapObject(JSContext* aCx,
     37                               JS::Handle<JSObject*> aGivenProto) override;
     38  FlexLineValues* GetParentObject() { return mParent; }
     39 
     40  nsINode* GetNode() const;
     41  DOMRectReadOnly* FrameRect() const;
     42  double MainBaseSize() const;
     43  double MainDeltaSize() const;
     44  double MainMinSize() const;
     45  double MainMaxSize() const;
     46  double CrossMinSize() const;
     47  double CrossMaxSize() const;
     48  FlexItemClampState ClampState() const;
     49 
     50 protected:
     51  RefPtr<FlexLineValues> mParent;
     52  RefPtr<nsINode> mNode;
     53  RefPtr<DOMRectReadOnly> mFrameRect;
     54 
     55  // These sizes are all CSS pixel units.
     56  double mMainBaseSize;
     57  double mMainDeltaSize;
     58  double mMainMinSize;
     59  double mMainMaxSize;
     60  double mCrossMinSize;
     61  double mCrossMaxSize;
     62  FlexItemClampState mClampState;
     63 };
     64 
     65 }  // namespace mozilla::dom
     66 
     67 #endif /* mozilla_dom_FlexItemValues_h */