/src/mozilla-central/layout/mathml/nsMathMLmunderoverFrame.h
Line | Count | Source (jump to first uncovered line) |
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 nsMathMLmunderoverFrame_h___ |
8 | | #define nsMathMLmunderoverFrame_h___ |
9 | | |
10 | | #include "mozilla/Attributes.h" |
11 | | #include "nsIReflowCallback.h" |
12 | | #include "nsMathMLContainerFrame.h" |
13 | | |
14 | | // |
15 | | // <munderover> -- attach an underscript-overscript pair to a base |
16 | | // |
17 | | |
18 | | class nsMathMLmunderoverFrame final |
19 | | : public nsMathMLContainerFrame |
20 | | , public nsIReflowCallback |
21 | | { |
22 | | |
23 | | public: |
24 | | NS_DECL_FRAMEARENA_HELPERS(nsMathMLmunderoverFrame) |
25 | | |
26 | | friend nsIFrame* NS_NewMathMLmunderoverFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle); |
27 | | |
28 | | nsresult Place(DrawTarget* aDrawTarget, |
29 | | bool aPlaceOrigin, |
30 | | ReflowOutput& aDesiredSize) override; |
31 | | |
32 | | NS_IMETHOD InheritAutomaticData(nsIFrame* aParent) override; |
33 | | |
34 | | NS_IMETHOD TransmitAutomaticData() override; |
35 | | |
36 | | NS_IMETHOD UpdatePresentationData(uint32_t aFlagsValues, |
37 | | uint32_t aFlagsToUpdate) override; |
38 | | |
39 | | void DestroyFrom(nsIFrame* aRoot, PostDestroyData& aPostDestroyData) override; |
40 | | |
41 | | nsresult AttributeChanged(int32_t aNameSpaceID, |
42 | | nsAtom* aAttribute, |
43 | | int32_t aModType) override; |
44 | | |
45 | | uint8_t ScriptIncrement(nsIFrame* aFrame) override; |
46 | | |
47 | | // nsIReflowCallback. |
48 | | bool ReflowFinished() override; |
49 | | void ReflowCallbackCanceled() override; |
50 | | |
51 | | protected: |
52 | | explicit nsMathMLmunderoverFrame(ComputedStyle* aStyle) |
53 | | : nsMathMLContainerFrame(aStyle, kClassID) |
54 | | , mIncrementUnder(false) |
55 | | , mIncrementOver(false) |
56 | 0 | {} |
57 | | |
58 | | virtual ~nsMathMLmunderoverFrame(); |
59 | | |
60 | | private: |
61 | | // Helper to set the "increment script level" flag on the element belonging |
62 | | // to a child frame given by aChildIndex. |
63 | | // |
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). |
67 | | // |
68 | | // This should be called during reflow. |
69 | | // |
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(); |
75 | | |
76 | | bool mIncrementUnder; |
77 | | bool mIncrementOver; |
78 | | |
79 | | struct SetIncrementScriptLevelCommand |
80 | | { |
81 | | uint32_t mChildIndex; |
82 | | bool mDoIncrement; |
83 | | }; |
84 | | |
85 | | nsTArray<SetIncrementScriptLevelCommand> |
86 | | mPostReflowIncrementScriptLevelCommands; |
87 | | }; |
88 | | |
89 | | |
90 | | #endif /* nsMathMLmunderoverFrame_h___ */ |