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/. */
9 #include "GridTracks.h"
10 #include "mozilla/dom/GridBinding.h"
12 namespace mozilla::dom
{
14 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(GridTrack
, mParent
)
15 NS_IMPL_CYCLE_COLLECTING_ADDREF(GridTrack
)
16 NS_IMPL_CYCLE_COLLECTING_RELEASE(GridTrack
)
17 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(GridTrack
)
18 NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
19 NS_INTERFACE_MAP_ENTRY(nsISupports
)
22 GridTrack::GridTrack(GridTracks
* aParent
)
26 mType(GridDeclaration::Implicit
),
27 mState(GridTrackState::Static
) {
28 MOZ_ASSERT(aParent
, "Should never be instantiated with a null GridTracks");
31 GridTrack::~GridTrack() = default;
33 JSObject
* GridTrack::WrapObject(JSContext
* aCx
,
34 JS::Handle
<JSObject
*> aGivenProto
) {
35 return GridTrack_Binding::Wrap(aCx
, this, aGivenProto
);
38 double GridTrack::Start() const { return mStart
; }
40 double GridTrack::Breadth() const { return mBreadth
; }
42 GridDeclaration
GridTrack::Type() const { return mType
; }
44 GridTrackState
GridTrack::State() const { return mState
; }
46 void GridTrack::SetTrackValues(double aStart
, double aBreadth
,
47 GridDeclaration aType
, GridTrackState aState
) {
54 } // namespace mozilla::dom