Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef nsMathMLmrowFrame_h___ |
michael@0 | 7 | #define nsMathMLmrowFrame_h___ |
michael@0 | 8 | |
michael@0 | 9 | #include "mozilla/Attributes.h" |
michael@0 | 10 | #include "nsMathMLContainerFrame.h" |
michael@0 | 11 | |
michael@0 | 12 | // |
michael@0 | 13 | // <mrow> -- horizontally group any number of subexpressions |
michael@0 | 14 | // |
michael@0 | 15 | |
michael@0 | 16 | class nsMathMLmrowFrame : public nsMathMLContainerFrame { |
michael@0 | 17 | public: |
michael@0 | 18 | NS_DECL_FRAMEARENA_HELPERS |
michael@0 | 19 | |
michael@0 | 20 | friend nsIFrame* NS_NewMathMLmrowFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); |
michael@0 | 21 | |
michael@0 | 22 | virtual nsresult |
michael@0 | 23 | AttributeChanged(int32_t aNameSpaceID, |
michael@0 | 24 | nsIAtom* aAttribute, |
michael@0 | 25 | int32_t aModType) MOZ_OVERRIDE; |
michael@0 | 26 | |
michael@0 | 27 | NS_IMETHOD |
michael@0 | 28 | InheritAutomaticData(nsIFrame* aParent) MOZ_OVERRIDE; |
michael@0 | 29 | |
michael@0 | 30 | NS_IMETHOD |
michael@0 | 31 | TransmitAutomaticData() MOZ_OVERRIDE { |
michael@0 | 32 | return TransmitAutomaticDataForMrowLikeElement(); |
michael@0 | 33 | } |
michael@0 | 34 | |
michael@0 | 35 | virtual eMathMLFrameType |
michael@0 | 36 | GetMathMLFrameType() MOZ_OVERRIDE; |
michael@0 | 37 | |
michael@0 | 38 | bool |
michael@0 | 39 | IsMrowLike() MOZ_OVERRIDE { |
michael@0 | 40 | // <mrow> elements with a single child are treated identically to the case |
michael@0 | 41 | // where the child wasn't within an mrow, so we pretend the mrow isn't an |
michael@0 | 42 | // mrow in that situation. |
michael@0 | 43 | return mFrames.FirstChild() != mFrames.LastChild() || |
michael@0 | 44 | !mFrames.FirstChild(); |
michael@0 | 45 | } |
michael@0 | 46 | |
michael@0 | 47 | protected: |
michael@0 | 48 | nsMathMLmrowFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {} |
michael@0 | 49 | virtual ~nsMathMLmrowFrame(); |
michael@0 | 50 | }; |
michael@0 | 51 | |
michael@0 | 52 | #endif /* nsMathMLmrowFrame_h___ */ |