Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/layout/generic/nsLeafFrame.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
/* base class for rendering objects that do not have child lists */
8
9
#include "nsLeafFrame.h"
10
#include "nsPresContext.h"
11
12
using namespace mozilla;
13
14
nsLeafFrame::~nsLeafFrame()
15
0
{
16
0
}
17
18
/* virtual */ nscoord
19
nsLeafFrame::GetMinISize(gfxContext *aRenderingContext)
20
0
{
21
0
  nscoord result;
22
0
  DISPLAY_MIN_INLINE_SIZE(this, result);
23
0
  result = GetIntrinsicISize();
24
0
  return result;
25
0
}
26
27
/* virtual */ nscoord
28
nsLeafFrame::GetPrefISize(gfxContext *aRenderingContext)
29
0
{
30
0
  nscoord result;
31
0
  DISPLAY_PREF_INLINE_SIZE(this, result);
32
0
  result = GetIntrinsicISize();
33
0
  return result;
34
0
}
35
36
/* virtual */
37
LogicalSize
38
nsLeafFrame::ComputeAutoSize(gfxContext*         aRenderingContext,
39
                             WritingMode         aWM,
40
                             const LogicalSize&  aCBSize,
41
                             nscoord             aAvailableISize,
42
                             const LogicalSize&  aMargin,
43
                             const LogicalSize&  aBorder,
44
                             const LogicalSize&  aPadding,
45
                             ComputeSizeFlags    aFlags)
46
0
{
47
0
  const WritingMode wm = GetWritingMode();
48
0
  LogicalSize result(wm, GetIntrinsicISize(), GetIntrinsicBSize());
49
0
  return result.ConvertTo(aWM, wm);
50
0
}
51
52
nscoord
53
nsLeafFrame::GetIntrinsicBSize()
54
0
{
55
0
  MOZ_ASSERT_UNREACHABLE("Someone didn't override Reflow or ComputeAutoSize");
56
0
  return 0;
57
0
}
58
59
void
60
nsLeafFrame::SizeToAvailSize(const ReflowInput& aReflowInput,
61
                             ReflowOutput& aDesiredSize)
62
0
{
63
0
  WritingMode wm = aReflowInput.GetWritingMode();
64
0
  LogicalSize size(wm, aReflowInput.AvailableISize(), // FRAME
65
0
                   aReflowInput.AvailableBSize());
66
0
  aDesiredSize.SetSize(wm, size);
67
0
  aDesiredSize.SetOverflowAreasToDesiredBounds();
68
0
  FinishAndStoreOverflow(&aDesiredSize, aReflowInput.mStyleDisplay);
69
0
}