nsMathMLTokenFrame.h 2.0 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 nsMathMLTokenFrame_h___
  6. #define nsMathMLTokenFrame_h___
  7. #include "mozilla/Attributes.h"
  8. #include "nsMathMLContainerFrame.h"
  9. //
  10. // Base class to handle token elements
  11. //
  12. class nsMathMLTokenFrame : public nsMathMLContainerFrame {
  13. public:
  14. NS_DECL_FRAMEARENA_HELPERS
  15. friend nsIFrame* NS_NewMathMLTokenFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
  16. NS_IMETHOD
  17. TransmitAutomaticData() override {
  18. // The REC defines the following elements to be space-like:
  19. // * an mtext, mspace, maligngroup, or malignmark element;
  20. if (mContent->IsMathMLElement(nsGkAtoms::mtext_)) {
  21. mPresentationData.flags |= NS_MATHML_SPACE_LIKE;
  22. }
  23. return NS_OK;
  24. }
  25. NS_IMETHOD
  26. InheritAutomaticData(nsIFrame* aParent) override;
  27. virtual eMathMLFrameType GetMathMLFrameType() override;
  28. virtual void
  29. SetInitialChildList(ChildListID aListID,
  30. nsFrameList& aChildList) override;
  31. virtual void
  32. AppendFrames(ChildListID aListID,
  33. nsFrameList& aChildList) override;
  34. virtual void
  35. InsertFrames(ChildListID aListID,
  36. nsIFrame* aPrevFrame,
  37. nsFrameList& aChildList) override;
  38. virtual void
  39. Reflow(nsPresContext* aPresContext,
  40. ReflowOutput& aDesiredSize,
  41. const ReflowInput& aReflowInput,
  42. nsReflowStatus& aStatus) override;
  43. virtual nsresult
  44. Place(DrawTarget* aDrawTarget,
  45. bool aPlaceOrigin,
  46. ReflowOutput& aDesiredSize) override;
  47. protected:
  48. explicit nsMathMLTokenFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
  49. virtual ~nsMathMLTokenFrame();
  50. void MarkTextFramesAsTokenMathML();
  51. };
  52. #endif /* nsMathMLTokentFrame_h___ */