Bumping manifests a=b2g-bump
[gecko.git] / layout / mathml / nsMathMLmpaddedFrame.h
blobfa10a3908f9aa51462389470893323ca828f5497
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 {
17 public:
18 NS_DECL_FRAMEARENA_HELPERS
20 friend nsIFrame* NS_NewMathMLmpaddedFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
22 NS_IMETHOD
23 InheritAutomaticData(nsIFrame* aParent) MOZ_OVERRIDE;
25 NS_IMETHOD
26 TransmitAutomaticData() MOZ_OVERRIDE {
27 return TransmitAutomaticDataForMrowLikeElement();
30 virtual void
31 Reflow(nsPresContext* aPresContext,
32 nsHTMLReflowMetrics& aDesiredSize,
33 const nsHTMLReflowState& aReflowState,
34 nsReflowStatus& aStatus) MOZ_OVERRIDE;
36 virtual nsresult
37 Place(nsRenderingContext& aRenderingContext,
38 bool aPlaceOrigin,
39 nsHTMLReflowMetrics& aDesiredSize) MOZ_OVERRIDE;
41 bool
42 IsMrowLike() MOZ_OVERRIDE {
43 return mFrames.FirstChild() != mFrames.LastChild() ||
44 !mFrames.FirstChild();
47 protected:
48 explicit nsMathMLmpaddedFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
49 virtual ~nsMathMLmpaddedFrame();
51 virtual nsresult
52 MeasureForWidth(nsRenderingContext& aRenderingContext,
53 nsHTMLReflowMetrics& aDesiredSize) MOZ_OVERRIDE;
55 private:
56 nsCSSValue mWidth;
57 nsCSSValue mHeight;
58 nsCSSValue mDepth;
59 nsCSSValue mLeadingSpace;
60 nsCSSValue mVerticalOffset;
62 int32_t mWidthSign;
63 int32_t mHeightSign;
64 int32_t mDepthSign;
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
75 void
76 ProcessAttributes();
78 static bool
79 ParseAttribute(nsString& aString,
80 int32_t& aSign,
81 nsCSSValue& aCSSValue,
82 int32_t& aPseudoUnit);
84 void
85 UpdateValue(int32_t aSign,
86 int32_t aPseudoUnit,
87 const nsCSSValue& aCSSValue,
88 const nsHTMLReflowMetrics& aDesiredSize,
89 nscoord& aValueToUpdate,
90 float aFontSizeInflation) const;
93 #endif /* nsMathMLmpaddedFrame_h___ */