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-11-17 01:40:04 +00:00
|
|
|
|
|
|
|
#include "nsMathMLmsqrtFrame.h"
|
2013-10-07 23:15:59 +00:00
|
|
|
#include "mozilla/gfx/2D.h"
|
1999-11-17 01:40:04 +00:00
|
|
|
|
|
|
|
//
|
2009-05-29 11:08:35 +00:00
|
|
|
// <msqrt> -- form a radical - implementation
|
1999-11-17 01:40:04 +00:00
|
|
|
//
|
|
|
|
|
2000-04-17 04:23:03 +00:00
|
|
|
//NOTE:
|
|
|
|
// The code assumes that TeX fonts are picked.
|
2002-02-07 04:38:08 +00:00
|
|
|
// There is no fall-back to draw the branches of the sqrt explicitly
|
|
|
|
// in the case where TeX fonts are not there. In general, there are no
|
2000-04-17 04:23:03 +00:00
|
|
|
// fall-back(s) in MathML when some (freely-downloadable) fonts are missing.
|
|
|
|
// Otherwise, this will add much work and unnecessary complexity to the core
|
|
|
|
// MathML engine. Assuming that authors have the free fonts is part of the
|
|
|
|
// deal. We are not responsible for cases of misconfigurations out there.
|
2000-03-28 09:38:24 +00:00
|
|
|
|
2005-11-11 02:36:29 +00:00
|
|
|
nsIFrame*
|
2006-03-26 21:30:36 +00:00
|
|
|
NS_NewMathMLmsqrtFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
|
1999-11-17 01:40:04 +00:00
|
|
|
{
|
2006-03-26 21:30:36 +00:00
|
|
|
return new (aPresShell) nsMathMLmsqrtFrame(aContext);
|
1999-11-17 01:40:04 +00:00
|
|
|
}
|
|
|
|
|
2009-09-12 16:49:24 +00:00
|
|
|
NS_IMPL_FRAMEARENA_HELPERS(nsMathMLmsqrtFrame)
|
|
|
|
|
2006-03-26 21:30:36 +00:00
|
|
|
nsMathMLmsqrtFrame::nsMathMLmsqrtFrame(nsStyleContext* aContext) :
|
2009-05-29 11:08:35 +00:00
|
|
|
nsMathMLmencloseFrame(aContext)
|
1999-11-17 01:40:04 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
nsMathMLmsqrtFrame::~nsMathMLmsqrtFrame()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-03-20 01:47:48 +00:00
|
|
|
void
|
2006-03-09 18:55:21 +00:00
|
|
|
nsMathMLmsqrtFrame::Init(nsIContent* aContent,
|
1999-11-17 01:40:04 +00:00
|
|
|
nsIFrame* aParent,
|
|
|
|
nsIFrame* aPrevInFlow)
|
|
|
|
{
|
2013-03-20 01:47:48 +00:00
|
|
|
nsMathMLContainerFrame::Init(aContent, aParent, aPrevInFlow);
|
2009-05-29 11:08:35 +00:00
|
|
|
AllocateMathMLChar(NOTATION_RADICAL);
|
|
|
|
mNotationsToDraw |= NOTATION_RADICAL;
|
1999-11-17 01:40:04 +00:00
|
|
|
}
|
|
|
|
|
2011-05-12 21:31:34 +00:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsMathMLmsqrtFrame::InheritAutomaticData(nsIFrame* aParent)
|
|
|
|
{
|
|
|
|
nsMathMLContainerFrame::InheritAutomaticData(aParent);
|
|
|
|
|
|
|
|
mPresentationData.flags |= NS_MATHML_STRETCH_ALL_CHILDREN_VERTICALLY;
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2014-02-18 07:47:48 +00:00
|
|
|
nsresult
|
2012-08-22 15:56:38 +00:00
|
|
|
nsMathMLmsqrtFrame::AttributeChanged(int32_t aNameSpaceID,
|
2009-05-29 11:08:35 +00:00
|
|
|
nsIAtom* aAttribute,
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t aModType)
|
2000-03-28 09:38:24 +00:00
|
|
|
{
|
2009-05-29 11:08:35 +00:00
|
|
|
return nsMathMLContainerFrame::
|
|
|
|
AttributeChanged(aNameSpaceID, aAttribute, aModType);
|
2000-03-28 09:38:24 +00:00
|
|
|
}
|