2017-10-27 20:33:53 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* 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/. */
|
2010-10-07 08:25:45 +04:00
|
|
|
|
|
|
|
/* struct containing the output from nsIFrame::Reflow */
|
|
|
|
|
2016-07-21 13:36:37 +03:00
|
|
|
#include "mozilla/ReflowOutput.h"
|
2016-07-21 13:36:34 +03:00
|
|
|
#include "mozilla/ReflowInput.h"
|
2010-10-07 08:25:45 +04:00
|
|
|
|
|
|
|
void
|
|
|
|
nsOverflowAreas::UnionWith(const nsOverflowAreas& aOther)
|
|
|
|
{
|
|
|
|
// FIXME: We should probably change scrollable overflow to use
|
|
|
|
// UnionRectIncludeEmpty (but leave visual overflow using UnionRect).
|
|
|
|
NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
|
|
|
|
mRects[otype].UnionRect(mRects[otype], aOther.mRects[otype]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsOverflowAreas::UnionAllWith(const nsRect& aRect)
|
|
|
|
{
|
|
|
|
// FIXME: We should probably change scrollable overflow to use
|
|
|
|
// UnionRectIncludeEmpty (but leave visual overflow using UnionRect).
|
|
|
|
NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
|
|
|
|
mRects[otype].UnionRect(mRects[otype], aRect);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsOverflowAreas::SetAllTo(const nsRect& aRect)
|
|
|
|
{
|
|
|
|
NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
|
|
|
|
mRects[otype] = aRect;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-12-01 01:47:45 +03:00
|
|
|
namespace mozilla {
|
|
|
|
|
2018-06-04 09:22:10 +03:00
|
|
|
ReflowOutput::ReflowOutput(const ReflowInput& aReflowInput)
|
|
|
|
: ReflowOutput(aReflowInput.GetWritingMode())
|
2013-12-31 17:50:31 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2010-10-07 08:25:45 +04:00
|
|
|
void
|
2016-07-21 13:36:38 +03:00
|
|
|
ReflowOutput::SetOverflowAreasToDesiredBounds()
|
2010-10-07 08:25:45 +04:00
|
|
|
{
|
|
|
|
NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
|
2013-12-27 21:59:52 +04:00
|
|
|
mOverflowAreas.Overflow(otype).SetRect(0, 0, Width(), Height());
|
2010-10-07 08:25:45 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2016-07-21 13:36:38 +03:00
|
|
|
ReflowOutput::UnionOverflowAreasWithDesiredBounds()
|
2010-10-07 08:25:45 +04:00
|
|
|
{
|
|
|
|
// FIXME: We should probably change scrollable overflow to use
|
|
|
|
// UnionRectIncludeEmpty (but leave visual overflow using UnionRect).
|
2013-12-27 21:59:52 +04:00
|
|
|
nsRect rect(0, 0, Width(), Height());
|
2010-10-07 08:25:45 +04:00
|
|
|
NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
|
|
|
|
nsRect& o = mOverflowAreas.Overflow(otype);
|
|
|
|
o.UnionRect(o, rect);
|
|
|
|
}
|
|
|
|
}
|
2016-12-01 01:47:45 +03:00
|
|
|
|
|
|
|
} // namespace mozilla
|