2017-10-27 20:33:53 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
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"
|
|
|
|
|
2019-04-16 10:24:49 +03:00
|
|
|
namespace mozilla {
|
|
|
|
class PresShell;
|
|
|
|
} // namespace mozilla
|
|
|
|
|
1999-09-21 06:12:01 +04:00
|
|
|
//
|
2017-07-06 15:00:35 +03:00
|
|
|
// <mpadded> -- adjust space around content
|
1999-09-21 06:12:01 +04:00
|
|
|
//
|
|
|
|
|
2018-09-06 04:23:14 +03:00
|
|
|
class nsMathMLmpaddedFrame final : public nsMathMLContainerFrame {
|
1999-09-21 06:12:01 +04:00
|
|
|
public:
|
2017-05-26 13:11:11 +03:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS(nsMathMLmpaddedFrame)
|
2009-09-12 20:49:24 +04:00
|
|
|
|
2019-04-16 10:24:49 +03:00
|
|
|
friend nsIFrame* NS_NewMathMLmpaddedFrame(mozilla::PresShell* aPresShell,
|
2018-03-22 21:20:41 +03:00
|
|
|
ComputedStyle* aStyle);
|
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();
|
|
|
|
}
|
|
|
|
|
2004-08-01 03:15:21 +04:00
|
|
|
virtual void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
|
2016-07-21 13:36:39 +03:00
|
|
|
const ReflowInput& aReflowInput,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsReflowStatus& aStatus) override;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2015-12-16 00:56:41 +03:00
|
|
|
virtual nsresult Place(DrawTarget* aDrawTarget, bool aPlaceOrigin,
|
2016-07-21 13:36:38 +03:00
|
|
|
ReflowOutput& aDesiredSize) override;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
bool 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:
|
2019-02-05 19:45:54 +03:00
|
|
|
explicit nsMathMLmpaddedFrame(ComputedStyle* aStyle,
|
|
|
|
nsPresContext* aPresContext)
|
|
|
|
: nsMathMLContainerFrame(aStyle, aPresContext, kClassID),
|
2016-12-01 11:06:50 +03:00
|
|
|
mWidthSign(0),
|
|
|
|
mHeightSign(0),
|
|
|
|
mDepthSign(0),
|
|
|
|
mLeadingSpaceSign(0),
|
|
|
|
mVerticalOffsetSign(0),
|
|
|
|
mWidthPseudoUnit(0),
|
|
|
|
mHeightPseudoUnit(0),
|
|
|
|
mDepthPseudoUnit(0),
|
|
|
|
mLeadingSpacePseudoUnit(0),
|
|
|
|
mVerticalOffsetPseudoUnit(0) {}
|
|
|
|
|
1999-09-21 06:12:01 +04:00
|
|
|
virtual ~nsMathMLmpaddedFrame();
|
2015-12-16 00:56:41 +03:00
|
|
|
|
|
|
|
virtual nsresult MeasureForWidth(DrawTarget* aDrawTarget,
|
2016-07-21 13:36:38 +03:00
|
|
|
ReflowOutput& 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
|
2005-02-07 04:57:50 +03:00
|
|
|
void ProcessAttributes();
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2000-01-27 15:35:30 +03:00
|
|
|
static bool ParseAttribute(nsString& aString, int32_t& aSign,
|
|
|
|
nsCSSValue& aCSSValue, int32_t& aPseudoUnit);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
void UpdateValue(int32_t aSign, int32_t aPseudoUnit,
|
2008-01-03 07:33:21 +03:00
|
|
|
const nsCSSValue& aCSSValue,
|
2016-07-21 13:36:38 +03:00
|
|
|
const ReflowOutput& aDesiredSize, nscoord& aValueToUpdate,
|
2014-10-25 10:29:00 +04:00
|
|
|
float aFontSizeInflation) const;
|
1999-09-21 06:12:01 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsMathMLmpaddedFrame_h___ */
|