|
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 nsMathMLmrowFrame_h___ |
|
7 #define nsMathMLmrowFrame_h___ |
|
8 |
|
9 #include "mozilla/Attributes.h" |
|
10 #include "nsMathMLContainerFrame.h" |
|
11 |
|
12 // |
|
13 // <mrow> -- horizontally group any number of subexpressions |
|
14 // |
|
15 |
|
16 class nsMathMLmrowFrame : public nsMathMLContainerFrame { |
|
17 public: |
|
18 NS_DECL_FRAMEARENA_HELPERS |
|
19 |
|
20 friend nsIFrame* NS_NewMathMLmrowFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); |
|
21 |
|
22 virtual nsresult |
|
23 AttributeChanged(int32_t aNameSpaceID, |
|
24 nsIAtom* aAttribute, |
|
25 int32_t aModType) MOZ_OVERRIDE; |
|
26 |
|
27 NS_IMETHOD |
|
28 InheritAutomaticData(nsIFrame* aParent) MOZ_OVERRIDE; |
|
29 |
|
30 NS_IMETHOD |
|
31 TransmitAutomaticData() MOZ_OVERRIDE { |
|
32 return TransmitAutomaticDataForMrowLikeElement(); |
|
33 } |
|
34 |
|
35 virtual eMathMLFrameType |
|
36 GetMathMLFrameType() MOZ_OVERRIDE; |
|
37 |
|
38 bool |
|
39 IsMrowLike() MOZ_OVERRIDE { |
|
40 // <mrow> elements with a single child are treated identically to the case |
|
41 // where the child wasn't within an mrow, so we pretend the mrow isn't an |
|
42 // mrow in that situation. |
|
43 return mFrames.FirstChild() != mFrames.LastChild() || |
|
44 !mFrames.FirstChild(); |
|
45 } |
|
46 |
|
47 protected: |
|
48 nsMathMLmrowFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {} |
|
49 virtual ~nsMathMLmrowFrame(); |
|
50 }; |
|
51 |
|
52 #endif /* nsMathMLmrowFrame_h___ */ |