/src/mozilla-central/layout/mathml/nsMathMLTokenFrame.h
Line | Count | Source (jump to first uncovered line) |
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/. */ |
6 | | |
7 | | #ifndef nsMathMLTokenFrame_h___ |
8 | | #define nsMathMLTokenFrame_h___ |
9 | | |
10 | | #include "mozilla/Attributes.h" |
11 | | #include "nsMathMLContainerFrame.h" |
12 | | |
13 | | // |
14 | | // Base class to handle token elements |
15 | | // |
16 | | |
17 | | class nsMathMLTokenFrame : public nsMathMLContainerFrame { |
18 | | public: |
19 | | NS_DECL_FRAMEARENA_HELPERS(nsMathMLTokenFrame) |
20 | | |
21 | | friend nsIFrame* NS_NewMathMLTokenFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle); |
22 | | |
23 | | NS_IMETHOD |
24 | 0 | TransmitAutomaticData() override { |
25 | 0 | // The REC defines the following elements to be space-like: |
26 | 0 | // * an mtext, mspace, maligngroup, or malignmark element; |
27 | 0 | if (mContent->IsMathMLElement(nsGkAtoms::mtext_)) { |
28 | 0 | mPresentationData.flags |= NS_MATHML_SPACE_LIKE; |
29 | 0 | } |
30 | 0 | return NS_OK; |
31 | 0 | } |
32 | | |
33 | | NS_IMETHOD |
34 | | InheritAutomaticData(nsIFrame* aParent) override; |
35 | | |
36 | | virtual eMathMLFrameType GetMathMLFrameType() override; |
37 | | |
38 | | virtual void |
39 | | SetInitialChildList(ChildListID aListID, |
40 | | nsFrameList& aChildList) override; |
41 | | |
42 | | virtual void |
43 | | AppendFrames(ChildListID aListID, |
44 | | nsFrameList& aChildList) override; |
45 | | |
46 | | virtual void |
47 | | InsertFrames(ChildListID aListID, |
48 | | nsIFrame* aPrevFrame, |
49 | | nsFrameList& aChildList) override; |
50 | | |
51 | | virtual void |
52 | | Reflow(nsPresContext* aPresContext, |
53 | | ReflowOutput& aDesiredSize, |
54 | | const ReflowInput& aReflowInput, |
55 | | nsReflowStatus& aStatus) override; |
56 | | |
57 | | virtual nsresult |
58 | | Place(DrawTarget* aDrawTarget, |
59 | | bool aPlaceOrigin, |
60 | | ReflowOutput& aDesiredSize) override; |
61 | | |
62 | | protected: |
63 | | explicit nsMathMLTokenFrame(ComputedStyle* aStyle, ClassID aID = kClassID) |
64 | 0 | : nsMathMLContainerFrame(aStyle, aID) {} |
65 | | virtual ~nsMathMLTokenFrame(); |
66 | | |
67 | | void MarkTextFramesAsTokenMathML(); |
68 | | }; |
69 | | |
70 | | #endif /* nsMathMLTokentFrame_h___ */ |