|
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 |
|
6 #ifndef nsMathMLmspaceFrame_h___ |
|
7 #define nsMathMLmspaceFrame_h___ |
|
8 |
|
9 #include "mozilla/Attributes.h" |
|
10 #include "nsMathMLContainerFrame.h" |
|
11 |
|
12 // |
|
13 // <mspace> -- space |
|
14 // |
|
15 |
|
16 class nsMathMLmspaceFrame : public nsMathMLContainerFrame { |
|
17 public: |
|
18 NS_DECL_FRAMEARENA_HELPERS |
|
19 |
|
20 friend nsIFrame* NS_NewMathMLmspaceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); |
|
21 |
|
22 NS_IMETHOD |
|
23 TransmitAutomaticData() MOZ_OVERRIDE { |
|
24 // The REC defines the following elements to be space-like: |
|
25 // * an mtext, mspace, maligngroup, or malignmark element; |
|
26 mPresentationData.flags |= NS_MATHML_SPACE_LIKE; |
|
27 return NS_OK; |
|
28 } |
|
29 |
|
30 virtual bool IsLeaf() const MOZ_OVERRIDE; |
|
31 |
|
32 virtual nsresult |
|
33 Reflow(nsPresContext* aPresContext, |
|
34 nsHTMLReflowMetrics& aDesiredSize, |
|
35 const nsHTMLReflowState& aReflowState, |
|
36 nsReflowStatus& aStatus) MOZ_OVERRIDE; |
|
37 |
|
38 protected: |
|
39 nsMathMLmspaceFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {} |
|
40 virtual ~nsMathMLmspaceFrame(); |
|
41 |
|
42 virtual nsresult |
|
43 MeasureForWidth(nsRenderingContext& aRenderingContext, |
|
44 nsHTMLReflowMetrics& aDesiredSize) MOZ_OVERRIDE; |
|
45 |
|
46 private: |
|
47 nscoord mWidth; |
|
48 nscoord mHeight; |
|
49 nscoord mDepth; |
|
50 |
|
51 // helper method to initialize our member data |
|
52 void |
|
53 ProcessAttributes(nsPresContext* aPresContext); |
|
54 }; |
|
55 |
|
56 #endif /* nsMathMLmspaceFrame_h___ */ |