|
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 nsMathMLmsqrtFrame_h___ |
|
7 #define nsMathMLmsqrtFrame_h___ |
|
8 |
|
9 #include "mozilla/Attributes.h" |
|
10 #include "nsMathMLmencloseFrame.h" |
|
11 |
|
12 // |
|
13 // <msqrt> -- form a radical |
|
14 // |
|
15 |
|
16 /* |
|
17 The MathML REC describes: |
|
18 |
|
19 The <msqrt> element is used to display square roots. |
|
20 The syntax for <msqrt> is: |
|
21 <msqrt> base </msqrt> |
|
22 |
|
23 Attributes of <msqrt> and <mroot>: |
|
24 |
|
25 None (except the attributes allowed for all MathML elements, listed in Section |
|
26 2.3.4). |
|
27 |
|
28 The <mroot> element increments scriptlevel by 2, and sets displaystyle to |
|
29 "false", within index, but leaves both attributes unchanged within base. The |
|
30 <msqrt> element leaves both attributes unchanged within all its arguments. |
|
31 These attributes are inherited by every element from its rendering environment, |
|
32 but can be set explicitly only on <mstyle>. (See Section 3.3.4.) |
|
33 */ |
|
34 |
|
35 class nsMathMLmsqrtFrame : public nsMathMLmencloseFrame { |
|
36 public: |
|
37 NS_DECL_FRAMEARENA_HELPERS |
|
38 |
|
39 friend nsIFrame* NS_NewMathMLmsqrtFrame(nsIPresShell* aPresShell, |
|
40 nsStyleContext* aContext); |
|
41 |
|
42 virtual void |
|
43 Init(nsIContent* aContent, |
|
44 nsIFrame* aParent, |
|
45 nsIFrame* aPrevInFlow) MOZ_OVERRIDE; |
|
46 |
|
47 NS_IMETHOD |
|
48 InheritAutomaticData(nsIFrame* aParent) MOZ_OVERRIDE; |
|
49 |
|
50 virtual nsresult |
|
51 AttributeChanged(int32_t aNameSpaceID, |
|
52 nsIAtom* aAttribute, |
|
53 int32_t aModType) MOZ_OVERRIDE; |
|
54 |
|
55 virtual bool |
|
56 IsMrowLike() MOZ_OVERRIDE |
|
57 { |
|
58 return mFrames.FirstChild() != mFrames.LastChild() || |
|
59 !mFrames.FirstChild(); |
|
60 } |
|
61 |
|
62 protected: |
|
63 nsMathMLmsqrtFrame(nsStyleContext* aContext); |
|
64 virtual ~nsMathMLmsqrtFrame(); |
|
65 }; |
|
66 |
|
67 #endif /* nsMathMLmsqrtFrame_h___ */ |
|
68 |