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_GridDimension_h 8 #define mozilla_dom_GridDimension_h 9 10 #include "nsWrapperCache.h" 11 12 namespace mozilla { 13 14 struct ComputedGridTrackInfo; 15 16 namespace dom { 17 18 class Grid; 19 class GridLines; 20 class GridTracks; 21 22 class GridDimension : public nsISupports, public nsWrapperCache { 23 public: 24 explicit GridDimension(Grid* aParent); 25 26 protected: 27 virtual ~GridDimension(); 28 29 public: 30 NS_DECL_CYCLE_COLLECTING_ISUPPORTS 31 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GridDimension) 32 33 virtual JSObject* WrapObject(JSContext* aCx, 34 JS::Handle<JSObject*> aGivenProto) override; GetParentObject()35 Grid* GetParentObject() { return mParent; } 36 37 GridLines* Lines() const; 38 GridTracks* Tracks() const; 39 40 void SetTrackInfo(const ComputedGridTrackInfo* aTrackInfo); 41 void SetLineInfo(const ComputedGridTrackInfo* aTrackInfo, 42 const ComputedGridLineInfo* aLineInfo, 43 const nsTArray<RefPtr<GridArea>>& aAreas, bool aIsRow); 44 45 protected: 46 RefPtr<Grid> mParent; 47 RefPtr<GridLines> mLines; 48 RefPtr<GridTracks> mTracks; 49 }; 50 51 } // namespace dom 52 } // namespace mozilla 53 54 #endif /* mozilla_dom_GridDimension_h */ 55