2 * Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
14 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
15 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
16 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 #ifndef RenderMathMLRoot_h
27 #define RenderMathMLRoot_h
31 #include "RenderMathMLBlock.h"
35 // Render base^(1/index), or sqrt(base) via the derived class RenderMathMLSquareRoot, using radical notation.
36 class RenderMathMLRoot : public RenderMathMLBlock {
38 RenderMathMLRoot(Element&, PassRef<RenderStyle>);
39 RenderMathMLRoot(Document&, PassRef<RenderStyle>);
41 virtual LayoutUnit paddingTop() const override;
42 virtual LayoutUnit paddingBottom() const override;
43 virtual LayoutUnit paddingLeft() const override;
44 virtual LayoutUnit paddingRight() const override;
45 virtual LayoutUnit paddingBefore() const override;
46 virtual LayoutUnit paddingAfter() const override;
47 virtual LayoutUnit paddingStart() const override;
48 virtual LayoutUnit paddingEnd() const override;
50 virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0) override;
53 virtual void layout() override;
55 virtual void paint(PaintInfo&, const LayoutPoint&) override;
58 virtual bool isRenderMathMLRoot() const override final { return true; }
59 virtual const char* renderName() const override { return "RenderMathMLRoot"; }
61 // This may return 0 for a non-MathML index (which won't occur in valid MathML).
62 RenderBox* index() const;
64 int m_intrinsicPaddingBefore;
65 int m_intrinsicPaddingAfter;
66 int m_intrinsicPaddingStart;
67 int m_intrinsicPaddingEnd;
68 int m_overbarLeftPointShift;
74 #endif // ENABLE(MATHML)
76 #endif // RenderMathMLRoot_h