1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/mathml/nsMathMLTokenFrame.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,68 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef nsMathMLTokenFrame_h___ 1.10 +#define nsMathMLTokenFrame_h___ 1.11 + 1.12 +#include "mozilla/Attributes.h" 1.13 +#include "nsMathMLContainerFrame.h" 1.14 + 1.15 +// 1.16 +// Base class to handle token elements 1.17 +// 1.18 + 1.19 +class nsMathMLTokenFrame : public nsMathMLContainerFrame { 1.20 +public: 1.21 + NS_DECL_FRAMEARENA_HELPERS 1.22 + 1.23 + friend nsIFrame* NS_NewMathMLTokenFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); 1.24 + 1.25 + NS_IMETHOD 1.26 + TransmitAutomaticData() MOZ_OVERRIDE { 1.27 + // The REC defines the following elements to be space-like: 1.28 + // * an mtext, mspace, maligngroup, or malignmark element; 1.29 + if (mContent->Tag() == nsGkAtoms::mtext_) { 1.30 + mPresentationData.flags |= NS_MATHML_SPACE_LIKE; 1.31 + } 1.32 + return NS_OK; 1.33 + } 1.34 + 1.35 + NS_IMETHOD 1.36 + InheritAutomaticData(nsIFrame* aParent) MOZ_OVERRIDE; 1.37 + 1.38 + virtual eMathMLFrameType GetMathMLFrameType() MOZ_OVERRIDE; 1.39 + 1.40 + virtual nsresult 1.41 + SetInitialChildList(ChildListID aListID, 1.42 + nsFrameList& aChildList) MOZ_OVERRIDE; 1.43 + 1.44 + virtual nsresult 1.45 + AppendFrames(ChildListID aListID, 1.46 + nsFrameList& aChildList) MOZ_OVERRIDE; 1.47 + 1.48 + virtual nsresult 1.49 + InsertFrames(ChildListID aListID, 1.50 + nsIFrame* aPrevFrame, 1.51 + nsFrameList& aChildList) MOZ_OVERRIDE; 1.52 + 1.53 + virtual nsresult 1.54 + Reflow(nsPresContext* aPresContext, 1.55 + nsHTMLReflowMetrics& aDesiredSize, 1.56 + const nsHTMLReflowState& aReflowState, 1.57 + nsReflowStatus& aStatus) MOZ_OVERRIDE; 1.58 + 1.59 + virtual nsresult 1.60 + Place(nsRenderingContext& aRenderingContext, 1.61 + bool aPlaceOrigin, 1.62 + nsHTMLReflowMetrics& aDesiredSize) MOZ_OVERRIDE; 1.63 + 1.64 +protected: 1.65 + nsMathMLTokenFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {} 1.66 + virtual ~nsMathMLTokenFrame(); 1.67 + 1.68 + void MarkTextFramesAsTokenMathML(); 1.69 +}; 1.70 + 1.71 +#endif /* nsMathMLTokentFrame_h___ */