/src/mozilla-central/dom/grid/GridTrack.cpp
Line | Count | Source (jump to first uncovered line) |
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 | | #include "GridTrack.h" |
8 | | |
9 | | #include "GridTracks.h" |
10 | | #include "mozilla/dom/GridBinding.h" |
11 | | |
12 | | namespace mozilla { |
13 | | namespace dom { |
14 | | |
15 | | NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(GridTrack, mParent) |
16 | | NS_IMPL_CYCLE_COLLECTING_ADDREF(GridTrack) |
17 | | NS_IMPL_CYCLE_COLLECTING_RELEASE(GridTrack) |
18 | 0 | NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(GridTrack) |
19 | 0 | NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY |
20 | 0 | NS_INTERFACE_MAP_ENTRY(nsISupports) |
21 | 0 | NS_INTERFACE_MAP_END |
22 | | |
23 | | GridTrack::GridTrack(GridTracks* aParent) |
24 | | : mParent(aParent) |
25 | | , mStart(0.0) |
26 | | , mBreadth(0.0) |
27 | | , mType(GridDeclaration::Implicit) |
28 | | , mState(GridTrackState::Static) |
29 | 0 | { |
30 | 0 | MOZ_ASSERT(aParent, "Should never be instantiated with a null GridTracks"); |
31 | 0 | } |
32 | | |
33 | | GridTrack::~GridTrack() |
34 | 0 | { |
35 | 0 | } |
36 | | |
37 | | JSObject* |
38 | | GridTrack::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) |
39 | 0 | { |
40 | 0 | return GridTrack_Binding::Wrap(aCx, this, aGivenProto); |
41 | 0 | } |
42 | | |
43 | | double |
44 | | GridTrack::Start() const |
45 | 0 | { |
46 | 0 | return mStart; |
47 | 0 | } |
48 | | |
49 | | double |
50 | | GridTrack::Breadth() const |
51 | 0 | { |
52 | 0 | return mBreadth; |
53 | 0 | } |
54 | | |
55 | | GridDeclaration |
56 | | GridTrack::Type() const |
57 | 0 | { |
58 | 0 | return mType; |
59 | 0 | } |
60 | | |
61 | | GridTrackState |
62 | | GridTrack::State() const |
63 | 0 | { |
64 | 0 | return mState; |
65 | 0 | } |
66 | | |
67 | | void |
68 | | GridTrack::SetTrackValues(double aStart, |
69 | | double aBreadth, |
70 | | GridDeclaration aType, |
71 | | GridTrackState aState) |
72 | 0 | { |
73 | 0 | mStart = aStart; |
74 | 0 | mBreadth = aBreadth; |
75 | 0 | mType = aType; |
76 | 0 | mState = aState; |
77 | 0 | } |
78 | | |
79 | | } // namespace dom |
80 | | } // namespace mozilla |