Coverage Report

Created: 2018-09-25 14:53

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