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
|
|
|
|
|
|
|
#ifndef nsMathMLmpaddedFrame_h___
|
|
|
|
#define nsMathMLmpaddedFrame_h___
|
|
|
|
|
2012-09-14 20:10:08 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
1999-09-21 06:12:01 +04:00
|
|
|
#include "nsMathMLContainerFrame.h"
|
|
|
|
|
|
|
|
//
|
|
|
|
// <mpadded> -- adjust space around content
|
|
|
|
//
|
|
|
|
|
|
|
|
class nsMathMLmpaddedFrame : public nsMathMLContainerFrame {
|
|
|
|
public:
|
2009-09-12 20:49:24 +04:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
|
|
|
|
2006-03-27 01:30:36 +04:00
|
|
|
friend nsIFrame* NS_NewMathMLmpaddedFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
1999-09-21 06:12:01 +04:00
|
|
|
|
2002-02-01 18:10:50 +03:00
|
|
|
NS_IMETHOD
|
2015-03-21 19:28:04 +03:00
|
|
|
InheritAutomaticData(nsIFrame* aParent) override;
|
2002-02-01 18:10:50 +03:00
|
|
|
|
2011-03-25 06:38:59 +03:00
|
|
|
NS_IMETHOD
|
2015-03-21 19:28:04 +03:00
|
|
|
TransmitAutomaticData() override {
|
2011-03-25 06:38:59 +03:00
|
|
|
return TransmitAutomaticDataForMrowLikeElement();
|
|
|
|
}
|
|
|
|
|
2014-05-13 04:47:52 +04:00
|
|
|
virtual void
|
2004-08-01 03:15:21 +04:00
|
|
|
Reflow(nsPresContext* aPresContext,
|
2000-01-27 15:35:30 +03:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsReflowStatus& aStatus) override;
|
2000-01-27 15:35:30 +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,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize) override;
|
2007-12-29 02:04:19 +03:00
|
|
|
|
2014-04-04 19:54:00 +04:00
|
|
|
bool
|
2015-03-21 19:28:04 +03:00
|
|
|
IsMrowLike() override {
|
2014-04-04 19:54:00 +04:00
|
|
|
return mFrames.FirstChild() != mFrames.LastChild() ||
|
|
|
|
!mFrames.FirstChild();
|
|
|
|
}
|
|
|
|
|
1999-09-21 06:12:01 +04:00
|
|
|
protected:
|
2014-09-01 07:36:37 +04:00
|
|
|
explicit nsMathMLmpaddedFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
|
1999-09-21 06:12:01 +04:00
|
|
|
virtual ~nsMathMLmpaddedFrame();
|
|
|
|
|
2012-11-30 02:52:02 +04:00
|
|
|
virtual nsresult
|
|
|
|
MeasureForWidth(nsRenderingContext& aRenderingContext,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize) override;
|
2012-11-30 02:52:02 +04:00
|
|
|
|
2000-01-27 15:35:30 +03:00
|
|
|
private:
|
|
|
|
nsCSSValue mWidth;
|
|
|
|
nsCSSValue mHeight;
|
|
|
|
nsCSSValue mDepth;
|
2010-01-05 13:22:31 +03:00
|
|
|
nsCSSValue mLeadingSpace;
|
2011-07-03 11:54:01 +04:00
|
|
|
nsCSSValue mVerticalOffset;
|
2000-01-27 15:35:30 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t mWidthSign;
|
|
|
|
int32_t mHeightSign;
|
|
|
|
int32_t mDepthSign;
|
|
|
|
int32_t mLeadingSpaceSign;
|
|
|
|
int32_t mVerticalOffsetSign;
|
|
|
|
|
|
|
|
int32_t mWidthPseudoUnit;
|
|
|
|
int32_t mHeightPseudoUnit;
|
|
|
|
int32_t mDepthPseudoUnit;
|
|
|
|
int32_t mLeadingSpacePseudoUnit;
|
|
|
|
int32_t mVerticalOffsetPseudoUnit;
|
2000-01-27 15:35:30 +03:00
|
|
|
|
|
|
|
// helpers to process the attributes
|
2002-02-07 07:38:08 +03:00
|
|
|
void
|
2005-02-07 04:57:50 +03:00
|
|
|
ProcessAttributes();
|
2002-02-07 07:38:08 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
static bool
|
2000-01-27 15:35:30 +03:00
|
|
|
ParseAttribute(nsString& aString,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t& aSign,
|
2000-01-27 15:35:30 +03:00
|
|
|
nsCSSValue& aCSSValue,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t& aPseudoUnit);
|
2000-01-27 15:35:30 +03:00
|
|
|
|
2007-12-29 02:04:19 +03:00
|
|
|
void
|
2012-08-22 19:56:38 +04:00
|
|
|
UpdateValue(int32_t aSign,
|
|
|
|
int32_t aPseudoUnit,
|
2008-01-03 07:33:21 +03:00
|
|
|
const nsCSSValue& aCSSValue,
|
2013-11-19 18:08:30 +04:00
|
|
|
const nsHTMLReflowMetrics& aDesiredSize,
|
2014-10-25 10:29:00 +04:00
|
|
|
nscoord& aValueToUpdate,
|
|
|
|
float aFontSizeInflation) const;
|
1999-09-21 06:12:01 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsMathMLmpaddedFrame_h___ */
|