nsMathMLmrootFrame.h (1971B)
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 nsMathMLmrootFrame_h___ 8 #define nsMathMLmrootFrame_h___ 9 10 #include "nsMathMLChar.h" 11 #include "nsMathMLContainerFrame.h" 12 13 namespace mozilla { 14 class PresShell; 15 } // namespace mozilla 16 17 // 18 // <msqrt> and <mroot> -- form a radical 19 // 20 21 class nsMathMLmrootFrame : public nsMathMLContainerFrame { 22 public: 23 NS_DECL_FRAMEARENA_HELPERS(nsMathMLmrootFrame) 24 25 friend nsIFrame* NS_NewMathMLmrootFrame(mozilla::PresShell* aPresShell, 26 ComputedStyle* aStyle); 27 28 void DidSetComputedStyle(ComputedStyle* aOldStyle) override; 29 30 void Init(nsIContent* aContent, nsContainerFrame* aParent, 31 nsIFrame* aPrevInFlow) override; 32 33 NS_IMETHOD 34 InheritAutomaticData(nsIFrame* aParent) final; 35 36 NS_IMETHOD 37 TransmitAutomaticData() override; 38 39 void GetRadicalXOffsets(nscoord aIndexWidth, nscoord aSqrWidth, 40 nsFontMetrics* aFontMetrics, nscoord* aIndexOffset, 41 nscoord* aSqrOffset); 42 43 void BuildDisplayList(nsDisplayListBuilder* aBuilder, 44 const nsDisplayListSet& aLists) override; 45 46 uint8_t ScriptIncrement(nsIFrame* aFrame) override { 47 return (aFrame && aFrame == mFrames.LastChild()) ? 2 : 0; 48 } 49 50 protected: 51 explicit nsMathMLmrootFrame(ComputedStyle* aStyle, 52 nsPresContext* aPresContext); 53 virtual ~nsMathMLmrootFrame(); 54 55 nsMathMLChar mSqrChar; 56 nsRect mBarRect; 57 58 private: 59 bool ShouldUseRowFallback(); 60 bool IsMrowLike() final; 61 void Place(DrawTarget* aDrawTarget, const PlaceFlags& aFlags, 62 ReflowOutput& aDesiredSize) final; 63 }; 64 65 #endif /* nsMathMLmrootFrame_h___ */