nsMathMLmsqrtFrame.cpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. #include "nsMathMLmsqrtFrame.h"
  6. #include "mozilla/gfx/2D.h"
  7. //
  8. // <msqrt> -- form a radical - implementation
  9. //
  10. nsIFrame*
  11. NS_NewMathMLmsqrtFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
  12. {
  13. return new (aPresShell) nsMathMLmsqrtFrame(aContext);
  14. }
  15. NS_IMPL_FRAMEARENA_HELPERS(nsMathMLmsqrtFrame)
  16. nsMathMLmsqrtFrame::nsMathMLmsqrtFrame(nsStyleContext* aContext) :
  17. nsMathMLmencloseFrame(aContext)
  18. {
  19. }
  20. nsMathMLmsqrtFrame::~nsMathMLmsqrtFrame()
  21. {
  22. }
  23. void
  24. nsMathMLmsqrtFrame::Init(nsIContent* aContent,
  25. nsContainerFrame* aParent,
  26. nsIFrame* aPrevInFlow)
  27. {
  28. nsMathMLContainerFrame::Init(aContent, aParent, aPrevInFlow);
  29. AllocateMathMLChar(NOTATION_RADICAL);
  30. mNotationsToDraw |= NOTATION_RADICAL;
  31. }
  32. NS_IMETHODIMP
  33. nsMathMLmsqrtFrame::InheritAutomaticData(nsIFrame* aParent)
  34. {
  35. nsMathMLContainerFrame::InheritAutomaticData(aParent);
  36. mPresentationData.flags |= NS_MATHML_STRETCH_ALL_CHILDREN_VERTICALLY;
  37. return NS_OK;
  38. }
  39. nsresult
  40. nsMathMLmsqrtFrame::AttributeChanged(int32_t aNameSpaceID,
  41. nsIAtom* aAttribute,
  42. int32_t aModType)
  43. {
  44. return nsMathMLContainerFrame::
  45. AttributeChanged(aNameSpaceID, aAttribute, aModType);
  46. }