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_GridTracks_h
8 #define mozilla_dom_GridTracks_h
11 #include "nsWrapperCache.h"
15 struct ComputedGridTrackInfo
;
22 class GridTracks
: public nsISupports
, public nsWrapperCache
{
24 explicit GridTracks(GridDimension
* aParent
);
27 virtual ~GridTracks();
30 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
31 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GridTracks
)
33 virtual JSObject
* WrapObject(JSContext
* aCx
,
34 JS::Handle
<JSObject
*> aGivenProto
) override
;
35 GridDimension
* GetParentObject() { return mParent
; }
37 uint32_t Length() const;
38 GridTrack
* Item(uint32_t aIndex
);
39 GridTrack
* IndexedGetter(uint32_t aIndex
, bool& aFound
);
41 void SetTrackInfo(const mozilla::ComputedGridTrackInfo
* aTrackInfo
);
44 RefPtr
<GridDimension
> mParent
;
45 nsTArray
<RefPtr
<GridTrack
>> mTracks
;
49 } // namespace mozilla
51 #endif /* mozilla_dom_GridTracks_h */