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 nsMathMLmunderoverFrame_h___
8 #define nsMathMLmunderoverFrame_h___
10 #include "mozilla/Attributes.h"
11 #include "nsIReflowCallback.h"
12 #include "nsMathMLContainerFrame.h"
16 } // namespace mozilla
19 // <munderover> -- attach an underscript-overscript pair to a base
22 class nsMathMLmunderoverFrame final
: public nsMathMLContainerFrame
,
23 public nsIReflowCallback
{
25 NS_DECL_FRAMEARENA_HELPERS(nsMathMLmunderoverFrame
)
27 friend nsIFrame
* NS_NewMathMLmunderoverFrame(mozilla::PresShell
* aPresShell
,
28 ComputedStyle
* aStyle
);
30 nsresult
Place(DrawTarget
* aDrawTarget
, bool aPlaceOrigin
,
31 ReflowOutput
& aDesiredSize
) override
;
33 NS_IMETHOD
InheritAutomaticData(nsIFrame
* aParent
) override
;
35 NS_IMETHOD
TransmitAutomaticData() override
;
37 NS_IMETHOD
UpdatePresentationData(uint32_t aFlagsValues
,
38 uint32_t aFlagsToUpdate
) override
;
40 void DestroyFrom(nsIFrame
* aRoot
, PostDestroyData
& aPostDestroyData
) override
;
42 nsresult
AttributeChanged(int32_t aNameSpaceID
, nsAtom
* aAttribute
,
43 int32_t aModType
) override
;
45 uint8_t ScriptIncrement(nsIFrame
* aFrame
) override
;
48 bool ReflowFinished() override
;
49 void ReflowCallbackCanceled() override
;
52 explicit nsMathMLmunderoverFrame(ComputedStyle
* aStyle
,
53 nsPresContext
* aPresContext
)
54 : nsMathMLContainerFrame(aStyle
, aPresContext
, kClassID
),
55 mIncrementUnder(false),
56 mIncrementOver(false) {}
58 virtual ~nsMathMLmunderoverFrame();
61 // Helper to set the "increment script level" flag on the element belonging
62 // to a child frame given by aChildIndex.
64 // When this flag is set, the style system will increment the scriptlevel for
65 // the child element. This is needed for situations where the style system
66 // cannot itself determine the scriptlevel (mfrac, munder, mover, munderover).
68 // This should be called during reflow.
70 // We set the flag and if it changed, we request appropriate restyling and
71 // also queue a post-reflow callback to ensure that restyle and reflow happens
72 // immediately after the current reflow.
73 void SetIncrementScriptLevel(uint32_t aChildIndex
, bool aIncrement
);
74 void SetPendingPostReflowIncrementScriptLevel();
79 struct SetIncrementScriptLevelCommand
{
84 nsTArray
<SetIncrementScriptLevelCommand
>
85 mPostReflowIncrementScriptLevelCommands
;
88 #endif /* nsMathMLmunderoverFrame_h___ */