2007-06-12 10:10:23 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
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"
|
|
|
|
|
|
|
|
//
|
|
|
|
// <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
|
|
|
|
2006-03-27 01:30:36 +04:00
|
|
|
friend nsIFrame* NS_NewMathMLmunderoverFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
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
|
|
|
|
2017-05-02 23:42:26 +03:00
|
|
|
void DestroyFrom(nsIFrame* aRoot) override;
|
2002-01-05 04:06:05 +03:00
|
|
|
|
2017-05-02 23:42:26 +03:00
|
|
|
nsresult AttributeChanged(int32_t aNameSpaceID,
|
|
|
|
nsIAtom* 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:
|
2017-05-02 23:42:26 +03:00
|
|
|
explicit nsMathMLmunderoverFrame(nsStyleContext* aContext)
|
2017-05-26 13:11:11 +03:00
|
|
|
: nsMathMLContainerFrame(aContext, 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___ */
|