1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsMathMLTokenFrame_h___
8 #define nsMathMLTokenFrame_h___
10 #include "mozilla/Attributes.h"
11 #include "nsMathMLContainerFrame.h"
14 // Base class to handle token elements
17 class nsMathMLTokenFrame
: public nsMathMLContainerFrame
{
19 NS_DECL_FRAMEARENA_HELPERS(nsMathMLTokenFrame
)
21 friend nsIFrame
* NS_NewMathMLTokenFrame(nsIPresShell
* aPresShell
, ComputedStyle
* aStyle
);
24 TransmitAutomaticData() override
{
25 // The REC defines the following elements to be space-like:
26 // * an mtext, mspace, maligngroup, or malignmark element;
27 if (mContent
->IsMathMLElement(nsGkAtoms::mtext_
)) {
28 mPresentationData
.flags
|= NS_MATHML_SPACE_LIKE
;
34 InheritAutomaticData(nsIFrame
* aParent
) override
;
36 virtual eMathMLFrameType
GetMathMLFrameType() override
;
39 SetInitialChildList(ChildListID aListID
,
40 nsFrameList
& aChildList
) override
;
43 AppendFrames(ChildListID aListID
,
44 nsFrameList
& aChildList
) override
;
47 InsertFrames(ChildListID aListID
,
49 nsFrameList
& aChildList
) override
;
52 Reflow(nsPresContext
* aPresContext
,
53 ReflowOutput
& aDesiredSize
,
54 const ReflowInput
& aReflowInput
,
55 nsReflowStatus
& aStatus
) override
;
58 Place(DrawTarget
* aDrawTarget
,
60 ReflowOutput
& aDesiredSize
) override
;
63 explicit nsMathMLTokenFrame(ComputedStyle
* aStyle
, ClassID aID
= kClassID
)
64 : nsMathMLContainerFrame(aStyle
, aID
) {}
65 virtual ~nsMathMLTokenFrame();
67 void MarkTextFramesAsTokenMathML();
70 #endif /* nsMathMLTokentFrame_h___ */