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_GridLines_h
8 #define mozilla_dom_GridLines_h
12 #include "nsWrapperCache.h"
18 struct ComputedGridTrackInfo
;
19 struct ComputedGridLineInfo
;
27 class GridLines
: public nsISupports
, public nsWrapperCache
{
29 explicit GridLines(GridDimension
* aParent
);
35 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
36 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GridLines
)
38 virtual JSObject
* WrapObject(JSContext
* aCx
,
39 JS::Handle
<JSObject
*> aGivenProto
) override
;
40 GridDimension
* GetParentObject() { return mParent
; }
42 uint32_t Length() const;
43 GridLine
* Item(uint32_t aIndex
);
44 GridLine
* IndexedGetter(uint32_t aIndex
, bool& aFound
);
46 void SetLineInfo(const ComputedGridTrackInfo
* aTrackInfo
,
47 const ComputedGridLineInfo
* aLineInfo
,
48 const nsTArray
<RefPtr
<GridArea
>>& aAreas
, bool aIsRow
);
51 uint32_t AppendRemovedAutoFits(const ComputedGridTrackInfo
* aTrackInfo
,
52 const ComputedGridLineInfo
* aLineInfo
,
53 nscoord aLastTrackEdge
, uint32_t& aRepeatIndex
,
54 uint32_t aNumRepeatTracks
,
55 uint32_t aNumLeadingTracks
,
56 nsTArray
<RefPtr
<nsAtom
>>& aLineNames
);
58 RefPtr
<GridDimension
> mParent
;
59 nsTArray
<RefPtr
<GridLine
>> mLines
;
63 } // namespace mozilla
65 #endif /* mozilla_dom_GridLines_h */