layout/mathml/nsMathMLmsqrtFrame.h

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

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

mercurial