Line data Source code
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/. */
5 :
6 : #ifndef nsMathMLmrowFrame_h___
7 : #define nsMathMLmrowFrame_h___
8 :
9 : #include "mozilla/Attributes.h"
10 : #include "nsMathMLContainerFrame.h"
11 :
12 : //
13 : // <mrow> -- horizontally group any number of subexpressions
14 : // <mphantom> -- make content invisible but preserve its size
15 : // <mstyle> -- make style changes that affect the rendering of its contents
16 : //
17 :
18 : class nsMathMLmrowFrame : public nsMathMLContainerFrame {
19 : public:
20 0 : NS_DECL_FRAMEARENA_HELPERS(nsMathMLmrowFrame)
21 :
22 : friend nsIFrame* NS_NewMathMLmrowFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
23 :
24 : virtual nsresult
25 : AttributeChanged(int32_t aNameSpaceID,
26 : nsIAtom* aAttribute,
27 : int32_t aModType) override;
28 :
29 : NS_IMETHOD
30 : InheritAutomaticData(nsIFrame* aParent) override;
31 :
32 : NS_IMETHOD
33 0 : TransmitAutomaticData() override {
34 0 : return TransmitAutomaticDataForMrowLikeElement();
35 : }
36 :
37 : virtual eMathMLFrameType
38 : GetMathMLFrameType() override;
39 :
40 : bool
41 0 : IsMrowLike() override {
42 : // <mrow> elements with a single child are treated identically to the case
43 : // where the child wasn't within an mrow, so we pretend the mrow isn't an
44 : // mrow in that situation.
45 0 : return mFrames.FirstChild() != mFrames.LastChild() ||
46 0 : !mFrames.FirstChild();
47 : }
48 :
49 : protected:
50 0 : explicit nsMathMLmrowFrame(nsStyleContext* aContext)
51 0 : : nsMathMLContainerFrame(aContext, kClassID) {}
52 : virtual ~nsMathMLmrowFrame();
53 : };
54 :
55 : #endif /* nsMathMLmrowFrame_h___ */
|