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"
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
]);
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
);
32 nsOverflowAreas::SetAllTo(const nsRect
& aRect
)
34 NS_FOR_FRAME_OVERFLOW_TYPES(otype
) {
35 mRects
[otype
] = aRect
;
39 nsHTMLReflowMetrics::nsHTMLReflowMetrics(const nsHTMLReflowState
& aState
,
43 , mBlockStartAscent(ASK_FOR_BASELINE
)
45 , mWritingMode(aState
.GetWritingMode())
50 nsHTMLReflowMetrics::SetOverflowAreasToDesiredBounds()
52 NS_FOR_FRAME_OVERFLOW_TYPES(otype
) {
53 mOverflowAreas
.Overflow(otype
).SetRect(0, 0, Width(), Height());
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
);