michael@0: /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* struct containing the output from nsIFrame::Reflow */ michael@0: michael@0: #include "nsHTMLReflowMetrics.h" michael@0: #include "nsHTMLReflowState.h" michael@0: michael@0: void michael@0: nsOverflowAreas::UnionWith(const nsOverflowAreas& aOther) michael@0: { michael@0: // FIXME: We should probably change scrollable overflow to use michael@0: // UnionRectIncludeEmpty (but leave visual overflow using UnionRect). michael@0: NS_FOR_FRAME_OVERFLOW_TYPES(otype) { michael@0: mRects[otype].UnionRect(mRects[otype], aOther.mRects[otype]); michael@0: } michael@0: } michael@0: michael@0: void michael@0: nsOverflowAreas::UnionAllWith(const nsRect& aRect) michael@0: { michael@0: // FIXME: We should probably change scrollable overflow to use michael@0: // UnionRectIncludeEmpty (but leave visual overflow using UnionRect). michael@0: NS_FOR_FRAME_OVERFLOW_TYPES(otype) { michael@0: mRects[otype].UnionRect(mRects[otype], aRect); michael@0: } michael@0: } michael@0: michael@0: void michael@0: nsOverflowAreas::SetAllTo(const nsRect& aRect) michael@0: { michael@0: NS_FOR_FRAME_OVERFLOW_TYPES(otype) { michael@0: mRects[otype] = aRect; michael@0: } michael@0: } michael@0: michael@0: nsHTMLReflowMetrics::nsHTMLReflowMetrics(const nsHTMLReflowState& aState, michael@0: uint32_t aFlags) michael@0: : mISize(0) michael@0: , mBSize(0) michael@0: , mBlockStartAscent(ASK_FOR_BASELINE) michael@0: , mFlags(aFlags) michael@0: , mWritingMode(aState.GetWritingMode()) michael@0: { michael@0: } michael@0: michael@0: void michael@0: nsHTMLReflowMetrics::SetOverflowAreasToDesiredBounds() michael@0: { michael@0: NS_FOR_FRAME_OVERFLOW_TYPES(otype) { michael@0: mOverflowAreas.Overflow(otype).SetRect(0, 0, Width(), Height()); michael@0: } michael@0: } michael@0: michael@0: void michael@0: nsHTMLReflowMetrics::UnionOverflowAreasWithDesiredBounds() michael@0: { michael@0: // FIXME: We should probably change scrollable overflow to use michael@0: // UnionRectIncludeEmpty (but leave visual overflow using UnionRect). michael@0: nsRect rect(0, 0, Width(), Height()); michael@0: NS_FOR_FRAME_OVERFLOW_TYPES(otype) { michael@0: nsRect& o = mOverflowAreas.Overflow(otype); michael@0: o.UnionRect(o, rect); michael@0: } michael@0: }