2007-06-11 23:10:23 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07: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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifndef nsMathMLTokenFrame_h___
|
|
|
|
#define nsMathMLTokenFrame_h___
|
|
|
|
|
2012-09-14 09:10:08 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsMathMLContainerFrame.h"
|
|
|
|
|
|
|
|
//
|
|
|
|
// Base class to handle token elements
|
|
|
|
//
|
|
|
|
|
|
|
|
class nsMathMLTokenFrame : public nsMathMLContainerFrame {
|
|
|
|
public:
|
2009-09-12 09:49:24 -07:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
friend nsIFrame* NS_NewMathMLTokenFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
|
2011-03-24 20:38:59 -07:00
|
|
|
NS_IMETHOD
|
2013-05-14 09:33:23 -07:00
|
|
|
TransmitAutomaticData() MOZ_OVERRIDE {
|
2011-03-24 20:38:59 -07:00
|
|
|
// The REC defines the following elements to be space-like:
|
|
|
|
// * an mtext, mspace, maligngroup, or malignmark element;
|
|
|
|
if (mContent->Tag() == nsGkAtoms::mtext_) {
|
|
|
|
mPresentationData.flags |= NS_MATHML_SPACE_LIKE;
|
|
|
|
}
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2011-05-12 14:37:03 -07:00
|
|
|
NS_IMETHOD
|
2013-05-14 09:33:23 -07:00
|
|
|
InheritAutomaticData(nsIFrame* aParent) MOZ_OVERRIDE;
|
2011-05-12 14:37:03 -07:00
|
|
|
|
2013-05-14 09:33:23 -07:00
|
|
|
virtual eMathMLFrameType GetMathMLFrameType() MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
NS_IMETHOD
|
2011-08-24 13:54:30 -07:00
|
|
|
SetInitialChildList(ChildListID aListID,
|
2012-09-14 09:10:08 -07:00
|
|
|
nsFrameList& aChildList) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-08-30 18:32:02 -07:00
|
|
|
NS_IMETHOD
|
|
|
|
AppendFrames(ChildListID aListID,
|
2012-09-14 09:10:08 -07:00
|
|
|
nsFrameList& aChildList) MOZ_OVERRIDE;
|
2012-08-30 18:32:02 -07:00
|
|
|
|
|
|
|
NS_IMETHOD
|
|
|
|
InsertFrames(ChildListID aListID,
|
|
|
|
nsIFrame* aPrevFrame,
|
2012-09-14 09:10:08 -07:00
|
|
|
nsFrameList& aChildList) MOZ_OVERRIDE;
|
2012-08-30 18:32:02 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD
|
|
|
|
Reflow(nsPresContext* aPresContext,
|
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
2012-09-14 09:10:08 -07:00
|
|
|
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-03-17 21:52:48 -07:00
|
|
|
virtual nsresult
|
2011-04-07 18:04:40 -07:00
|
|
|
Place(nsRenderingContext& aRenderingContext,
|
2011-09-28 23:19:26 -07:00
|
|
|
bool aPlaceOrigin,
|
2012-09-14 09:10:08 -07:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize) MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-05-14 09:33:23 -07:00
|
|
|
virtual void MarkIntrinsicWidthsDirty() MOZ_OVERRIDE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
virtual nsresult
|
2012-09-14 09:10:08 -07:00
|
|
|
ChildListChanged(int32_t aModType) MOZ_OVERRIDE
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2008-01-26 18:49:47 -08:00
|
|
|
ProcessTextData();
|
2007-03-22 10:30:00 -07:00
|
|
|
return nsMathMLContainerFrame::ChildListChanged(aModType);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
nsMathMLTokenFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
|
|
|
|
virtual ~nsMathMLTokenFrame();
|
|
|
|
|
|
|
|
// hook to perform MathML-specific actions depending on the tag
|
2008-01-26 18:49:47 -08:00
|
|
|
virtual void ProcessTextData();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// helper to set the style of <mi> which has to be italic or normal
|
|
|
|
// depending on its textual content
|
2011-09-28 23:19:26 -07:00
|
|
|
bool SetTextStyle();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-09-30 08:55:51 -07:00
|
|
|
void MarkTextFramesAsTokenMathML();
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsMathMLTokentFrame_h___ */
|