RenderMathMLToken.h [plain text]
#pragma once
#if ENABLE(MATHML)
#include "RenderMathMLBlock.h"
namespace WebCore {
class MathMLTokenElement;
class RenderMathMLToken : public RenderMathMLBlock {
WTF_MAKE_ISO_ALLOCATED(RenderMathMLToken);
public:
RenderMathMLToken(MathMLTokenElement&, RenderStyle&&);
RenderMathMLToken(Document&, RenderStyle&&);
MathMLTokenElement& element();
virtual void updateTokenContent();
void updateFromElement() override;
protected:
void paint(PaintInfo&, const LayoutPoint&) override;
void paintChildren(PaintInfo& forSelf, const LayoutPoint&, PaintInfo& forChild, bool usePrintRect) override;
std::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();
}
std::optional<UChar32> m_mathVariantCodePoint { std::nullopt };
bool m_mathVariantIsMirrored { false };
bool m_mathVariantGlyphDirty { false };
};
}
SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderMathMLToken, isRenderMathMLToken())
#endif // ENABLE(MATHML)