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
|
|
|
|
2002-08-17 01:36:31 +04:00
|
|
|
#ifndef nsMathMLTokenFrame_h___
|
|
|
|
#define nsMathMLTokenFrame_h___
|
1999-09-21 06:12:01 +04:00
|
|
|
|
2012-09-14 20:10:08 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
1999-09-21 06:12:01 +04:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsMathMLContainerFrame.h"
|
|
|
|
|
|
|
|
//
|
2002-08-17 01:36:31 +04:00
|
|
|
// Base class to handle token elements
|
1999-09-21 06:12:01 +04:00
|
|
|
//
|
|
|
|
|
2002-08-17 01:36:31 +04:00
|
|
|
class nsMathMLTokenFrame : public nsMathMLContainerFrame {
|
1999-09-21 06:12:01 +04:00
|
|
|
public:
|
2009-09-12 20:49:24 +04:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
|
|
|
|
2006-03-27 01:30:36 +04:00
|
|
|
friend nsIFrame* NS_NewMathMLTokenFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
1999-09-21 06:12:01 +04:00
|
|
|
|
2011-03-25 06:38:59 +03:00
|
|
|
NS_IMETHOD
|
|
|
|
TransmitAutomaticData() {
|
|
|
|
// 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-13 01:37:03 +04:00
|
|
|
NS_IMETHOD
|
|
|
|
InheritAutomaticData(nsIFrame* aParent);
|
|
|
|
|
2006-08-15 08:49:43 +04:00
|
|
|
virtual eMathMLFrameType GetMathMLFrameType();
|
2002-08-17 01:36:31 +04:00
|
|
|
|
|
|
|
NS_IMETHOD
|
2011-08-25 00:54:30 +04:00
|
|
|
SetInitialChildList(ChildListID aListID,
|
2012-09-14 20:10:08 +04:00
|
|
|
nsFrameList& aChildList) MOZ_OVERRIDE;
|
2000-01-07 17:49:46 +03:00
|
|
|
|
2012-08-31 05:32:02 +04:00
|
|
|
NS_IMETHOD
|
|
|
|
AppendFrames(ChildListID aListID,
|
2012-09-14 20:10:08 +04:00
|
|
|
nsFrameList& aChildList) MOZ_OVERRIDE;
|
2012-08-31 05:32:02 +04:00
|
|
|
|
|
|
|
NS_IMETHOD
|
|
|
|
InsertFrames(ChildListID aListID,
|
|
|
|
nsIFrame* aPrevFrame,
|
2012-09-14 20:10:08 +04:00
|
|
|
nsFrameList& aChildList) MOZ_OVERRIDE;
|
2012-08-31 05:32:02 +04:00
|
|
|
|
2000-01-07 17:49:46 +03:00
|
|
|
NS_IMETHOD
|
2004-08-01 03:15:21 +04:00
|
|
|
Reflow(nsPresContext* aPresContext,
|
2000-01-07 17:49:46 +03:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
2012-09-14 20:10:08 +04:00
|
|
|
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
2000-01-07 17:49:46 +03:00
|
|
|
|
2008-03-18 07:52:48 +03:00
|
|
|
virtual nsresult
|
2011-04-08 05:04:40 +04:00
|
|
|
Place(nsRenderingContext& aRenderingContext,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aPlaceOrigin,
|
2012-09-14 20:10:08 +04:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize) MOZ_OVERRIDE;
|
2000-01-07 17:49:46 +03:00
|
|
|
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 08:38:33 +03:00
|
|
|
virtual void MarkIntrinsicWidthsDirty();
|
2002-02-07 07:38:08 +03:00
|
|
|
|
2006-09-25 04:08:41 +04:00
|
|
|
virtual nsresult
|
2012-09-14 20:10:08 +04:00
|
|
|
ChildListChanged(int32_t aModType) MOZ_OVERRIDE
|
2006-09-25 04:08:41 +04:00
|
|
|
{
|
2008-01-27 05:49:47 +03:00
|
|
|
ProcessTextData();
|
2006-09-25 04:08:41 +04:00
|
|
|
return nsMathMLContainerFrame::ChildListChanged(aModType);
|
|
|
|
}
|
|
|
|
|
1999-09-21 06:12:01 +04:00
|
|
|
protected:
|
2006-03-27 01:30:36 +04:00
|
|
|
nsMathMLTokenFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
|
2002-08-17 01:36:31 +04:00
|
|
|
virtual ~nsMathMLTokenFrame();
|
2002-02-07 07:38:08 +03:00
|
|
|
|
2002-08-17 01:36:31 +04:00
|
|
|
// hook to perform MathML-specific actions depending on the tag
|
2008-01-27 05:49:47 +03:00
|
|
|
virtual void ProcessTextData();
|
2002-08-17 01:36:31 +04:00
|
|
|
|
|
|
|
// helper to set the style of <mi> which has to be italic or normal
|
|
|
|
// depending on its textual content
|
2011-09-29 10:19:26 +04:00
|
|
|
bool SetTextStyle();
|
2002-08-17 01:36:31 +04:00
|
|
|
|
2012-08-31 05:32:02 +04:00
|
|
|
void ForceTrimChildTextFrames();
|
1999-09-21 06:12:01 +04:00
|
|
|
};
|
|
|
|
|
2002-08-17 01:36:31 +04:00
|
|
|
#endif /* nsMathMLTokentFrame_h___ */
|