RenderMathMLToken.h [plain text]
#pragma once
#if ENABLE(MATHML)
#include "MathMLTextElement.h"
#include "RenderMathMLBlock.h"
namespace WebCore {
class RenderMathMLToken : public RenderMathMLBlock {
public:
RenderMathMLToken(Element&, RenderStyle&&);
RenderMathMLToken(Document&, RenderStyle&&);
MathMLTextElement& element() { return static_cast<MathMLTextElement&>(nodeForNonAnonymous()); }
virtual void updateTokenContent();
void updateFromElement() override;
protected:
void paint(PaintInfo&, const LayoutPoint&) override;
void paintChildren(PaintInfo& forSelf, const LayoutPoint&, PaintInfo& forChild, bool usePrintRect) override;
Optional<int> firstLineBaseline() const override;
void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0) override;
void computePreferredLogicalWidths() override;
private:
bool isRenderMathMLToken() const final { return true; }
const char* renderName() const override { return "RenderMathMLToken"; }
bool isChildAllowed(const RenderObject&, const RenderStyle&) const final { return true; };
void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
void updateMathVariantGlyph();
void setMathVariantGlyphDirty()
{
m_mathVariantGlyphDirty = true;
setNeedsLayoutAndPrefWidthsRecalc();
}
GlyphData m_mathVariantGlyph;
bool m_mathVariantGlyphDirty;
};
}
SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderMathMLToken, isRenderMathMLToken())
#endif // ENABLE(MATHML)