Bug 1472840 [wpt PR 11759] - [css-logical] Implement flow-relative margin, padding...
[gecko.git] / layout / mathml / nsMathMLTokenFrame.h
blob62047c3d6f0c1904140260374c1283366c201b58
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 {
18 public:
19 NS_DECL_FRAMEARENA_HELPERS(nsMathMLTokenFrame)
21 friend nsIFrame* NS_NewMathMLTokenFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
23 NS_IMETHOD
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;
30 return NS_OK;
33 NS_IMETHOD
34 InheritAutomaticData(nsIFrame* aParent) override;
36 virtual eMathMLFrameType GetMathMLFrameType() override;
38 virtual void
39 SetInitialChildList(ChildListID aListID,
40 nsFrameList& aChildList) override;
42 virtual void
43 AppendFrames(ChildListID aListID,
44 nsFrameList& aChildList) override;
46 virtual void
47 InsertFrames(ChildListID aListID,
48 nsIFrame* aPrevFrame,
49 nsFrameList& aChildList) override;
51 virtual void
52 Reflow(nsPresContext* aPresContext,
53 ReflowOutput& aDesiredSize,
54 const ReflowInput& aReflowInput,
55 nsReflowStatus& aStatus) override;
57 virtual nsresult
58 Place(DrawTarget* aDrawTarget,
59 bool aPlaceOrigin,
60 ReflowOutput& aDesiredSize) override;
62 protected:
63 explicit nsMathMLTokenFrame(ComputedStyle* aStyle, ClassID aID = kClassID)
64 : nsMathMLContainerFrame(aStyle, aID) {}
65 virtual ~nsMathMLTokenFrame();
67 void MarkTextFramesAsTokenMathML();
70 #endif /* nsMathMLTokentFrame_h___ */