Bumping manifests a=b2g-bump
[gecko.git] / layout / xul / nsBoxLayout.cpp
blob4783f0269c7dfbd5b22ce3cd49f1d62b6b695cdd
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
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 //
7 // Eric Vaughan
8 // Netscape Communications
9 //
10 // See documentation in associated header file
13 #include "nsBox.h"
14 #include "nsCOMPtr.h"
15 #include "nsContainerFrame.h"
16 #include "nsBoxLayout.h"
18 void
19 nsBoxLayout::AddBorderAndPadding(nsIFrame* aBox, nsSize& aSize)
21 nsBox::AddBorderAndPadding(aBox, aSize);
24 void
25 nsBoxLayout::AddMargin(nsIFrame* aBox, nsSize& aSize)
27 nsBox::AddMargin(aBox, aSize);
30 void
31 nsBoxLayout::AddMargin(nsSize& aSize, const nsMargin& aMargin)
33 nsBox::AddMargin(aSize, aMargin);
36 nsSize
37 nsBoxLayout::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
39 nsSize pref (0, 0);
40 AddBorderAndPadding(aBox, pref);
42 return pref;
45 nsSize
46 nsBoxLayout::GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
48 nsSize minSize (0,0);
49 AddBorderAndPadding(aBox, minSize);
50 return minSize;
53 nsSize
54 nsBoxLayout::GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
56 //AddBorderAndPadding () never changes maxSize (NS_INTRINSICSIZE)
57 //AddBorderAndPadding(aBox, maxSize);
58 return nsSize (NS_INTRINSICSIZE,NS_INTRINSICSIZE);
62 nscoord
63 nsBoxLayout::GetAscent(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
65 return 0;
68 NS_IMETHODIMP
69 nsBoxLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState)
71 return NS_OK;
74 void
75 nsBoxLayout::AddLargestSize(nsSize& aSize, const nsSize& aSize2)
77 if (aSize2.width > aSize.width)
78 aSize.width = aSize2.width;
80 if (aSize2.height > aSize.height)
81 aSize.height = aSize2.height;
84 void
85 nsBoxLayout::AddSmallestSize(nsSize& aSize, const nsSize& aSize2)
87 if (aSize2.width < aSize.width)
88 aSize.width = aSize2.width;
90 if (aSize2.height < aSize.height)
91 aSize.height = aSize2.height;
94 NS_IMPL_ISUPPORTS(nsBoxLayout, nsBoxLayout)