2017-10-27 20:33:53 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
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"
|
2019-04-16 10:24:49 +03:00
|
|
|
|
|
|
|
#include "mozilla/PresShell.h"
|
2013-10-08 03:15:59 +04:00
|
|
|
#include "mozilla/gfx/2D.h"
|
1999-09-21 06:12:01 +04:00
|
|
|
|
2018-11-13 01:20:52 +03:00
|
|
|
using namespace mozilla;
|
|
|
|
|
1999-09-21 06:12:01 +04:00
|
|
|
//
|
|
|
|
// <mrow> -- horizontally group any number of subexpressions - implementation
|
|
|
|
//
|
|
|
|
|
2019-04-16 10:24:49 +03:00
|
|
|
nsIFrame* NS_NewMathMLmrowFrame(PresShell* aPresShell, ComputedStyle* aStyle) {
|
2019-02-05 19:45:54 +03:00
|
|
|
return new (aPresShell)
|
|
|
|
nsMathMLmrowFrame(aStyle, aPresShell->GetPresContext());
|
1999-09-21 06:12:01 +04:00
|
|
|
}
|
|
|
|
|
2009-09-12 20:49:24 +04:00
|
|
|
NS_IMPL_FRAMEARENA_HELPERS(nsMathMLmrowFrame)
|
|
|
|
|
2020-03-17 12:38:32 +03:00
|
|
|
nsMathMLmrowFrame::~nsMathMLmrowFrame() = default;
|
1999-09-21 06:12:01 +04:00
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2005-02-07 04:57:50 +03:00
|
|
|
nsMathMLmrowFrame::InheritAutomaticData(nsIFrame* aParent) {
|
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
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
nsresult nsMathMLmrowFrame::AttributeChanged(int32_t aNameSpaceID,
|
2017-10-03 01:05:19 +03:00
|
|
|
nsAtom* 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);
|
|
|
|
}
|
2018-06-18 08:43:11 +03:00
|
|
|
MOZ_ASSERT_UNREACHABLE("mtable wrapper without the real table frame");
|
2006-09-19 08:43:14 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return nsMathMLContainerFrame::AttributeChanged(aNameSpaceID, aAttribute,
|
|
|
|
aModType);
|
|
|
|
}
|
2014-04-07 08:56:00 +04:00
|
|
|
|
2019-02-26 01:09:24 +03:00
|
|
|
/* virtual */
|
|
|
|
eMathMLFrameType nsMathMLmrowFrame::GetMathMLFrameType() {
|
2014-04-07 08:56:00 +04:00
|
|
|
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();
|
|
|
|
}
|