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
|
|
|
|
|
|
|
#include "nsMathMLmrowFrame.h"
|
2013-10-08 03:15:59 +04:00
|
|
|
#include "mozilla/gfx/2D.h"
|
1999-09-21 06:12:01 +04:00
|
|
|
|
|
|
|
//
|
|
|
|
// <mrow> -- horizontally group any number of subexpressions - implementation
|
|
|
|
//
|
|
|
|
|
2005-11-11 05:36:29 +03:00
|
|
|
nsIFrame*
|
2006-03-27 01:30:36 +04:00
|
|
|
NS_NewMathMLmrowFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
|
1999-09-21 06:12:01 +04:00
|
|
|
{
|
2006-03-27 01:30:36 +04:00
|
|
|
return new (aPresShell) nsMathMLmrowFrame(aContext);
|
1999-09-21 06:12:01 +04:00
|
|
|
}
|
|
|
|
|
2009-09-12 20:49:24 +04:00
|
|
|
NS_IMPL_FRAMEARENA_HELPERS(nsMathMLmrowFrame)
|
|
|
|
|
1999-09-21 06:12:01 +04:00
|
|
|
nsMathMLmrowFrame::~nsMathMLmrowFrame()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2005-02-07 04:57:50 +03:00
|
|
|
nsMathMLmrowFrame::InheritAutomaticData(nsIFrame* aParent)
|
1999-09-21 06:12:01 +04:00
|
|
|
{
|
2002-02-07 07:38:08 +03:00
|
|
|
// let the base class get the default from our parent
|
2005-02-07 04:57:50 +03:00
|
|
|
nsMathMLContainerFrame::InheritAutomaticData(aParent);
|
2002-02-01 18:10:50 +03:00
|
|
|
|
2002-02-07 07:38:08 +03:00
|
|
|
mPresentationData.flags |= NS_MATHML_STRETCH_ALL_CHILDREN_VERTICALLY;
|
2002-02-01 18:10:50 +03:00
|
|
|
|
|
|
|
return NS_OK;
|
1999-09-21 06:12:01 +04:00
|
|
|
}
|
2006-08-14 11:27:42 +04:00
|
|
|
|
2014-02-18 11:47:48 +04:00
|
|
|
nsresult
|
2012-08-22 19:56:38 +04:00
|
|
|
nsMathMLmrowFrame::AttributeChanged(int32_t aNameSpaceID,
|
2006-09-19 08:43:14 +04:00
|
|
|
nsIAtom* aAttribute,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aModType)
|
2006-09-19 08:43:14 +04:00
|
|
|
{
|
|
|
|
// Special for <mtable>: In the frame construction code, we also use
|
|
|
|
// this frame class as a wrapper for mtable. Hence, we should pass the
|
|
|
|
// notification to the real mtable
|
2015-03-03 14:09:00 +03:00
|
|
|
if (mContent->IsMathMLElement(nsGkAtoms::mtable_)) {
|
2006-09-19 08:43:14 +04:00
|
|
|
nsIFrame* frame = mFrames.FirstChild();
|
2016-01-29 17:42:14 +03:00
|
|
|
for ( ; frame; frame = frame->PrincipalChildList().FirstChild()) {
|
2006-09-19 08:43:14 +04:00
|
|
|
// drill down to the real mtable
|
2017-04-30 18:30:08 +03:00
|
|
|
if (frame->IsTableWrapperFrame())
|
2006-09-19 08:43:14 +04:00
|
|
|
return frame->AttributeChanged(aNameSpaceID, aAttribute, aModType);
|
|
|
|
}
|
|
|
|
NS_NOTREACHED("mtable wrapper without the real table frame");
|
|
|
|
}
|
|
|
|
|
|
|
|
return nsMathMLContainerFrame::AttributeChanged(aNameSpaceID, aAttribute, aModType);
|
|
|
|
}
|
2014-04-07 08:56:00 +04:00
|
|
|
|
|
|
|
/* virtual */ eMathMLFrameType
|
|
|
|
nsMathMLmrowFrame::GetMathMLFrameType()
|
|
|
|
{
|
|
|
|
if (!IsMrowLike()) {
|
|
|
|
nsIMathMLFrame* child = do_QueryFrame(mFrames.FirstChild());
|
|
|
|
if (child) {
|
|
|
|
// We only have one child, so we return the frame type of that child as if
|
|
|
|
// we didn't exist.
|
|
|
|
return child->GetMathMLFrameType();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nsMathMLFrame::GetMathMLFrameType();
|
|
|
|
}
|