2007-06-12 06:10:23 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00: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 02:12:01 +00:00
|
|
|
|
|
|
|
#include "nsMathMLmrowFrame.h"
|
2013-10-07 23:15:59 +00:00
|
|
|
#include "mozilla/gfx/2D.h"
|
1999-09-21 02:12:01 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// <mrow> -- horizontally group any number of subexpressions - implementation
|
|
|
|
//
|
|
|
|
|
2005-11-11 02:36:29 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewMathMLmrowFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
|
1999-09-21 02:12:01 +00:00
|
|
|
{
|
2006-03-26 21:30:36 +00:00
|
|
|
return new (aPresShell) nsMathMLmrowFrame(aContext);
|
1999-09-21 02:12:01 +00:00
|
|
|
}
|
|
|
|
|
2009-09-12 16:49:24 +00:00
|
|
|
NS_IMPL_FRAMEARENA_HELPERS(nsMathMLmrowFrame)
|
|
|
|
|
1999-09-21 02:12:01 +00:00
|
|
|
nsMathMLmrowFrame::~nsMathMLmrowFrame()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2005-02-07 01:57:50 +00:00
|
|
|
nsMathMLmrowFrame::InheritAutomaticData(nsIFrame* aParent)
|
1999-09-21 02:12:01 +00:00
|
|
|
{
|
2002-02-07 04:38:08 +00:00
|
|
|
// let the base class get the default from our parent
|
2005-02-07 01:57:50 +00:00
|
|
|
nsMathMLContainerFrame::InheritAutomaticData(aParent);
|
2002-02-01 15:10:50 +00:00
|
|
|
|
2002-02-07 04:38:08 +00:00
|
|
|
mPresentationData.flags |= NS_MATHML_STRETCH_ALL_CHILDREN_VERTICALLY;
|
2002-02-01 15:10:50 +00:00
|
|
|
|
|
|
|
return NS_OK;
|
1999-09-21 02:12:01 +00:00
|
|
|
}
|
2006-08-14 07:27:42 +00:00
|
|
|
|
2014-02-18 07:47:48 +00:00
|
|
|
nsresult
|
2012-08-22 15:56:38 +00:00
|
|
|
nsMathMLmrowFrame::AttributeChanged(int32_t aNameSpaceID,
|
2006-09-19 04:43:14 +00:00
|
|
|
nsIAtom* aAttribute,
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t aModType)
|
2006-09-19 04:43:14 +00: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
|
2006-12-26 17:47:52 +00:00
|
|
|
if (mContent->Tag() == nsGkAtoms::mtable_) {
|
2006-09-19 04:43:14 +00:00
|
|
|
nsIFrame* frame = mFrames.FirstChild();
|
2011-08-24 20:54:30 +00:00
|
|
|
for ( ; frame; frame = frame->GetFirstPrincipalChild()) {
|
2006-09-19 04:43:14 +00:00
|
|
|
// drill down to the real mtable
|
2006-12-26 17:47:52 +00:00
|
|
|
if (frame->GetType() == nsGkAtoms::tableOuterFrame)
|
2006-09-19 04:43:14 +00: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 04:56:00 +00: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();
|
|
|
|
}
|