2017-10-27 17:33:53 +00: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 11:12:37 +00: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 02:12:01 +00:00
|
|
|
|
2002-08-16 21:36:31 +00:00
|
|
|
#ifndef nsMathMLTokenFrame_h___
|
|
|
|
#define nsMathMLTokenFrame_h___
|
1999-09-21 02:12:01 +00:00
|
|
|
|
2012-09-14 16:10:08 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
1999-09-21 02:12:01 +00:00
|
|
|
#include "nsMathMLContainerFrame.h"
|
|
|
|
|
2019-04-16 07:24:49 +00:00
|
|
|
namespace mozilla {
|
|
|
|
class PresShell;
|
|
|
|
} // namespace mozilla
|
|
|
|
|
1999-09-21 02:12:01 +00:00
|
|
|
//
|
2002-08-16 21:36:31 +00:00
|
|
|
// Base class to handle token elements
|
1999-09-21 02:12:01 +00:00
|
|
|
//
|
|
|
|
|
2002-08-16 21:36:31 +00:00
|
|
|
class nsMathMLTokenFrame : public nsMathMLContainerFrame {
|
1999-09-21 02:12:01 +00:00
|
|
|
public:
|
2017-05-26 10:11:11 +00:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS(nsMathMLTokenFrame)
|
2009-09-12 16:49:24 +00:00
|
|
|
|
2019-04-16 07:24:49 +00:00
|
|
|
friend nsIFrame* NS_NewMathMLTokenFrame(mozilla::PresShell* aPresShell,
|
2018-03-22 18:20:41 +00:00
|
|
|
ComputedStyle* aStyle);
|
1999-09-21 02:12:01 +00:00
|
|
|
|
2011-03-25 03:38:59 +00:00
|
|
|
NS_IMETHOD
|
2015-03-21 16:28:04 +00:00
|
|
|
TransmitAutomaticData() override {
|
2011-03-25 03:38:59 +00:00
|
|
|
// The REC defines the following elements to be space-like:
|
|
|
|
// * an mtext, mspace, maligngroup, or malignmark element;
|
2015-03-03 11:09:00 +00:00
|
|
|
if (mContent->IsMathMLElement(nsGkAtoms::mtext_)) {
|
2011-03-25 03:38:59 +00:00
|
|
|
mPresentationData.flags |= NS_MATHML_SPACE_LIKE;
|
|
|
|
}
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2011-05-12 21:37:03 +00:00
|
|
|
NS_IMETHOD
|
2015-03-21 16:28:04 +00:00
|
|
|
InheritAutomaticData(nsIFrame* aParent) override;
|
2011-05-12 21:37:03 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual eMathMLFrameType GetMathMLFrameType() override;
|
2002-08-16 21:36:31 +00:00
|
|
|
|
2011-08-24 20:54:30 +00:00
|
|
|
virtual void SetInitialChildList(ChildListID aListID,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsFrameList& aChildList) override;
|
2000-01-07 14:49:46 +00:00
|
|
|
|
2012-08-31 01:32:02 +00:00
|
|
|
virtual void AppendFrames(ChildListID aListID,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsFrameList& aChildList) override;
|
2012-08-31 01:32:02 +00:00
|
|
|
|
|
|
|
virtual void InsertFrames(ChildListID aListID, nsIFrame* aPrevFrame,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsFrameList& aChildList) override;
|
2012-08-31 01:32:02 +00:00
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
virtual void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
|
2016-07-21 10:36:39 +00:00
|
|
|
const ReflowInput& aReflowInput,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsReflowStatus& aStatus) override;
|
2000-01-07 14:49:46 +00:00
|
|
|
|
2015-12-15 21:56:41 +00:00
|
|
|
virtual nsresult Place(DrawTarget* aDrawTarget, bool aPlaceOrigin,
|
2016-07-21 10:36:38 +00:00
|
|
|
ReflowOutput& aDesiredSize) override;
|
2000-01-07 14:49:46 +00:00
|
|
|
|
1999-09-21 02:12:01 +00:00
|
|
|
protected:
|
2019-02-05 16:45:54 +00:00
|
|
|
explicit nsMathMLTokenFrame(ComputedStyle* aStyle,
|
|
|
|
nsPresContext* aPresContext,
|
|
|
|
ClassID aID = kClassID)
|
|
|
|
: nsMathMLContainerFrame(aStyle, aPresContext, aID) {}
|
2002-08-16 21:36:31 +00:00
|
|
|
virtual ~nsMathMLTokenFrame();
|
2002-02-07 04:38:08 +00:00
|
|
|
|
2013-09-30 15:55:51 +00:00
|
|
|
void MarkTextFramesAsTokenMathML();
|
1999-09-21 02:12:01 +00:00
|
|
|
};
|
|
|
|
|
2002-08-16 21:36:31 +00:00
|
|
|
#endif /* nsMathMLTokentFrame_h___ */
|