|
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 class nsSelectsAreaFrame : public nsBlockFrame |
|
12 { |
|
13 public: |
|
14 NS_DECL_FRAMEARENA_HELPERS |
|
15 |
|
16 friend nsIFrame* NS_NewSelectsAreaFrame(nsIPresShell* aShell, nsStyleContext* aContext, nsFrameState aFlags); |
|
17 |
|
18 virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, |
|
19 const nsRect& aDirtyRect, |
|
20 const nsDisplayListSet& aLists) MOZ_OVERRIDE; |
|
21 |
|
22 void BuildDisplayListInternal(nsDisplayListBuilder* aBuilder, |
|
23 const nsRect& aDirtyRect, |
|
24 const nsDisplayListSet& aLists); |
|
25 |
|
26 virtual nsresult Reflow(nsPresContext* aCX, |
|
27 nsHTMLReflowMetrics& aDesiredSize, |
|
28 const nsHTMLReflowState& aReflowState, |
|
29 nsReflowStatus& aStatus) MOZ_OVERRIDE; |
|
30 |
|
31 nscoord HeightOfARow() const { return mHeightOfARow; } |
|
32 |
|
33 protected: |
|
34 nsSelectsAreaFrame(nsStyleContext* aContext) : |
|
35 nsBlockFrame(aContext), |
|
36 mHeightOfARow(0) |
|
37 {} |
|
38 |
|
39 // We cache the height of a single row so that changes to the "size" |
|
40 // attribute, padding, etc. can all be handled with only one reflow. We'll |
|
41 // have to reflow twice if someone changes our font size or something like |
|
42 // that, so that the heights of our options will change. |
|
43 nscoord mHeightOfARow; |
|
44 }; |
|
45 |
|
46 #endif /* nsSelectsAreaFrame_h___ */ |