nsMathMLmsqrtFrame.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef nsMathMLmsqrtFrame_h___
  6. #define nsMathMLmsqrtFrame_h___
  7. #include "mozilla/Attributes.h"
  8. #include "nsMathMLmencloseFrame.h"
  9. //
  10. // <msqrt> -- form a radical
  11. //
  12. /*
  13. The MathML REC describes:
  14. The <msqrt> element is used to display square roots.
  15. The syntax for <msqrt> is:
  16. <msqrt> base </msqrt>
  17. Attributes of <msqrt> and <mroot>:
  18. None (except the attributes allowed for all MathML elements, listed in Section
  19. 2.3.4).
  20. The <mroot> element increments scriptlevel by 2, and sets displaystyle to
  21. "false", within index, but leaves both attributes unchanged within base. The
  22. <msqrt> element leaves both attributes unchanged within all its arguments.
  23. These attributes are inherited by every element from its rendering environment,
  24. but can be set explicitly only on <mstyle>. (See Section 3.3.4.)
  25. */
  26. class nsMathMLmsqrtFrame : public nsMathMLmencloseFrame {
  27. public:
  28. NS_DECL_FRAMEARENA_HELPERS
  29. friend nsIFrame* NS_NewMathMLmsqrtFrame(nsIPresShell* aPresShell,
  30. nsStyleContext* aContext);
  31. virtual void
  32. Init(nsIContent* aContent,
  33. nsContainerFrame* aParent,
  34. nsIFrame* aPrevInFlow) override;
  35. NS_IMETHOD
  36. InheritAutomaticData(nsIFrame* aParent) override;
  37. virtual nsresult
  38. AttributeChanged(int32_t aNameSpaceID,
  39. nsIAtom* aAttribute,
  40. int32_t aModType) override;
  41. virtual bool
  42. IsMrowLike() override
  43. {
  44. return mFrames.FirstChild() != mFrames.LastChild() ||
  45. !mFrames.FirstChild();
  46. }
  47. protected:
  48. explicit nsMathMLmsqrtFrame(nsStyleContext* aContext);
  49. virtual ~nsMathMLmsqrtFrame();
  50. };
  51. #endif /* nsMathMLmsqrtFrame_h___ */