gecko-dev/layout/generic/nsLeafFrame.cpp
Chris Peterson 2afd829d0f Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj
This patch is an automatic replacement of s/NS_NOTREACHED/MOZ_ASSERT_UNREACHABLE/. Reindenting long lines and whitespace fixups follow in patch 6b.

MozReview-Commit-ID: 5UQVHElSpCr

--HG--
extra : rebase_source : 4c1b2fc32b269342f07639266b64941e2270e9c4
extra : source : 907543f6eae716f23a6de52b1ffb1c82908d158a
2018-06-17 22:43:11 -07:00

70 lines
2.1 KiB
C++

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* base class for rendering objects that do not have child lists */
#include "nsLeafFrame.h"
#include "nsPresContext.h"
using namespace mozilla;
nsLeafFrame::~nsLeafFrame()
{
}
/* virtual */ nscoord
nsLeafFrame::GetMinISize(gfxContext *aRenderingContext)
{
nscoord result;
DISPLAY_MIN_WIDTH(this, result);
result = GetIntrinsicISize();
return result;
}
/* virtual */ nscoord
nsLeafFrame::GetPrefISize(gfxContext *aRenderingContext)
{
nscoord result;
DISPLAY_PREF_WIDTH(this, result);
result = GetIntrinsicISize();
return result;
}
/* virtual */
LogicalSize
nsLeafFrame::ComputeAutoSize(gfxContext* aRenderingContext,
WritingMode aWM,
const LogicalSize& aCBSize,
nscoord aAvailableISize,
const LogicalSize& aMargin,
const LogicalSize& aBorder,
const LogicalSize& aPadding,
ComputeSizeFlags aFlags)
{
const WritingMode wm = GetWritingMode();
LogicalSize result(wm, GetIntrinsicISize(), GetIntrinsicBSize());
return result.ConvertTo(aWM, wm);
}
nscoord
nsLeafFrame::GetIntrinsicBSize()
{
MOZ_ASSERT_UNREACHABLE("Someone didn't override Reflow or ComputeAutoSize");
return 0;
}
void
nsLeafFrame::SizeToAvailSize(const ReflowInput& aReflowInput,
ReflowOutput& aDesiredSize)
{
WritingMode wm = aReflowInput.GetWritingMode();
LogicalSize size(wm, aReflowInput.AvailableISize(), // FRAME
aReflowInput.AvailableBSize());
aDesiredSize.SetSize(wm, size);
aDesiredSize.SetOverflowAreasToDesiredBounds();
FinishAndStoreOverflow(&aDesiredSize, aReflowInput.mStyleDisplay);
}