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 nsMathMLmrootFrame_h___
7 : #define nsMathMLmrootFrame_h___
8 :
9 : #include "mozilla/Attributes.h"
10 : #include "nsMathMLContainerFrame.h"
11 : #include "nsMathMLChar.h"
12 :
13 : //
14 : // <msqrt> and <mroot> -- form a radical
15 : //
16 :
17 : class nsMathMLmrootFrame : public nsMathMLContainerFrame {
18 : public:
19 0 : NS_DECL_FRAMEARENA_HELPERS(nsMathMLmrootFrame)
20 :
21 : friend nsIFrame* NS_NewMathMLmrootFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
22 :
23 : virtual void
24 : SetAdditionalStyleContext(int32_t aIndex,
25 : nsStyleContext* aStyleContext) override;
26 : virtual nsStyleContext*
27 : GetAdditionalStyleContext(int32_t aIndex) const override;
28 :
29 : virtual void
30 : Init(nsIContent* aContent,
31 : nsContainerFrame* aParent,
32 : nsIFrame* aPrevInFlow) override;
33 :
34 : NS_IMETHOD
35 : TransmitAutomaticData() override;
36 :
37 : virtual void
38 : Reflow(nsPresContext* aPresContext,
39 : ReflowOutput& aDesiredSize,
40 : const ReflowInput& aReflowInput,
41 : nsReflowStatus& aStatus) override;
42 :
43 : void
44 : GetRadicalXOffsets(nscoord aIndexWidth, nscoord aSqrWidth,
45 : nsFontMetrics* aFontMetrics,
46 : nscoord* aIndexOffset,
47 : nscoord* aSqrOffset);
48 :
49 : virtual void
50 : GetIntrinsicISizeMetrics(gfxContext* aRenderingContext,
51 : ReflowOutput& aDesiredSize) override;
52 :
53 : virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
54 : const nsRect& aDirtyRect,
55 : const nsDisplayListSet& aLists) override;
56 :
57 : uint8_t
58 0 : ScriptIncrement(nsIFrame* aFrame) override
59 : {
60 0 : return (aFrame && aFrame == mFrames.LastChild()) ? 2 : 0;
61 : }
62 :
63 : protected:
64 : explicit nsMathMLmrootFrame(nsStyleContext* aContext);
65 : virtual ~nsMathMLmrootFrame();
66 :
67 : nsMathMLChar mSqrChar;
68 : nsRect mBarRect;
69 : };
70 :
71 : #endif /* nsMathMLmrootFrame_h___ */
|