RenderMathMLBlock.h [plain text]
#ifndef RenderMathMLBlock_h
#define RenderMathMLBlock_h
#if ENABLE(MATHML)
#include "RenderFlexibleBox.h"
#include "RenderTable.h"
#include "StyleInheritedData.h"
#define ENABLE_DEBUG_MATH_LAYOUT 0
namespace WebCore {
class RenderMathMLOperator;
class RenderMathMLBlock : public RenderFlexibleBox {
public:
RenderMathMLBlock(Element* container);
virtual bool isChildAllowed(RenderObject*, RenderStyle*) const;
virtual bool isRenderMathMLBlock() const { return true; }
virtual bool isRenderMathMLOperator() const { return false; }
virtual bool isRenderMathMLRow() const { return false; }
virtual bool isRenderMathMLMath() const { return false; }
virtual bool isRenderMathMLFenced() const { return false; }
virtual bool isRenderMathMLFraction() const { return false; }
virtual bool isRenderMathMLRoot() const { return false; }
virtual bool isRenderMathMLSquareRoot() const { return false; }
virtual bool isRenderMathMLSubSup() const { return false; }
virtual bool isRenderMathMLUnderOver() const { return false; }
virtual RenderMathMLOperator* unembellishedOperator() { return 0; }
bool isPreferredLogicalHeightDirty() const { return preferredLogicalWidthsDirty() || m_preferredLogicalHeight < 0; }
LayoutUnit preferredLogicalHeight() const { ASSERT(!isPreferredLogicalHeightDirty()); return m_preferredLogicalHeight; }
static const int preferredLogicalHeightUnset = -1;
void setPreferredLogicalHeight(LayoutUnit logicalHeight) { m_preferredLogicalHeight = logicalHeight; }
virtual void computePreferredLogicalWidths() OVERRIDE;
virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const OVERRIDE;
#if ENABLE(DEBUG_MATH_LAYOUT)
virtual void paint(PaintInfo&, const LayoutPoint&);
#endif
RenderMathMLBlock* createAnonymousMathMLBlock(EDisplay = FLEX);
void setIgnoreInAccessibilityTree(bool flag) { m_ignoreInAccessibilityTree = flag; }
bool ignoreInAccessibilityTree() const { return m_ignoreInAccessibilityTree; }
private:
virtual const char* renderName() const OVERRIDE;
bool m_ignoreInAccessibilityTree;
protected:
void computeChildrenPreferredLogicalHeights();
static LayoutUnit preferredLogicalHeightAfterSizing(RenderObject* child);
LayoutUnit m_preferredLogicalHeight;
};
inline RenderMathMLBlock* toRenderMathMLBlock(RenderObject* object)
{
ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRenderMathMLBlock());
return static_cast<RenderMathMLBlock*>(object);
}
inline const RenderMathMLBlock* toRenderMathMLBlock(const RenderObject* object)
{
ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRenderMathMLBlock());
return static_cast<const RenderMathMLBlock*>(object);
}
void toRenderMathMLBlock(const RenderMathMLBlock*);
class RenderMathMLTable : public RenderTable {
public:
explicit RenderMathMLTable(Element* element) : RenderTable(element) { }
virtual int firstLineBoxBaseline() const OVERRIDE;
private:
virtual const char* renderName() const OVERRIDE { return "RenderMathMLTable"; }
};
}
#endif // ENABLE(MATHML)
#endif // RenderMathMLBlock_h