Bug 1848619 [wpt PR 41441] - [@scope] Add WPT for name-defining at rules, a=testonly
[gecko.git] / dom / grid / GridLines.h
blobf95993dc6dc302b04e99c4ce6ff06fb2d80d36b4
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
10 #include "nsCoord.h"
11 #include "nsTArray.h"
12 #include "nsWrapperCache.h"
14 class nsAtom;
16 namespace mozilla {
18 struct ComputedGridTrackInfo;
19 struct ComputedGridLineInfo;
21 namespace dom {
23 class GridDimension;
24 class GridLine;
25 class GridArea;
27 class GridLines : public nsISupports, public nsWrapperCache {
28 public:
29 explicit GridLines(GridDimension* aParent);
31 protected:
32 virtual ~GridLines();
34 public:
35 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
36 NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_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);
50 protected:
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;
62 } // namespace dom
63 } // namespace mozilla
65 #endif /* mozilla_dom_GridLines_h */