#ifndef ShapeOutsideInfo_h
#define ShapeOutsideInfo_h
#include "core/rendering/shapes/ShapeInfo.h"
#include "platform/geometry/LayoutSize.h"
namespace WebCore {
class RenderBlockFlow;
class RenderBox;
class FloatingObject;
class ShapeOutsideInfo FINAL : public ShapeInfo<RenderBox>, public MappedInfo<RenderBox, ShapeOutsideInfo> {
public:
LayoutUnit leftMarginBoxDelta() const { return m_leftMarginBoxDelta; }
LayoutUnit rightMarginBoxDelta() const { return m_rightMarginBoxDelta; }
bool lineOverlapsShape() const { return m_lineOverlapsShape; }
static PassOwnPtr<ShapeOutsideInfo> createInfo(const RenderBox& renderer) { return adoptPtr(new ShapeOutsideInfo(renderer)); }
static bool isEnabledFor(const RenderBox&);
void updateDeltasForContainingBlockLine(const RenderBlockFlow&, const FloatingObject&, LayoutUnit lineTop, LayoutUnit lineHeight);
virtual bool lineOverlapsShapeBounds() const OVERRIDE
{
return computedShape().lineOverlapsShapeMarginBounds(m_referenceBoxLineTop, m_lineHeight);
}
protected:
virtual CSSBoxType referenceBox() const OVERRIDE
{
if (shapeValue()->cssBox() == BoxMissing)
return MarginBox;
return shapeValue()->cssBox();
}
virtual LayoutRect computedShapeLogicalBoundingBox() const OVERRIDE { return computedShape().shapeMarginLogicalBoundingBox(); }
virtual ShapeValue* shapeValue() const OVERRIDE;
virtual void getIntervals(LayoutUnit lineTop, LayoutUnit lineHeight, SegmentList& segments) const OVERRIDE
{
return computedShape().getExcludedIntervals(lineTop, lineHeight, segments);
}
virtual const RenderStyle* styleForWritingMode() const OVERRIDE;
private:
ShapeOutsideInfo(const RenderBox& renderer)
: ShapeInfo<RenderBox>(renderer)
, m_lineOverlapsShape(false)
{ }
LayoutUnit m_leftMarginBoxDelta;
LayoutUnit m_rightMarginBoxDelta;
LayoutUnit m_borderBoxLineTop;
bool m_lineOverlapsShape;
};
}
#endif