Line data Source code
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/. */
5 : #ifndef nsSelectsAreaFrame_h___
6 : #define nsSelectsAreaFrame_h___
7 :
8 : #include "mozilla/Attributes.h"
9 : #include "nsBlockFrame.h"
10 :
11 0 : class nsSelectsAreaFrame : public nsBlockFrame
12 : {
13 : public:
14 0 : NS_DECL_FRAMEARENA_HELPERS(nsSelectsAreaFrame)
15 :
16 : friend nsContainerFrame* NS_NewSelectsAreaFrame(nsIPresShell* aShell,
17 : nsStyleContext* aContext,
18 : nsFrameState aFlags);
19 :
20 : virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
21 : const nsRect& aDirtyRect,
22 : const nsDisplayListSet& aLists) override;
23 :
24 : void BuildDisplayListInternal(nsDisplayListBuilder* aBuilder,
25 : const nsRect& aDirtyRect,
26 : const nsDisplayListSet& aLists);
27 :
28 : virtual void Reflow(nsPresContext* aCX,
29 : ReflowOutput& aDesiredSize,
30 : const ReflowInput& aReflowInput,
31 : nsReflowStatus& aStatus) override;
32 :
33 0 : nscoord BSizeOfARow() const { return mBSizeOfARow; }
34 :
35 : protected:
36 0 : explicit nsSelectsAreaFrame(nsStyleContext* aContext) :
37 : nsBlockFrame(aContext, kClassID),
38 : // initialize to wacky value so first call of
39 : // nsSelectsAreaFrame::Reflow will always invalidate
40 0 : mBSizeOfARow(nscoord_MIN)
41 0 : {}
42 :
43 : // We cache the block size of a single row so that changes to the
44 : // "size" attribute, padding, etc. can all be handled with only one
45 : // reflow. We'll have to reflow twice if someone changes our font
46 : // size or something like that, so that the block size of our options
47 : // will change.
48 : nscoord mBSizeOfARow;
49 : };
50 :
51 : #endif /* nsSelectsAreaFrame_h___ */
|