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 nsMathMLmrootFrame_h___
8 #define nsMathMLmrootFrame_h___
10 #include "mozilla/Attributes.h"
11 #include "nsMathMLContainerFrame.h"
12 #include "nsMathMLChar.h"
16 } // namespace mozilla
19 // <msqrt> and <mroot> -- form a radical
22 class nsMathMLmrootFrame final
: public nsMathMLContainerFrame
{
24 NS_DECL_FRAMEARENA_HELPERS(nsMathMLmrootFrame
)
26 friend nsIFrame
* NS_NewMathMLmrootFrame(mozilla::PresShell
* aPresShell
,
27 ComputedStyle
* aStyle
);
29 void DidSetComputedStyle(ComputedStyle
* aOldStyle
) override
;
31 virtual void Init(nsIContent
* aContent
, nsContainerFrame
* aParent
,
32 nsIFrame
* aPrevInFlow
) override
;
35 TransmitAutomaticData() override
;
37 virtual void Reflow(nsPresContext
* aPresContext
, ReflowOutput
& aDesiredSize
,
38 const ReflowInput
& aReflowInput
,
39 nsReflowStatus
& aStatus
) override
;
41 void GetRadicalXOffsets(nscoord aIndexWidth
, nscoord aSqrWidth
,
42 nsFontMetrics
* aFontMetrics
, nscoord
* aIndexOffset
,
45 virtual void GetIntrinsicISizeMetrics(gfxContext
* aRenderingContext
,
46 ReflowOutput
& aDesiredSize
) override
;
48 virtual void BuildDisplayList(nsDisplayListBuilder
* aBuilder
,
49 const nsDisplayListSet
& aLists
) override
;
51 uint8_t ScriptIncrement(nsIFrame
* aFrame
) override
{
52 return (aFrame
&& aFrame
== mFrames
.LastChild()) ? 2 : 0;
56 explicit nsMathMLmrootFrame(ComputedStyle
* aStyle
,
57 nsPresContext
* aPresContext
);
58 virtual ~nsMathMLmrootFrame();
60 nsMathMLChar mSqrChar
;
64 bool ShouldUseRowFallback();
67 #endif /* nsMathMLmrootFrame_h___ */