layout/mathml/nsMathMLmsqrtFrame.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/mathml/nsMathMLmsqrtFrame.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,68 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef nsMathMLmsqrtFrame_h___
    1.10 +#define nsMathMLmsqrtFrame_h___
    1.11 +
    1.12 +#include "mozilla/Attributes.h"
    1.13 +#include "nsMathMLmencloseFrame.h"
    1.14 +
    1.15 +//
    1.16 +// <msqrt> -- form a radical
    1.17 +//
    1.18 +
    1.19 +/*
    1.20 +The MathML REC describes:
    1.21 +
    1.22 +The <msqrt> element is used to display square roots.
    1.23 +The syntax for <msqrt> is:
    1.24 +  <msqrt> base </msqrt>
    1.25 +
    1.26 +Attributes of <msqrt> and <mroot>:
    1.27 +
    1.28 +None (except the attributes allowed for all MathML elements, listed in Section
    1.29 +2.3.4). 
    1.30 +
    1.31 +The <mroot> element increments scriptlevel by 2, and sets displaystyle to
    1.32 +"false", within index, but leaves both attributes unchanged within base. The
    1.33 +<msqrt> element leaves both attributes unchanged within all its arguments.
    1.34 +These attributes are inherited by every element from its rendering environment,
    1.35 +but can be set explicitly only on <mstyle>. (See Section 3.3.4.) 
    1.36 +*/
    1.37 +
    1.38 +class nsMathMLmsqrtFrame : public nsMathMLmencloseFrame {
    1.39 +public:
    1.40 +  NS_DECL_FRAMEARENA_HELPERS
    1.41 +
    1.42 +  friend nsIFrame* NS_NewMathMLmsqrtFrame(nsIPresShell*   aPresShell,
    1.43 +                                          nsStyleContext* aContext);
    1.44 +
    1.45 +  virtual void
    1.46 +  Init(nsIContent* aContent,
    1.47 +       nsIFrame*   aParent,
    1.48 +       nsIFrame*   aPrevInFlow) MOZ_OVERRIDE;
    1.49 +
    1.50 +  NS_IMETHOD
    1.51 +  InheritAutomaticData(nsIFrame* aParent) MOZ_OVERRIDE;
    1.52 +
    1.53 +  virtual nsresult
    1.54 +  AttributeChanged(int32_t         aNameSpaceID,
    1.55 +                   nsIAtom*        aAttribute,
    1.56 +                   int32_t         aModType) MOZ_OVERRIDE;
    1.57 +
    1.58 +  virtual bool
    1.59 +  IsMrowLike() MOZ_OVERRIDE
    1.60 +  {
    1.61 +    return mFrames.FirstChild() != mFrames.LastChild() ||
    1.62 +           !mFrames.FirstChild();
    1.63 +  }
    1.64 +
    1.65 +protected:
    1.66 +  nsMathMLmsqrtFrame(nsStyleContext* aContext);
    1.67 +  virtual ~nsMathMLmsqrtFrame();
    1.68 +};
    1.69 +
    1.70 +#endif /* nsMathMLmsqrtFrame_h___ */
    1.71 +

mercurial