2017-10-27 20:33:53 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-09-21 06:12:01 +04:00
|
|
|
|
|
|
|
#ifndef nsMathMLmunderoverFrame_h___
|
|
|
|
#define nsMathMLmunderoverFrame_h___
|
|
|
|
|
2012-09-14 20:10:08 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2017-05-02 23:42:26 +03:00
|
|
|
#include "nsIReflowCallback.h"
|
1999-09-21 06:12:01 +04:00
|
|
|
#include "nsMathMLContainerFrame.h"
|
|
|
|
|
2019-04-16 10:24:49 +03:00
|
|
|
namespace mozilla {
|
|
|
|
class PresShell;
|
|
|
|
} // namespace mozilla
|
|
|
|
|
1999-09-21 06:12:01 +04:00
|
|
|
//
|
|
|
|
// <munderover> -- attach an underscript-overscript pair to a base
|
|
|
|
//
|
|
|
|
|
2017-05-02 23:42:26 +03:00
|
|
|
class nsMathMLmunderoverFrame final : public nsMathMLContainerFrame,
|
|
|
|
public nsIReflowCallback {
|
1999-09-21 06:12:01 +04:00
|
|
|
public:
|
2017-05-26 13:11:11 +03:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS(nsMathMLmunderoverFrame)
|
2009-09-12 20:49:24 +04:00
|
|
|
|
2019-04-16 10:24:49 +03:00
|
|
|
friend nsIFrame* NS_NewMathMLmunderoverFrame(mozilla::PresShell* aPresShell,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyle* aStyle);
|
1999-12-10 16:02:23 +03:00
|
|
|
|
2017-05-02 23:42:26 +03:00
|
|
|
nsresult Place(DrawTarget* aDrawTarget, bool aPlaceOrigin,
|
|
|
|
ReflowOutput& aDesiredSize) override;
|
|
|
|
|
|
|
|
NS_IMETHOD InheritAutomaticData(nsIFrame* aParent) override;
|
1999-12-10 16:02:23 +03:00
|
|
|
|
2017-05-02 23:42:26 +03:00
|
|
|
NS_IMETHOD TransmitAutomaticData() override;
|
2002-02-07 07:38:08 +03:00
|
|
|
|
2017-05-02 23:42:26 +03:00
|
|
|
NS_IMETHOD UpdatePresentationData(uint32_t aFlagsValues,
|
|
|
|
uint32_t aFlagsToUpdate) override;
|
1999-09-21 06:12:01 +04:00
|
|
|
|
2023-09-07 14:46:30 +03:00
|
|
|
void Destroy(DestroyContext&) override;
|
2002-01-05 04:06:05 +03:00
|
|
|
|
2017-05-02 23:42:26 +03:00
|
|
|
nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
|
|
|
|
int32_t aModType) override;
|
2002-02-07 07:38:08 +03:00
|
|
|
|
2017-05-02 23:42:26 +03:00
|
|
|
uint8_t ScriptIncrement(nsIFrame* aFrame) override;
|
|
|
|
|
|
|
|
// nsIReflowCallback.
|
|
|
|
bool ReflowFinished() override;
|
|
|
|
void ReflowCallbackCanceled() override;
|
2014-01-15 18:49:00 +04:00
|
|
|
|
1999-09-21 06:12:01 +04:00
|
|
|
protected:
|
2019-02-05 19:45:54 +03:00
|
|
|
explicit nsMathMLmunderoverFrame(ComputedStyle* aStyle,
|
|
|
|
nsPresContext* aPresContext)
|
|
|
|
: nsMathMLContainerFrame(aStyle, aPresContext, kClassID),
|
2017-05-02 23:42:26 +03:00
|
|
|
mIncrementUnder(false),
|
|
|
|
mIncrementOver(false) {}
|
|
|
|
|
1999-09-21 06:12:01 +04:00
|
|
|
virtual ~nsMathMLmunderoverFrame();
|
2014-01-15 18:49:00 +04:00
|
|
|
|
|
|
|
private:
|
2017-05-02 23:42:26 +03:00
|
|
|
// Helper to set the "increment script level" flag on the element belonging
|
|
|
|
// to a child frame given by aChildIndex.
|
|
|
|
//
|
|
|
|
// When this flag is set, the style system will increment the scriptlevel for
|
|
|
|
// the child element. This is needed for situations where the style system
|
|
|
|
// cannot itself determine the scriptlevel (mfrac, munder, mover, munderover).
|
|
|
|
//
|
|
|
|
// This should be called during reflow.
|
|
|
|
//
|
|
|
|
// We set the flag and if it changed, we request appropriate restyling and
|
|
|
|
// also queue a post-reflow callback to ensure that restyle and reflow happens
|
|
|
|
// immediately after the current reflow.
|
|
|
|
void SetIncrementScriptLevel(uint32_t aChildIndex, bool aIncrement);
|
|
|
|
void SetPendingPostReflowIncrementScriptLevel();
|
|
|
|
|
2014-01-15 18:49:00 +04:00
|
|
|
bool mIncrementUnder;
|
|
|
|
bool mIncrementOver;
|
2017-05-02 23:42:26 +03:00
|
|
|
|
|
|
|
struct SetIncrementScriptLevelCommand {
|
|
|
|
uint32_t mChildIndex;
|
|
|
|
bool mDoIncrement;
|
|
|
|
};
|
|
|
|
|
|
|
|
nsTArray<SetIncrementScriptLevelCommand>
|
|
|
|
mPostReflowIncrementScriptLevelCommands;
|
1999-09-21 06:12:01 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsMathMLmunderoverFrame_h___ */
|