RenderMathMLRoot.h [plain text]
#pragma once
#if ENABLE(MATHML)
#include "MathOperator.h"
#include "RenderMathMLRow.h"
namespace WebCore {
class MathMLRootElement;
enum class RootType { SquareRoot, RootWithIndex };
class RenderMathMLRoot final : public RenderMathMLRow {
WTF_MAKE_ISO_ALLOCATED(RenderMathMLRoot);
public:
RenderMathMLRoot(MathMLRootElement&, RenderStyle&&);
void updateStyle();
private:
bool isValid() const;
RenderBox& getBase() const;
RenderBox& getIndex() const;
bool isRenderMathMLRoot() const final { return true; }
const char* renderName() const final { return "RenderMathMLRoot"; }
MathMLRootElement& element() const;
RootType rootType() const;
void styleDidChange(StyleDifference, const RenderStyle* oldStyle) final;
void computePreferredLogicalWidths() final;
void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0) final;
void paint(PaintInfo&, const LayoutPoint&) final;
struct HorizontalParameters {
LayoutUnit kernBeforeDegree;
LayoutUnit kernAfterDegree;
};
HorizontalParameters horizontalParameters();
struct VerticalParameters {
LayoutUnit verticalGap;
LayoutUnit ruleThickness;
LayoutUnit extraAscender;
float degreeBottomRaisePercent;
};
VerticalParameters verticalParameters();
MathOperator m_radicalOperator;
LayoutUnit m_radicalOperatorTop;
LayoutUnit m_baseWidth;
bool isRenderMathMLSquareRoot() const final { return rootType() == RootType::SquareRoot; }
};
}
SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderMathMLRoot, isRenderMathMLRoot())
#endif // ENABLE(MATHML)