Bug 461269 - Remove TOK_RP nodes from the parse tree. r=brendan.
[mozilla-central.git] / layout / mathml / nsMathMLmsqrtFrame.h
blob43b67ee21a575080eff2f85318c6d97a7bc7ba70
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is Mozilla MathML Project.
17 * The Initial Developer of the Original Code is
18 * The University Of Queensland.
19 * Portions created by the Initial Developer are Copyright (C) 1999
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
23 * Roger B. Sidje <rbs@maths.uq.edu.au>
24 * David J. Fiddes <D.J.Fiddes@hw.ac.uk>
25 * Vilya Harvey <vilya@nag.co.uk>
26 * Shyjan Mahamud <mahamud@cs.cmu.edu>
28 * Alternatively, the contents of this file may be used under the terms of
29 * either of the GNU General Public License Version 2 or later (the "GPL"),
30 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
31 * in which case the provisions of the GPL or the LGPL are applicable instead
32 * of those above. If you wish to allow use of your version of this file only
33 * under the terms of either the GPL or the LGPL, and not to allow others to
34 * use your version of this file under the terms of the MPL, indicate your
35 * decision by deleting the provisions above and replace them with the notice
36 * and other provisions required by the GPL or the LGPL. If you do not delete
37 * the provisions above, a recipient may use your version of this file under
38 * the terms of any one of the MPL, the GPL or the LGPL.
40 * ***** END LICENSE BLOCK ***** */
42 #ifndef nsMathMLmsqrtFrame_h___
43 #define nsMathMLmsqrtFrame_h___
45 #include "nsCOMPtr.h"
46 #include "nsMathMLContainerFrame.h"
49 // <msqrt> -- form a fraction from two subexpressions
53 The MathML REC describes:
55 The <msqrt> element is used to display square roots.
56 The syntax for <msqrt> is:
57 <msqrt> base </msqrt>
59 Attributes of <msqrt> and <mroot>:
61 None (except the attributes allowed for all MathML elements, listed in Section
62 2.3.4).
64 The <mroot> element increments scriptlevel by 2, and sets displaystyle to
65 "false", within index, but leaves both attributes unchanged within base. The
66 <msqrt> element leaves both attributes unchanged within all its arguments.
67 These attributes are inherited by every element from its rendering environment,
68 but can be set explicitly only on <mstyle>. (See Section 3.3.4.)
72 TODO:
75 class nsMathMLmsqrtFrame : public nsMathMLContainerFrame {
76 public:
77 friend nsIFrame* NS_NewMathMLmsqrtFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
79 virtual void
80 SetAdditionalStyleContext(PRInt32 aIndex,
81 nsStyleContext* aStyleContext);
82 virtual nsStyleContext*
83 GetAdditionalStyleContext(PRInt32 aIndex) const;
85 NS_IMETHOD
86 Init(nsIContent* aContent,
87 nsIFrame* aParent,
88 nsIFrame* aPrevInFlow);
90 virtual nsresult
91 Place(nsIRenderingContext& aRenderingContext,
92 PRBool aPlaceOrigin,
93 nsHTMLReflowMetrics& aDesiredSize);
95 virtual nscoord
96 GetIntrinsicWidth(nsIRenderingContext* aRenderingContext);
98 NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
99 const nsRect& aDirtyRect,
100 const nsDisplayListSet& aLists);
102 NS_IMETHOD
103 InheritAutomaticData(nsIFrame* aParent);
105 NS_IMETHOD
106 TransmitAutomaticData();
108 // the base method doesn't deal fully with <msqrt> because it only
109 // slides child frames and has no idea that we have a sqrt glyph that
110 // is part of the flow without being a frame. We need to shift our
111 // sqrt glyph too.
112 virtual nscoord
113 FixInterFrameSpacing(nsHTMLReflowMetrics& aDesiredSize);
115 protected:
116 nsMathMLmsqrtFrame(nsStyleContext* aContext);
117 virtual ~nsMathMLmsqrtFrame();
119 virtual PRIntn GetSkipSides() const { return 0; }
121 virtual nsresult
122 MeasureChildFrames(nsIRenderingContext& aRenderingContext,
123 nsHTMLReflowMetrics& aDesiredSize);
125 nsMathMLChar mSqrChar;
126 nsRect mBarRect;
129 #endif /* nsMathMLmsqrtFrame_h___ */