Bumping manifests a=b2g-bump
[gecko.git] / layout / generic / nsHTMLReflowMetrics.cpp
blob2c8708b6a25f6a424c17d0b3795319c252dd159d
1 /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 /* struct containing the output from nsIFrame::Reflow */
8 #include "nsHTMLReflowMetrics.h"
9 #include "nsHTMLReflowState.h"
11 void
12 nsOverflowAreas::UnionWith(const nsOverflowAreas& aOther)
14 // FIXME: We should probably change scrollable overflow to use
15 // UnionRectIncludeEmpty (but leave visual overflow using UnionRect).
16 NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
17 mRects[otype].UnionRect(mRects[otype], aOther.mRects[otype]);
21 void
22 nsOverflowAreas::UnionAllWith(const nsRect& aRect)
24 // FIXME: We should probably change scrollable overflow to use
25 // UnionRectIncludeEmpty (but leave visual overflow using UnionRect).
26 NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
27 mRects[otype].UnionRect(mRects[otype], aRect);
31 void
32 nsOverflowAreas::SetAllTo(const nsRect& aRect)
34 NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
35 mRects[otype] = aRect;
39 nsHTMLReflowMetrics::nsHTMLReflowMetrics(const nsHTMLReflowState& aState,
40 uint32_t aFlags)
41 : mISize(0)
42 , mBSize(0)
43 , mBlockStartAscent(ASK_FOR_BASELINE)
44 , mFlags(aFlags)
45 , mWritingMode(aState.GetWritingMode())
49 void
50 nsHTMLReflowMetrics::SetOverflowAreasToDesiredBounds()
52 NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
53 mOverflowAreas.Overflow(otype).SetRect(0, 0, Width(), Height());
57 void
58 nsHTMLReflowMetrics::UnionOverflowAreasWithDesiredBounds()
60 // FIXME: We should probably change scrollable overflow to use
61 // UnionRectIncludeEmpty (but leave visual overflow using UnionRect).
62 nsRect rect(0, 0, Width(), Height());
63 NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
64 nsRect& o = mOverflowAreas.Overflow(otype);
65 o.UnionRect(o, rect);