2007-06-11 23:10:23 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 12:12:37 +01: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 "nsCOMPtr.h"
|
|
|
|
#include "nsFrame.h"
|
2003-02-22 00:32:13 +00:00
|
|
|
#include "nsStyleContext.h"
|
1999-09-21 02:12:01 +00:00
|
|
|
#include "nsStyleConsts.h"
|
|
|
|
|
|
|
|
#include "nsMathMLmrowFrame.h"
|
|
|
|
|
|
|
|
//
|
|
|
|
// <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 17:49:24 +01: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
|
|
|
|
2010-01-03 18:52:33 +01:00
|
|
|
if (mContent->Tag() == nsGkAtoms::mrow_) {
|
|
|
|
// see if the directionality attribute is there
|
|
|
|
nsMathMLFrame::FindAttrDirectionality(mContent, mPresentationData);
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
2006-09-19 04:43:14 +00:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsMathMLmrowFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|
|
|
nsIAtom* aAttribute,
|
|
|
|
PRInt32 aModType)
|
|
|
|
{
|
|
|
|
// 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 22:54:30 +02: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);
|
|
|
|
}
|