nsMathMLmrowFrame.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 nsMathMLmrowFrame_h___
  6. #define nsMathMLmrowFrame_h___
  7. #include "mozilla/Attributes.h"
  8. #include "nsMathMLContainerFrame.h"
  9. //
  10. // <mrow> -- horizontally group any number of subexpressions
  11. // <mphantom> -- make content invisible but preserve its size
  12. // <mstyle> -- make style changes that affect the rendering of its contents
  13. //
  14. class nsMathMLmrowFrame : public nsMathMLContainerFrame {
  15. public:
  16. NS_DECL_FRAMEARENA_HELPERS
  17. friend nsIFrame* NS_NewMathMLmrowFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
  18. virtual nsresult
  19. AttributeChanged(int32_t aNameSpaceID,
  20. nsIAtom* aAttribute,
  21. int32_t aModType) override;
  22. NS_IMETHOD
  23. InheritAutomaticData(nsIFrame* aParent) override;
  24. NS_IMETHOD
  25. TransmitAutomaticData() override {
  26. return TransmitAutomaticDataForMrowLikeElement();
  27. }
  28. virtual eMathMLFrameType
  29. GetMathMLFrameType() override;
  30. bool
  31. IsMrowLike() override {
  32. // <mrow> elements with a single child are treated identically to the case
  33. // where the child wasn't within an mrow, so we pretend the mrow isn't an
  34. // mrow in that situation.
  35. return mFrames.FirstChild() != mFrames.LastChild() ||
  36. !mFrames.FirstChild();
  37. }
  38. protected:
  39. explicit nsMathMLmrowFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
  40. virtual ~nsMathMLmrowFrame();
  41. };
  42. #endif /* nsMathMLmrowFrame_h___ */