Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/grid/GridDimension.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 "GridDimension.h"
8
9
#include "Grid.h"
10
#include "GridLines.h"
11
#include "GridTracks.h"
12
#include "mozilla/dom/GridBinding.h"
13
#include "nsGridContainerFrame.h"
14
15
namespace mozilla {
16
namespace dom {
17
18
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(GridDimension, mParent, mLines, mTracks)
19
NS_IMPL_CYCLE_COLLECTING_ADDREF(GridDimension)
20
NS_IMPL_CYCLE_COLLECTING_RELEASE(GridDimension)
21
0
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(GridDimension)
22
0
  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
23
0
  NS_INTERFACE_MAP_ENTRY(nsISupports)
24
0
NS_INTERFACE_MAP_END
25
26
GridDimension::GridDimension(Grid* aParent)
27
  : mParent(aParent)
28
  , mLines(new GridLines(this))
29
  , mTracks(new GridTracks(this))
30
0
{
31
0
  MOZ_ASSERT(aParent, "Should never be instantiated with a null Grid");
32
0
}
33
34
GridDimension::~GridDimension()
35
0
{
36
0
}
37
38
JSObject*
39
GridDimension::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
40
0
{
41
0
  return GridDimension_Binding::Wrap(aCx, this, aGivenProto);
42
0
}
43
44
GridLines*
45
GridDimension::Lines() const
46
0
{
47
0
  return mLines;
48
0
}
49
50
GridTracks*
51
GridDimension::Tracks() const
52
0
{
53
0
  return mTracks;
54
0
}
55
56
void
57
GridDimension::SetTrackInfo(const ComputedGridTrackInfo* aTrackInfo)
58
0
{
59
0
  mTracks->SetTrackInfo(aTrackInfo);
60
0
}
61
62
void
63
GridDimension::SetLineInfo(const ComputedGridTrackInfo* aTrackInfo,
64
                           const ComputedGridLineInfo* aLineInfo,
65
                           const nsTArray<RefPtr<GridArea>>& aAreas,
66
                           bool aIsRow)
67
0
{
68
0
  mLines->SetLineInfo(aTrackInfo, aLineInfo, aAreas, aIsRow);
69
0
}
70
71
} // namespace dom
72
} // namespace mozilla