1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsMathMLmpaddedFrame_h___
7 #define nsMathMLmpaddedFrame_h___
9 #include "mozilla/Attributes.h"
10 #include "nsMathMLContainerFrame.h"
13 // <mpadded> -- adjust space around content
16 class nsMathMLmpaddedFrame
: public nsMathMLContainerFrame
{
18 NS_DECL_FRAMEARENA_HELPERS
20 friend nsIFrame
* NS_NewMathMLmpaddedFrame(nsIPresShell
* aPresShell
, nsStyleContext
* aContext
);
23 InheritAutomaticData(nsIFrame
* aParent
) MOZ_OVERRIDE
;
26 TransmitAutomaticData() MOZ_OVERRIDE
{
27 return TransmitAutomaticDataForMrowLikeElement();
31 Reflow(nsPresContext
* aPresContext
,
32 nsHTMLReflowMetrics
& aDesiredSize
,
33 const nsHTMLReflowState
& aReflowState
,
34 nsReflowStatus
& aStatus
) MOZ_OVERRIDE
;
37 Place(nsRenderingContext
& aRenderingContext
,
39 nsHTMLReflowMetrics
& aDesiredSize
) MOZ_OVERRIDE
;
42 IsMrowLike() MOZ_OVERRIDE
{
43 return mFrames
.FirstChild() != mFrames
.LastChild() ||
44 !mFrames
.FirstChild();
48 explicit nsMathMLmpaddedFrame(nsStyleContext
* aContext
) : nsMathMLContainerFrame(aContext
) {}
49 virtual ~nsMathMLmpaddedFrame();
52 MeasureForWidth(nsRenderingContext
& aRenderingContext
,
53 nsHTMLReflowMetrics
& aDesiredSize
) MOZ_OVERRIDE
;
59 nsCSSValue mLeadingSpace
;
60 nsCSSValue mVerticalOffset
;
65 int32_t mLeadingSpaceSign
;
66 int32_t mVerticalOffsetSign
;
68 int32_t mWidthPseudoUnit
;
69 int32_t mHeightPseudoUnit
;
70 int32_t mDepthPseudoUnit
;
71 int32_t mLeadingSpacePseudoUnit
;
72 int32_t mVerticalOffsetPseudoUnit
;
74 // helpers to process the attributes
79 ParseAttribute(nsString
& aString
,
81 nsCSSValue
& aCSSValue
,
82 int32_t& aPseudoUnit
);
85 UpdateValue(int32_t aSign
,
87 const nsCSSValue
& aCSSValue
,
88 const nsHTMLReflowMetrics
& aDesiredSize
,
89 nscoord
& aValueToUpdate
,
90 float aFontSizeInflation
) const;
93 #endif /* nsMathMLmpaddedFrame_h___ */