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