Line data Source code
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/. */
5 :
6 : /* struct containing the output from nsIFrame::Reflow */
7 :
8 : #include "mozilla/ReflowOutput.h"
9 : #include "mozilla/ReflowInput.h"
10 :
11 : void
12 2099 : nsOverflowAreas::UnionWith(const nsOverflowAreas& aOther)
13 : {
14 : // FIXME: We should probably change scrollable overflow to use
15 : // UnionRectIncludeEmpty (but leave visual overflow using UnionRect).
16 6297 : NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
17 4198 : mRects[otype].UnionRect(mRects[otype], aOther.mRects[otype]);
18 : }
19 2099 : }
20 :
21 : void
22 0 : nsOverflowAreas::UnionAllWith(const nsRect& aRect)
23 : {
24 : // FIXME: We should probably change scrollable overflow to use
25 : // UnionRectIncludeEmpty (but leave visual overflow using UnionRect).
26 0 : NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
27 0 : mRects[otype].UnionRect(mRects[otype], aRect);
28 : }
29 0 : }
30 :
31 : void
32 46 : nsOverflowAreas::SetAllTo(const nsRect& aRect)
33 : {
34 138 : NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
35 92 : mRects[otype] = aRect;
36 : }
37 46 : }
38 :
39 : namespace mozilla {
40 :
41 307 : ReflowOutput::ReflowOutput(const ReflowInput& aState,
42 307 : uint32_t aFlags)
43 : : mISize(0)
44 : , mBSize(0)
45 : , mBlockStartAscent(ASK_FOR_BASELINE)
46 : , mFlags(aFlags)
47 307 : , mWritingMode(aState.GetWritingMode())
48 : {
49 307 : }
50 :
51 : void
52 344 : ReflowOutput::SetOverflowAreasToDesiredBounds()
53 : {
54 1032 : NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
55 688 : mOverflowAreas.Overflow(otype).SetRect(0, 0, Width(), Height());
56 : }
57 344 : }
58 :
59 : void
60 204 : ReflowOutput::UnionOverflowAreasWithDesiredBounds()
61 : {
62 : // FIXME: We should probably change scrollable overflow to use
63 : // UnionRectIncludeEmpty (but leave visual overflow using UnionRect).
64 408 : nsRect rect(0, 0, Width(), Height());
65 612 : NS_FOR_FRAME_OVERFLOW_TYPES(otype) {
66 408 : nsRect& o = mOverflowAreas.Overflow(otype);
67 408 : o.UnionRect(o, rect);
68 : }
69 204 : }
70 :
71 : } // namespace mozilla
|