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/. */
6 #ifndef nsMathMLTokenFrame_h___
7 #define nsMathMLTokenFrame_h___
9 #include "mozilla/Attributes.h"
10 #include "nsMathMLContainerFrame.h"
13 // Base class to handle token elements
16 class nsMathMLTokenFrame
: public nsMathMLContainerFrame
{
18 NS_DECL_FRAMEARENA_HELPERS
20 friend nsIFrame
* NS_NewMathMLTokenFrame(nsIPresShell
* aPresShell
, nsStyleContext
* aContext
);
23 TransmitAutomaticData() MOZ_OVERRIDE
{
24 // The REC defines the following elements to be space-like:
25 // * an mtext, mspace, maligngroup, or malignmark element;
26 if (mContent
->Tag() == nsGkAtoms::mtext_
) {
27 mPresentationData
.flags
|= NS_MATHML_SPACE_LIKE
;
33 InheritAutomaticData(nsIFrame
* aParent
) MOZ_OVERRIDE
;
35 virtual eMathMLFrameType
GetMathMLFrameType() MOZ_OVERRIDE
;
38 SetInitialChildList(ChildListID aListID
,
39 nsFrameList
& aChildList
) MOZ_OVERRIDE
;
42 AppendFrames(ChildListID aListID
,
43 nsFrameList
& aChildList
) MOZ_OVERRIDE
;
46 InsertFrames(ChildListID aListID
,
48 nsFrameList
& aChildList
) MOZ_OVERRIDE
;
51 Reflow(nsPresContext
* aPresContext
,
52 nsHTMLReflowMetrics
& aDesiredSize
,
53 const nsHTMLReflowState
& aReflowState
,
54 nsReflowStatus
& aStatus
) MOZ_OVERRIDE
;
57 Place(nsRenderingContext
& aRenderingContext
,
59 nsHTMLReflowMetrics
& aDesiredSize
) MOZ_OVERRIDE
;
62 explicit nsMathMLTokenFrame(nsStyleContext
* aContext
) : nsMathMLContainerFrame(aContext
) {}
63 virtual ~nsMathMLTokenFrame();
65 void MarkTextFramesAsTokenMathML();
68 #endif /* nsMathMLTokentFrame_h___ */