RenderMathMLScripts.h [plain text]
#ifndef RenderMathMLScripts_h
#define RenderMathMLScripts_h
#if ENABLE(MATHML)
#include "RenderMathMLBlock.h"
namespace WebCore {
class RenderMathMLScripts;
class RenderMathMLScriptsWrapper : public RenderMathMLBlock {
friend class RenderMathMLScripts;
public:
enum WrapperType { Base, SubSupPair };
virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0) override;
virtual RenderObject* removeChild(RenderObject&) override;
private:
RenderMathMLScriptsWrapper(Document& document, PassRef<RenderStyle> style, WrapperType kind)
: RenderMathMLBlock(document, WTF::move(style))
, m_kind(kind)
{
}
static RenderMathMLScriptsWrapper* createAnonymousWrapper(RenderMathMLScripts* renderObject, WrapperType);
void addChildInternal(bool normalInsertion, RenderObject* child, RenderObject* beforeChild = 0);
RenderObject* removeChildInternal(bool normalRemoval, RenderObject& child);
virtual const char* renderName() const override { return m_kind == Base ? "Base Wrapper" : "SubSupPair Wrapper"; }
virtual bool isRenderMathMLScriptsWrapper() const override final { return true; }
RenderMathMLScripts* parentMathMLScripts();
WrapperType m_kind;
};
RENDER_OBJECT_TYPE_CASTS(RenderMathMLScriptsWrapper, isRenderMathMLScriptsWrapper())
class RenderMathMLScripts : public RenderMathMLBlock {
friend class RenderMathMLScriptsWrapper;
public:
RenderMathMLScripts(Element&, PassRef<RenderStyle>);
virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0) override;
virtual RenderObject* removeChild(RenderObject&) override;
virtual RenderMathMLOperator* unembellishedOperator();
virtual int firstLineBaseline() const override;
protected:
virtual void layout();
private:
void addChildInternal(bool normalInsertion, RenderObject* child, RenderObject* beforeChild = 0);
RenderObject* removeChildInternal(bool normalRemoval, RenderObject& child);
virtual bool isRenderMathMLScripts() const override final { return true; }
virtual const char* renderName() const override { return "RenderMathMLScripts"; }
void fixAnonymousStyleForSubSupPair(RenderObject* subSupPair, bool isPostScript);
void fixAnonymousStyles();
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
RenderBoxModelObject* base() const;
enum ScriptsType { Sub, Super, SubSup, Multiscripts };
ScriptsType m_kind;
RenderMathMLScriptsWrapper* m_baseWrapper;
};
RENDER_OBJECT_TYPE_CASTS(RenderMathMLScripts, isRenderMathMLScripts())
}
#endif // ENABLE(MATHML)
#endif // RenderMathMLScripts_h