Backed out changeset 1d9301697aa0 (bug 1887752) for causing failures on browser_all_f...
[gecko.git] / layout / mathml / nsMathMLmsqrtFrame.h
blob43c2702c6c7011fde60c7204607f99105301f228
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsMathMLmsqrtFrame_h___
8 #define nsMathMLmsqrtFrame_h___
10 #include "mozilla/Attributes.h"
11 #include "nsMathMLmencloseFrame.h"
13 namespace mozilla {
14 class PresShell;
15 } // namespace mozilla
18 // <msqrt> -- form a radical
22 The MathML REC describes:
24 The <msqrt> element is used to display square roots.
25 The syntax for <msqrt> is:
26 <msqrt> base </msqrt>
28 Attributes of <msqrt> and <mroot>:
30 None (except the attributes allowed for all MathML elements, listed in Section
31 2.3.4).
33 The <mroot> element increments scriptlevel by 2, and sets displaystyle to
34 "false", within index, but leaves both attributes unchanged within base. The
35 <msqrt> element leaves both attributes unchanged within all its arguments.
36 These attributes are inherited by every element from its rendering environment,
37 but can be set explicitly only on <mstyle>. (See Section 3.3.4.)
40 // XXXfredw: This class should share its layout logic with nsMathMLmrootFrame
41 // when the menclose "radical" notation is removed.
42 // See https://bugzilla.mozilla.org/show_bug.cgi?id=1548522
43 class nsMathMLmsqrtFrame final : public nsMathMLmencloseFrame {
44 public:
45 NS_DECL_FRAMEARENA_HELPERS(nsMathMLmsqrtFrame)
47 friend nsIFrame* NS_NewMathMLmsqrtFrame(mozilla::PresShell* aPresShell,
48 ComputedStyle* aStyle);
50 virtual void Init(nsIContent* aContent, nsContainerFrame* aParent,
51 nsIFrame* aPrevInFlow) override;
53 NS_IMETHOD
54 InheritAutomaticData(nsIFrame* aParent) override;
56 virtual nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
57 int32_t aModType) override;
59 virtual bool IsMrowLike() override {
60 return mFrames.FirstChild() != mFrames.LastChild() || !mFrames.FirstChild();
63 protected:
64 explicit nsMathMLmsqrtFrame(ComputedStyle* aStyle,
65 nsPresContext* aPresContext);
66 virtual ~nsMathMLmsqrtFrame();
69 #endif /* nsMathMLmsqrtFrame_h___ */