michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsMathMLmrowFrame.h" michael@0: #include "mozilla/gfx/2D.h" michael@0: michael@0: // michael@0: // -- horizontally group any number of subexpressions - implementation michael@0: // michael@0: michael@0: nsIFrame* michael@0: NS_NewMathMLmrowFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) michael@0: { michael@0: return new (aPresShell) nsMathMLmrowFrame(aContext); michael@0: } michael@0: michael@0: NS_IMPL_FRAMEARENA_HELPERS(nsMathMLmrowFrame) michael@0: michael@0: nsMathMLmrowFrame::~nsMathMLmrowFrame() michael@0: { michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: nsMathMLmrowFrame::InheritAutomaticData(nsIFrame* aParent) michael@0: { michael@0: // let the base class get the default from our parent michael@0: nsMathMLContainerFrame::InheritAutomaticData(aParent); michael@0: michael@0: mPresentationData.flags |= NS_MATHML_STRETCH_ALL_CHILDREN_VERTICALLY; michael@0: michael@0: return NS_OK; michael@0: } michael@0: michael@0: nsresult michael@0: nsMathMLmrowFrame::AttributeChanged(int32_t aNameSpaceID, michael@0: nsIAtom* aAttribute, michael@0: int32_t aModType) michael@0: { michael@0: // Special for : In the frame construction code, we also use michael@0: // this frame class as a wrapper for mtable. Hence, we should pass the michael@0: // notification to the real mtable michael@0: if (mContent->Tag() == nsGkAtoms::mtable_) { michael@0: nsIFrame* frame = mFrames.FirstChild(); michael@0: for ( ; frame; frame = frame->GetFirstPrincipalChild()) { michael@0: // drill down to the real mtable michael@0: if (frame->GetType() == nsGkAtoms::tableOuterFrame) michael@0: return frame->AttributeChanged(aNameSpaceID, aAttribute, aModType); michael@0: } michael@0: NS_NOTREACHED("mtable wrapper without the real table frame"); michael@0: } michael@0: michael@0: return nsMathMLContainerFrame::AttributeChanged(aNameSpaceID, aAttribute, aModType); michael@0: } michael@0: michael@0: /* virtual */ eMathMLFrameType michael@0: nsMathMLmrowFrame::GetMathMLFrameType() michael@0: { michael@0: if (!IsMrowLike()) { michael@0: nsIMathMLFrame* child = do_QueryFrame(mFrames.FirstChild()); michael@0: if (child) { michael@0: // We only have one child, so we return the frame type of that child as if michael@0: // we didn't exist. michael@0: return child->GetMathMLFrameType(); michael@0: } michael@0: } michael@0: return nsMathMLFrame::GetMathMLFrameType(); michael@0: }